How to Request a Payment

Introduction

Before checking out a basket using Deliverect Pay Dpay a commerce platform must first initiate a payment request to the payment provider.

1. Get Payment Gateway

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

Payment Gateways Configuration

Payment Gateway
A payment platform must be integrated and linked to stores by the merchant before they can be used to process payments. For more information about how payment gateways are managed in Deliverect see guide here

Types of payment gateways

Merchants can create online and offline payment gateways in Deliverect. Online payment gateways allow end users to complete checkout through an online payment service, such as Adyen or Stripe. Offline payment gateways allow checkout to continue when the payment happens outside the scope of a commerce integration.

Heading
For a DPay integration, only gateways with "paymentType": "online" are compatible, as they'll support the required re-direct or tokenization flow. You can safely ignore non-online gateways

  [
    {
        "id": "68e79ac****01c94d3044",
        "integration": 1,
        "paymentType": "online"
    }
]
  1. Request a payment

Initiate a payment request with the selected provider and re-direct the user to the URL returned in the payment request response to complete the transaction. The payment remains 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 URL

Set the 'Payment Update Webhook URL' in the channel settings as below to receive updates to confirm a payments authorisation status;


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

Authorized Payments
After the payment update webhook confirms the payment with "status": "authorized", the basket checkout can proceed.


See related guides

Did this page help you?