Requirements
Compliance
Surcharges must comply with legal, regulatory, and card scheme requirements. For example, schemes require that you provide signage to inform customers about the payment methods that are subject to surcharges, and the related costs such as the surcharge percentage. Surcharging is also subject to specific local/jurisdictional restrictions. For example, in the European Economic Area (EEA) surcharges are not allowed on payments made with a consumer card that was issued in the EEA. And in the US surcharges are not allowed on payments made with a debit card. The Adyen surcharge feature does not include automated global compliance enforcement. You must validate your setup against the compliance considerations and local mandates. We strongly recommend you consult your own legal advisor on compliance with regulatory and legal implications and use the correct settings based on our Surcharge compliance guide.How it works
When your shopper proceeds to pay:- Collect the shopper’s card details on your checkout page.
- From your server, make a /cardDetails request using the shopper’s card details, to get the information that helps to make a decision about the surcharge.
- Implement logic to decide if a surcharge is allowed, and to calculate the surcharge amount, using the data from the /cardDetails response.
- Display the surcharge amount on your checkout page.
- When the shopper proceeds to pay, from your server, make a /payments request that includes the surcharge amount.
Get card details
Use the customer’s raw or encrypted card number to make an API request that retrieves the details of the card that helps to determine whether you can apply surcharge to a payment.- In your payment form, collect the card number of the customer with either of the following:
-
From your server, make a /cardDetails request, including:
Make a request to get information about the card
curl
Java
PHP
C#
NodeJS (JavaScript)
Go
Python
Ruby
NodeJS (TypeScript)
-
In the response, note the following data to:
- Determine whether a surcharge is applicable for a payment.
- Calculate the surcharge amount that you can apply.
Example /cardDetails response - Use the data from the response to build your logic that determines whether you can apply surcharge on a payment with this card, and calculate the surcharge amount. Refer to our Surcharge compliance guide when determining to which transactions you can apply a surcharge.
Make a payment including the surcharge
After you calculate the surcharge amount, disclose the surcharge amount to your shopper and include the surcharge in your payment request.- Make a /payments request with your API only with raw card data integration, or with your API only with encrypted card data integration.
-
In your request include a
surchargeobject, that specifies thevalueof the surcharge you apply to the transaction. -
Calculate the value you need to pass in the
amount.valueobject in your /payments request by adding the surcharge amount to the original transaction amount. Make a payment with encrypted card details including a surchargeThe /payments response contains:pspReference: Our unique identifier for the transaction.resultCode: Use this to present the payment result to your shopper.merchantReference: The reference from the/paymentsrequest.additionalData: Additional information about the transaction. You can optionally enable receiving the surcharge amount in additional data.
Receive the surcharge in additional data
To receive the amount of surcharge you apply to a transaction in theadditionalData object of the /payments response, or in the AUTHORISATION webhook:
- In your Customer Area, go to Developers > Additional data.
- Select Surcharge amount.
- Select Save configuration.