An Example
Here’s an example of how you’d implement HTML checkout:Try it OutYou can try out the payment above. Use the card number
4187427415564246
with CVV 828 and expiry 09/32, or grab a test card or bank account from our
Testing helpers page and try making the payment. It works!type="submit" so the form submits when it’s clicked.
After Payment
Four things will happen when payment is made (successful or cancelled):- We’ll redirect to your
redirect_urlwithstatusandtx_refquery parameters after payment is complete. - We’ll send you a webhook if you have that enabled.
- We’ll send an email receipt to your customer if the payment was successful (unless you’ve disabled that).
- We’ll send you an email notification.
status query parameter will be one of the following:
"cancelled": If the customer clicks “Cancel Payment”."successful": If the payment was successful. There’ll also be atransaction_idquery parameter containing the Flutterwave transaction ID.
Node.js
What if the Payment Fails?
If the payment attempt fails (for instance, due to insufficient funds), you don’t need to do anything. We’ll keep the payment page open so the customer can try again until the payment succeeds or they choose to cancel. If you have webhooks enabled, we’ll send you a notification for each failed payment attempt. This is useful in case you want to later reach out to customers who had issues paying.Handling Payment Retries and Timeout on Checkout
Flutterwave allows you to configure retries and timeouts on checkout to improve your customers’ experience further. Timeouts help you limit the completion time for each payment. Once the timeout period is completed, the payment window is closed, and the user is redirected to the specified URL (redirect_url). Uncompleted transactions are cancelled and marked as failed.
Timeouts can be set to a maximum value of 1440 minutes.
Additionally, You can limit how many attempts users make on checkout. By setting max_retry, the user is prevented from attempting transactions unnecessarily at checkout. When making a payment, the transaction would be cancelled and marked as failed if the user attempts to reach max retry.
Using these configurations can help you improve security on checkout by limiting malicious users’ payment attempts. For example, If timeout and retry for a transaction are set to 10 mins and five (5) attempts respectively, The transaction fails automatically if the user makes more than five attempts or spends longer than 10 mins to complete the transaction.