Redirect buyer for payment approval
DocsLimited
Last updated: Oct 6th, 8:12am
- After you create the order, extract the
payer-actionlink from thelinksarray in the Create order response. - Set your Afterpay payment button to open this URL when clicked. This sends the buyer to Afterpay's hosted payment page.
- The buyer logs into their Afterpay account and reviews the payment schedule (Pay-in-4 instalments or monthly payments).
- If the buyer approves the payment:
- Upon approval, PayPal automatically captures the full payment amount immediately.
- The buyer is redirected to your
return_url. - The
CHECKOUT.ORDER.COMPLETEDwebhook is triggered, confirming both approval and capture in a single event.
- If the buyer cancels or an error occurs:
- The buyer is redirected to your
cancel_url. - Order status remains
PAYER_ACTION_REQUIRED.
- The buyer is redirected to your
- If the buyer approves the payment:
Note: Afterpay sessions have a 4-hour timeout. If the buyer doesn't complete approval within this window, the session expires and the buyer is redirected to your cancel_url.