Adyen
Lago’s native integration with Adyen allows you to collect payments automatically when new invoices are generated.
Lago’s seamless integration with Adyen offers a wide range of payment options, enabling you to conveniently collect payments from your customers. Supported payment methods include:
- Card payments (Visa, MasterCard, CB)
- Apple Pay
- Paypal
- American Express
- Amazon Pay
- Google Pay
And many more! With Lago’s native Adyen integration, you can offer your customers a variety of payment options, enhancing their convenience and flexibility during transactions.
Please ensure that you have added payment methods to your Adyen account before setting up the integration (see Adyen documentation).
Connecting Lago to Adyen
To set up the Adyen integration in Lago from our user interface, follow these steps:
- In the side menu of your Lago app, navigate to Settings;
- Select the Integrations tab;
- Click “Adyen” to create a connection;
- Give a name to this connection;
- Assign a code for easy identification;
- Enter the required connection fields (described in the next section); and
- Click Connect to Adyen to confirm the integration.
Adyen Connection Fields
When connecting Lago to Adyen, you need to provide information for the following fields.
Setting up Adyen’s payments auto-capture
To enable automatic payment capture in your Adyen account, ensure that you have configured the account settings accordingly. Automatic payment capture allows for immediate processing without manual intervention. Refer to Adyen’s documentation for instructions on setting up auto capture.
Turn on Adyen’s recurring details
In Adyen, to enable recurring payments for a stored payment method, follow these steps:
- Go to Developers > Additional Data;
- Check the box for Recurring Details; and
- Click Save.
Adyen recurring details option
Setting up Adyen Webhook for listening to important events
This step is crucial and mandatory for Lago to receive and process messages from Adyen, enabling functionalities such as customer creation/update, payment processing, and refunds. To configure Adyen webhook and establish communication with Lago, follow the steps below:
- Access your Adyen application and navigate to the Developers section;
- Select Webhooks and create a new webhook of type Standard;
- In the Server configuration section, locate the General settings; and
- Copy and paste the following URL:
https://api.getlago.com/webhooks/adyen/{{your_organization_id}}?code={{connection_code}}
.
You can find your Organization ID in Lago under the Developers section in Lago, specifically in API keys & ID > Organization ID.
To find your connection code, navigate to the Integrations section in Lago and select the appropriate connection code for your Adyen integration.
Please ensure that you complete this setup correctly, as your Adyen integration will not function without this vital step.
Setting Adyen as a Payment Provider for a customer
In order to facilitate automated payment collection, it is essential for the customer to exist in both the Lago and Adyen databases. Please note that in Adyen, customers are referred to as Shoppers.
Adding a new customer in Adyen
If the customer does not already exist in Adyen, you can create them in Lago using either the user interface or the API. When providing customer information, please ensure the following:
- Set Adyen as the customer’s default payment provider;
- Select the Adyen connected account;
- Keep the field associated with the Adyen Payment Provider Customer ID empty; and
- Enable the option to automatically create the customer in Adyen.
Adyen as PSP for new customer
Once the customer is added in Lago, they will be automatically synchronized with Adyen. Adyen will generate a unique Shopper ID, which will be stored in Lago. Typically, Adyen utilizes the Lago customer’s external_id
as the Shopper ID for seamless integration between the two platforms.
Upon successful customer creation, you will receive two webhook messages to keep you informed:
customer.checkout_url_generated
: This message includes the checkout URL that provides access to the default payment method. It allows you to perform a pre-authorization payment and store the payment method securely; andcustomer.payment_provider_created
: This message confirms the successful creation of the customer in Adyen, indicating that the customer’s details have been added to the Adyen database.
You may need to enable Developers -> Additional Data -> Payment -> Recurring details for the customer to be automatically created.
Please note that the customer will be created in Adyen only if the payment method has been stored through the checkout URL and pre-authorization payment.
Using an existing customer from Adyen
If the customer and direct debit mandate already exist in Adyen, you can create the customer record in Lago using either the user interface or the API. Follow these steps when adding customer information:
- Set Adyen as the default payment provider for the customer in Lago;
- Select the Adyen connected account;
- Provide the Adyen Shopper Reference as the Lago Payment provider customer ID.
- Disable the option to automatically create the customer in Adyen.
By following these steps, you can integrate an existing customer from Adyen into Lago, ensuring synchronization and consistency between the two platforms.
Adyen as PSP for existing customer
Redirect url after checkout
After establishing the connection with Adyen, set a success URL where your end customer will be directed after completing the checkout. Please note that if it’s not defined, your end customer will be redirected to Adyen’s website.
Please note that you can edit or delete the redirect URL, and this will only affect new checkout URLs created.
URL defined should always begin with http://
or https://
.
Adyen Checkout: storing customer’s payment method information
When Lago automatically creates a customer in Adyen, you will receive a checkout link from Lago to facilitate the storage of your customer’s payment method information.
The payload sent by Lago will have the following structure, with the checkout link stored under checkout_url
:
{
"webhook_type": "customer.checkout_url_generated",
"object_type": "payment_provider_customer_checkout_url",
"payment_provider_customer_checkout_url": {
"lago_customer_id": "88d23508-47fd-46bb-a87e-50c50f3cb371",
"external_customer_id": "hooli_1234",
"payment_provider": "adyen",
"payment_provider_code": "adyen_test",
"checkout_url": "https://test.adyen.link/PLEEA656869B11DF6B"
}
}
Note: The checkout link automatically expires after 69 days.
By utilizing this provided checkout link, your customers can perform a pre-authorization payment. It’s important to note that the pre-authorization payment will not collect any funds from the customer. Once the pre-authorization is confirmed, Lago will send the payment method details and securely store them into Adyen for future transactions.
Adyen checkout with Lago
Regenerate checkout link on demand
In cases where your end customer has not had the opportunity to complete the checkout process to inform their payment method or wishes to modify the saved payment information, you can generate a new checkout link using the designated endpoint.
POST /api/v1/customers/:customer_external_id/checkout_url
Upon successful generation, the new checkout link will be available in the endpoint response, and it will not be delivered through a webhook message. It is important to note that the new link will inherit the same expiration setting as the original one.
It is crucial to be aware that if a customer is not associated with any payment provider, the response will contain an error message.
Creating payments from Lago Invoices
When a customer has Adyen defined as their payment provider, Lago seamlessly automates the process of triggering payments in Adyen whenever a new invoice is generated.
This integration ensures that payments are initiated in Adyen without any manual intervention. Lago’s automatic payment creation saves time and effort, providing a streamlined experience for both you and your customers.
Creating refunds from Lago Credit Notes
In cases where a customer has Adyen defined as their payment provider, Lago simplifies the refund process by automatically triggering refunds in Adyen whenever a new refund is initiated through credit notes.
This integration eliminates the need for manual refund processing and ensures that refunds are efficiently handled in Adyen. Lago’s automated refund functionality helps you maintain accurate and timely refund transactions, enhancing customer satisfaction and operational efficiency.
Payment disputes
In the event of a lost chargeback (dispute) within Adyen, Lago initiates an automatic response by marking the relevant invoice as disputed lost. This action involves populating the dispute_lost_at
field with the timestamp when the dispute was lost. Following this update:
- The invoice becomes non-voidable;
- Generating a credit note is possible; however, refunding the payment back to the original payment method is not permitted; and
- The invoice cannot be resent for collection.
Watch the demo video
Was this page helpful?