What is surcharging?
Surcharging enables you to charge customers an additional fee depending on the payment method or card they pay with. Applying this surcharge fee is a way to cover the costs associated with processing payments on each of the available payment methods. Universal Checkout can help you manage and present your surcharge in a unified way across all your platforms and payment methods.
Card surcharge on Web
It is worth noting that, while Universal Checkout supports this feature natively, payment method surcharge is regulated, or even prohibited, in many countries.In addition, some payment methods have guidelines and agreements that prohibit surcharging fees. Universal Checkout is not opinionated in this regard, and will always attempt to present the surcharge to the user.
Get started with Drop-in Checkout
High level flow
- First, create a client session with the line items and the surcharge amount for all of your payment methods and card networks.
- During its initialization, Drop-in Checkout automatically retrieves the surcharge data and presents the amount to the user.
- When the user selects a payment method, Drop-in Checkout automatically adds the surcharge amount to the client session.
- When a payment is created, the full amount including surcharging is used to process the transaction.
Step 1. Configure the client session
Pass the surcharge amount for each payment method that you support when creating a client session. The surcharge feature is activated when at least one payment method has a surcharge amount attached.JSON
Step 2. Present the drop-in checkout
Once the client session is created, use the client token to present the drop-in checkout as usual. The drop-in checkout automatically retrieves the surcharge fees from the client session and displays them on its UI.
Surcharge
On Web, applying surcharge forces the payment method “Card” to appear as a button instead of a form.
SURCHARGE with the relevant surcharge amount.
Similarly, when the user unselects a payment method, the SDK automatically patches the client session to remove the surcharge fee.
Step 3. Update the surcharge amount (optional)
You can update the client session at any time to modify the surcharge fees attached to each payment method. This is particularly useful on Web if the user has the opportunity to update their cart while interacting with our drop-in checkout. This automatically updates the fee of typeSURCHARGE added by the SDK to the new amount for the currently selected payment method. You can also use this mechanism to enable and disable surcharging during a client session.
Typescript
Step 4. Create a payment
By default, the drop-in checkout creates payments automatically. This payment takes into account the surcharge amount, so you don’t have to do anything. If you choose to create payment manually, make sure to not pass the top-levelamount or order.fees on the payment request as this would override the amount set during the client session.
Considerations
Security measures have been put in place to prevent users, malicious or not, to bypass surcharging:- If the surcharge options have been passed but no surcharge fee is present in the client session, the payment will fail to be created.
- If the surcharge options have been set but the surcharge fee does not match the selected payment method, the payment will fail to be created.