Why am I not getting a notification from the Vodapay backend when a payment is completed? - vodapay-miniprogram

I provided the Vodapay backend with an endpoint to send a notification to when a payment is completed (paymentNotifyUrl), however, I am not receiving anything from Vodapay.

When a payment succeeds, the Vodapay backend sends you a notification immediately.
If the payment goes into one of these 3 states
Processing (my.tradePay returns status 8000)
User cancelled (my.tradePay returns status 6001)
Payment failed (my.tradePay returns 4000)
The attribute "paymentExpiryTime" in the payload you send to the payments/pay endpoint determines how long it will take for the Vodapay backend to send a notification to your endpoint.
If the payment enters one of the 3 states above, you can allow the user to retry the payment using the same "redirecturl", as long as the time you had set in "paymentExpiryTime" has not arrived.
The default time period for "paymentExpiryTime" is 7 days from the time of the payment. If based on your business requirements, this is too long a period, then you can set it to a shorter time frame eg. a date/time 30mins into the future.

Related

Flow designer-Sequential approvals for a record 3levels

I’m trying to do a flow designer for 3 levels of approvals if X approves send approval request to Y, if Y approves send approval request to Z and set timer for each approval request as 15days. Send reminder notification for 7 days on 8th day, for every approval request send a notification if rejected send a notification and update record to draft state, if cancelled after 15days send cancelled notification and set state to draft. I created a flow for all 3 levels and they are working fine but I’m stuck at creating reminder notifications. For every approval I should calculate time from previous approval approved time. Which I couldn’t. Someone please help me with this.

How to tell Inertia to rerender view (with updated data) from a webhook?

I am using stripe for payments and have a webhook set up for events. - If a customer's credit card expires and he enters new payment info, stripe automatically retries the failed subscription and sends a webhook to show if subscription renewal failed or succeeded.
I like to update the frontend depending on the renewal status which might come in a few seconds after the payment info got updated. - Is there a way to have Inertia re=request the data and re-renders frontend from a webhook - not from a user request?

Laravel events no response body returnd to Stripe

After successful purchase is made on my website, stripe fires a webhook to finalize the transaction.
What is happening is I am firing 2 laravel events:
Send email confirmation of order to the customer
Send email notification to admin of site alerting them to the purchase.
If I just fire the event to send email confirmation to customer, the stripe webhook is successful.
When I add the notification to admin, Stripe advises that the HTTP Status Code has timed out that there was no response body and the web hook fails, even though all the emails were sent correctly. And what will happen is stripe will attempt to refire the webhook which is not what I want.
Has anyone experienced this issue?
#DelenaMalan is correct, once you receive a Stripe webhook event you should immediately acknowledge receipt by returning a 200 response and then handle your business logic like sending emails afterwards. See https://stripe.com/docs/webhooks/build#return-a-2xx-status-code-quickly

Design Slackbot service to send automated messages

It is my very first time to write a slack bot and i am wondering how to design it.
The bot supposed to be available and respond to end-users' messages immediately.
The thing is that I need that the bot will also send schedules messages to registered users with automation results.
Use case example:
A user sends a message to the bot and registered to a service that
will check for changes in X. On a specific interval, my backend will
call an automation that checks for those changes and will send a
message to the user with the results.
What will be the best practice for this scenario?
Here is a basic outline.
1. Basic setup
Slack app with bot user
Database
Scheduler (e.g. local CRON service, or web-cron like cron-job.org)
2. Registration
Use Events API to listen to messages from users send via mention (app_mention) or direct message (message.im)
You app needs to store the received "registration" from each user in a database
Respond to user request directly if needed with chat.postMessage
3. Scheduled response
Scheduler calls your app
Your app check if responses are due with a database query
If yes: App sends responses to users via chat.postMessage (but not more than one message per sec due to rate limiting)

Handling post notifications that may take more than 20 seconds

We are integrating with SagePay using the server integration method.
The notification POST from SagePay calls back to a PHP script our side.
Our PHP callback itself has to call several methods on an external webservice.
Sometimes, due to network latency, our callback script takes over 20 seconds to run. SagePay doesn't like this and reissues a new notification POST. This results in our callback ultimately running twice, or more, which is less than ideal (sends out multiple payment complete emails etc). Basically SagePay keeps issuing notifications until it gets a response in less than 20 seconds.
We can't just ignore the latest POST request from SagePay as they 'forget' about any previous notifications and look to receive a response from the most recent one. We can't do anything about network latency either.
Does anyone have any advice on what to do in such a situation?
The first thing your Notification callback could do is to check the transaction table and if not already updated then update the transaction table with the message and continue with your business processing, or else discard the repeated call. I wasn't aware that Sagepay only accepted a response from the most recently issued Notification callback, and this isn't mentioned in the integration guide.
You should still aim to speed it up, however. Have a think about how you might send your emails in a cron/scheduled job every minute, so that your customers are not held-up waiting for your third parties to respond. Rather than sending emails in your Notification callback you can simply add rows to an email_queue table, to be processed later by the cron job.

Resources