When initializing the widget, it is possible to change the payment flow by setting certain parameters in its configuration:
flowType: Sets the flow type for the widget based on the assigned value:
singleStep
: Sets the default payment flow, meaning the entire transaction process will be carried out in a single instance of the widget.twoStep
: It establishes a two-step payment flow, meaning two instances of the widget would be created to complete the transaction. On the one hand, the payment information (disclaimer/cards/accounts) is embedded, and on the other, the payment event (submit) is handled, which will initialize a dedicated instance for the payment.
Currently, the payment flow configuration are available exclusively for PayPal.

Global configuration
The payment flow can be configured globally, i.e. for all payment methods, by setting the configuration within the behavior
parameter:
await DeunaSDK.initPaymentWidget({
orderToken: '<order_token>',
...,
behavior: {
paymentMethods: {
flowType: {
type: 'singleStep' | 'twoStep'
}
}
}
});
Configuration by payment method
Just as you can set global configuration for all payment methods, you can also set separate configuration for each payment method. It's worth noting that this configuration per payment method are more relevant than the global configuration.
await DeunaSDK.initPaymentWidget({
orderToken: '<order_token>',
...,
paymentMethods: [
{
paymentMethod: 'wallet',
processors: ['paypal_wallet'],
configuration: {
flowType: {
type: 'singleStep' | 'twoStep'
},
...
},
...
},
...
]
});
Express flow
Currently only available for PayPal.
The Express Flow is available by default and occurs when only one payment method is integrated. This flow will always attempt to process the transaction automatically. For this to happen, the following criteria must be met:
- The customer has previously authorized a PayPal account.
- No installments are required for the transaction.
If installments are required for the transaction, they will be requested from the customer during the payment attempt. In this specific case, it is recommended to disable the Express Flow to show the customer their available accounts and thus pre-select the corresponding installments.
await DeunaSDK.initPaymentWidget({
orderToken: "<DEUNA order token>",
paymentMethods: [
{
paymentMethod: "wallet",
processors: ["paypal_wallet"],
configuration: {
express: true // AUTO PURCHASE (by default is true when not sent)
}
}
]
});
Configuration parameters
Parameter | Type | Default Value | Description |
---|---|---|---|
express | Boolean | true | When true , the widget will automatically process the payment if the customer already has a linked PayPal account. When false , even if the customer already has a linked PayPal account, the widget will allow the user to a/ select installments (if applicable) and b/ select the account to use (if the customer has more than one linked PayPal account). |