Integrating Retool with Adyen
Integrating Retool with Adyen involves connecting the two platforms to enable seamless payment management and transaction processing through Retool’s user interface. This guide provides a detailed technical walkthrough of the integration process.
Prerequisites
- Ensure you have a Retool account and access to the project where the integration will occur.
- Have an active Adyen account with API access credentials (API key and Merchant Account).
- Basic understanding of Retool’s interface and Adyen’s API documentation.
Setting Up Your Adyen Account
- Log in to your Adyen account and navigate to the Customer Area.
- Ensure API credentials are set up: Go to Account > API credentials and create a new API credential if necessary.
- Note the API key and Merchant Account information you will use in Retool.
- In the API & Webhooks section, ensure the correct endpoints are enabled for the environment you are working in (e.g., test or live).
Configuring a Resource in Retool to Connect to Adyen
- Log in to your Retool account and access the project where you want to integrate Adyen.
- Navigate to Resources in the left menu and select Create New.
- Choose REST API as your resource type since Adyen’s integration will primarily be through REST API calls.
- Enter a name for your Adyen resource for easy identification.
- In the Base URL field, add the Adyen endpoint. For testing purposes, you might use "https://checkout-test.adyen.com/v49/payments" or the appropriate live endpoint for production.
- Add authentication headers: Use the Headers tab to input your API key, formatted as:
Authorization: Bearer YOURAPIKEY
.
- Save the resource configuration.
Building API Queries in Retool
- In your Retool app, navigate to the Query Editor to start creating queries using the Adyen resource you configured.
- Create a new query, select the Adyen resource, and specify the HTTP method needed for your operation, such as POST for making a payment.
- Construct the body of your API request: Include necessary fields per Adyen’s API documentation, such as
amount
, currency
, and paymentMethod
.
- Use Retool variables or form inputs to dynamically fill the request body with user-provided data.
- Example request body for initiating a payment:
{
"merchantAccount": "YOURMERCHANTACCOUNT",
"amount": {
"currency": "EUR",
"value": 1000
},
"paymentMethod": {
"type": "scheme",
"number": "4111111111111111",
"expiryMonth": "03",
"expiryYear": "2030",
"cvc": "737"
},
"reference": "YOURORDERREFERENCE"
}
Handling Responses and Errors
- Within the Retool query editor, use scripting to handle the Adyen responses. Capture the response to check for transaction success or errors.
- Parse the response JSON to retrieve information such as
resultCode
and pspReference
for tracking transactions.
- Utilize Retool’s {{ }} templating to display statuses or error messages on your Retool application UI.
Testing the Integration
- Ensure your application is in testing mode, and run your Retool app to initiate test transactions through Adyen.
- Verify that all queries execute correctly and that transactions are properly logged and handled in both Retool and Adyen.
- Troubleshoot and resolve any API errors by referring to Retool's logs and Adyen’s API documentation.
Deploying the Integrated Application
- Once tests are successful, prepare your Retool app for deployment, ensuring all API keys and environment settings are correctly configured for a production setup.
- Monitor the transactions post-deployment to ensure consistent functionality and address any issues that arise in your Retool interface or Adyen integration.
By following these steps, you can integrate Retool with Adyen successfully, enabling you to manage Adyen payments directly within your Retool applications. This integration leverages Retool’s powerful UI capabilities with Adyen’s payment processing robustness.