How to Request a Payment

Introduction

Before checking out a basket with Deliverect Pay (DPay), a commerce platform must first request a payment from an integrated payment provider. The flow has three steps: get the store's payment gateways, request a payment, and listen for the payment's authorization through a webhook.

Payment Flow

1

Get Payment Gateways

Retrieve the payment gateways available for a store (channelLinkId) under a customer account.

Payment Gateway Setup
The merchant must integrate a payment platform and link it to their stores before it can process payments. To learn how payment gateways are managed in Deliverect, see this guide.

Payment Gateway Types

Merchants can create two types of payment gateway in Deliverect:

  • Online: The end user completes checkout through an online payment service, such as Adyen or Stripe.
  • Offline: Checkout continues while the payment itself happens outside the commerce integration.

Only gateways with "paymentType": "online" are compatible with a DPay integration, because they support the required redirect or tokenization flow.

[
  {
    "id": "68e79ac****01c94d3044",
    "integration": 1,
    "paymentType": "online"
  }
]
2

Request a Payment — Request Payment

Initiate a payment with an online gateway from step 1, then redirect the user to the action.url returned in the response to complete the transaction. The payment stays pending until the transaction is finalized.

{
  "paymentId": "68ed22c5***",
  "gateway": 1,
  "paymentStatus": "pending",
  "action": {
    "type": "redirect",
    "url": "https://checkout.providerredirect.com/c/pay/******g1a5cPaz2fbIdRRRmHXVKMi6rG7AljRysCBFY77U1BS64H#fidnandhYHdWc***********ndqcGthRmppancnPycmY2NjY2NjJyknaWR8anBxUXx1YCc%2FJ3Zsa2JpYFpscWBoJyknYGtkZ2lgVWlkZmBtamlhYHd2Jz9xd3BgeCUl"
  }
}
3

Configure the Payment Update Webhook

Set the Payment Update Webhook URL in the channel settings, as shown below. Deliverect sends a request to this URL each time the payment's status changes, including when it's authorized.

Payment Update Webhook URL channel setting
{
  "paymentId": "6***2c****c***dda6636",
  "status": "authorized",
  "metadata": {
    "gatewayProfileLinkId": "68ed22c5***",
    "methodRaw": "visa"
  }
}

Authorized Payments
Once the payment update webhook returns "status": "authorized", you can proceed with the basket checkout.


See related guides

Did this page help you?