Flows by payment type
Understand the flows by payment type.
Each payment method must follow a specific payment flow to ensure a seamless payment process. The payment flows and corresponding payment methods outlined below follow Digital River's recommended best practices.
Standard payment flow
Use the following flow for standard payments: Apple Pay, credit cards, and Google Pay.
Create a source using DigitalRiver.js. The source
state
ischargeable
.
Delayed payment flow
Submit a Konbini payment flow
Use the following flow for delayed payments, such as Konbini.
Get the store details.
Create a source using DigitalRiver.js. The source
state
ispending_funds
.The customer transfers the funds to the Konbini payment provider.
The source
state
changes tochargeable
when the funds are received.
Submit a Boleto payment flow
To use Boleto as a payment method:
Optional. Set the locale and currency.
curl --location --request GET 'https://{host}/v1/shoppers/me.json? locale=pt_BR¤cy=BRL' --header 'Content-Type: application/json'--header 'authorization: bearer ***\
Optional. Set the cart address to the
BR
address.Attach the tax ID to the cart. The action inserts the tax ID into the payment session.
Create a source using DigitalRiver.js with a payment session ID. Note that the tax ID is required when creating the Boleto source. The payment session ID provides the tax ID.
Submit a Wire Transfer payment flow
Use the following flow for delayed payments, such as Wire Transfer.
Create a source using DigitalRiver.js. The source
state
ischargeable
.The shopper receives the payment details and completes the payment. After the shopper finalizes the payment, the updated order status will appear in Global Commerce.
Redirect then submit (RTS) payment flow
Use the following flow for RTS payment methods, such as PayPal, PayPal Billing Agreement, PayPal Credit, PayPal Pay in 3, PayPal Pay in 4, and PayPal RatenZahlung (Installment Payment)
Create a source using DigitalRiver.js. The source
state
ispending_redirect
.Attach the source to the cart. The session
state
isrequires_confirmation
.
Submit then redirect (STR) payment flow
If you're using Drop-in payments and customers opt to fund a transaction with a payment method, such as Bancontact, Klarna, and SEPA Direct Debit, whose resulting source has a flow
of redirect
must be redirected to the payment provider, where they either approve or cancel the funds transfer.
You should submit the cart before payment in this scenario so that customers cannot end up in a situation where they have potentially sent payment, then the Digital River order did not get completed.
The table in the Supported payment methods section provides a full list of payment methods that require an STR flow.
How to implement an STR flow
In the createDropin()
method's configuration object, set the redirect
object's disableAutomaticRedirects
to true
. Assign the returnURL
to be your completion step such as order confirmation page. cancelURL
should return the customer to the cart or store workflow
If customers select a redirect payment method, the data
returned by onSuccess
contains a source whose state
is pending_redirect
. When you receive this event, retrieve the source.id
from the data
.
Next, pass this identifier in a server-side attach source to an order or cart.
This operation moves the source into "pending redirect" state, the order state to "Source pending redirect", and provides you with the redirectUrl
to present to the customer:
At this point, retrieve the cart data you need—such as currency
, orderTotal
, subTotal
, tax
, billingAddress
, shippingAddress
,payment.sources[]
, and relevant lineItems
—to build a review page.
If, after reviewing the transaction's details, customers click your submit order button, send a submit cart request.
If you get a 201 Created
response, then redirect the customer to the redirectUrl
, where they can either approve or cancel payment. Once the customer complete either of these actions, they're redirected to the URL you assigned to cancelUrl
or returnUrl
.
When the returnUrl
loads, call a function that initiates a server-side request and send the resume cart call. You do not need to perform this call if the customer goes to your cancelUrl
.
If you get a 200 OK
repsonse, verify the order's state is Submitted
and paymentSession
status is complete
. You can render the order confirmation page to the customer.
If you receive a 409 response with the error "Requisition is not present or not in Source Pending Redirect state", this indicates something went wrong. You must recreate the cart and return customers to the payment collection stage.
STR payment flow
Use the STR payment flow for Afterpay, Alipay (domestic), Alipay+ (cross-border), Amazon Pay Express Checkout, Bancontact, BLIK, CCAvenue, Clearpay, iDEAL, Klarna Financing, Klarna Pay in 3, Klarna Pay in 4, Klarna Pay in 30 days, Online Banking (FPX), Online Banking (IBP), Online Banking (Korea Bank Transfer), PayCo, SEPA Direct Debit, and Trustly.
Create a source using DigitalRiver.js with a session identifier (paymentSessionId). The source state is
pending_redirect
.Attach the source to the cart. The session
state
isrequires_confirmation
.Submit the cart. The session
state
ispending_redirect
.Resume cart to complete post-order processing.
STR sequence diagram
The Submit then Redirect (STR) sequence diagram illustrates the interactions between the client, server, and external payment provider during the STR payment flow. It includes key steps such as applying the shopper to a cart, handling session states, and completing the redirect authorization, ultimately leading to successful payment processing. The scope of the following diagram is limited to the operations in this flow.
Last updated