PayPal via Widget

This page includes the steps necessary to integrate PayPal using the DEUNA Widget.

Integration steps

Now that the technical requirements are set, you can start the integration.

1. Set up the payment processor

  1. Add the PayPal Wallet to your DEUNA Admin Connections.
  2. Search for "PayPal Wallet" and then enter your PayPal business account credentials.
DEUNA Admin | PayPal Wallet Configuration

📘

The Vaulting checkbox allows authenticated users to save their account for quick future purchases without requiring authentication in PayPal.

2. Create order

To make a purchase, you must first create a DEUNA order.

Follow the steps to Create an Order.

The API will return an order_token that is used throughout the entire flow.

Required fields:

FieldDescriptionValue
order.store_codeUnique code of storeall
order.payment_methodDEUNA payment method type. (For API Integration)wallet
order.items_total_amountTotal amount of items without taxes nor discounts.2000

Considerations:

  • About order.items:
    • total_amount.original_amount must be unit_price.amount * quantity.
    • total_amount.amount must be ((unit_price.amount + tax_amount.amount) * quantity) - total_amount.total_discounts.
    • total_amount.total_discounts is the total value of discounts for the quantity of items.
  • order.items_total_amount is the sum of the items unit prices, this amount added to the order.total_tax_amount and minus order.discount_amount must match with the order.total_amount.
  • order.sub_total is the sum of the items unit price minus discounts, this amount added to the order.total_tax_amount must match the order.total_amount.

📘

For Vaulting Flow:

order.payer_info.email or order.billing_address.email is required to be sent with exactly the same email which was used to create the user in DEUNA. This is critical for the vault flow the work.

3. Create User (Optional)

Create an user with DEUNA in order to get the authorization token to perform the purchase later. This API will return back a User's token which will be required to follow the next steps.

📘

We recommend to use the OTP to get a new token each time your customer confirms through the SMS or Email the code. Also, you can use an External Authentication login to manage the user auth tokens by your own without request them the OTP. Talked to your Sales Engineer for further guidance.

To create a user, follow the API Reference. In case the email used already exists, the API will return the message user already exists, so you can proceed to Request the OTP and then, Login with the OTP to obtain a fresh user token and proceed with the purchase.

Widget payments

The DEUNA widget allows for two payment processes for the PayPal Widget in DEUNA, which are documented in this guide. Each process is started depending on the attributes of the user who makes the purchase.

  • Express process: Completes the payment in the shortest possible time.
  • General process: Allows different payment methods.

Express

The express flow is initialized when the widget detects a single payment method experience. This flow allows the user to complete their payment in the shortest possible time.

Once the user gives consent to save their PayPal account, the payment is made automatically and with a single click.

PayPal Redirect View

New or guest user with vaulting disabled

The guest flow is defined for new users, registered users who are not authenticated or when the merchant has disabled the Vaulting feature. In this case, the checkout payment process is initialized, where the user will enter their PayPal account to make the payment but it will not be saved.

If the user is new, then their data is registered so that they can authenticate themselves for a future purchase and save their PayPal account for future payments.

Express - Checkout

Authenticated user without PayPal account saved

If the user is logged in but does not have a PayPal account saved, then the vaulting payment process is initiated and the user is redirected to the PayPal site where they will make the payment and give their consent to save their account and use it for future purchases.

Authenticated user with PayPal account saved

If the user has authenticated and already has a PayPal account saved, then the payment is processed immediately because they have previously given their consent.

Express - One Click

General

The general flow is enabled when the widget detects an experience with multiple payment methods.

The user will have a greater role because they are able to manage their accounts, that is, they are able to add multiple accounts or delete one that they no longer use.

Authenticated users also have the possibility to select payment installments depending on whether the merchant requires or allows them.

New or guest user with vaulting disabled

When the user is an unauthenticated/new user or the merchant has disabled the Vaulting feature:

  1. The user clicks the PayPal button
  2. The checkout payment process initiates
  3. The user must authenticate themselves in PayPal and make the payment.

In this process, the account is not saved because there is no previous identification of the user, and their data will already be registered (if they are new) so that in a future purchase they will have the possibility of authenticating themselves and giving consent to save their PayPal account.

Payment Widget View - PayPal

Purchase example

Here is an example of a user making a purchase with PayPal in DEUNA:

Widget - New user

Authenticated user without PayPal accounts saved

When the user has authenticated and has no saved accounts:

  1. The vaulting payment process is initiated and the user is redirected to PayPal.
  2. The user makes the payment on PayPal's site.
  3. The user give their consent to save their account and/or use it for future transactions.

If the merchant requires payment installments, then the user will have to select them after authorizing the payment in PayPal.

Authenticated user with PayPal accounts saved

If the user is logged in and has saved PayPal accounts, then they can select any account to make the payment. The user can also delete any accounts or save a new one.

If the merchant offers payment installments, then these are displayed with the account selected for payment and if the user wants to use a new PayPal account, they will have to select the installments after authorizing the payment in PayPal.

Single account view

This is an example of a user with a single PayPal account in DEUNA:

Payment Widget View - Single PayPal account

Multiple accounts view

This is an example of a user with multiple PayPal accounts in DEUNA:

Payment Widget View - Multiple PayPal accounts

Purchase example

This is an example of a user making a purchase with PayPal in DEUNA:

Widget - One Click

..


OSZAR »