The example-app
module is used for development and testing purposes. It should not be used as a template for your own integration. Check out the docs for best practices on integration.
Steps to run the example app:
- Build a server that acts as a proxy between the app and the Adyen Checkout API.
- Your server should mirror the necessary endpoints for your flow (for example /sessions for the sessions flow and /paymentMethods, /payments and /payments/details for the advanced flow).
- The API key should be managed on the server.
- Duplicate
example.local.gradle
and name itlocal.gradle
. Make sure the file is placed in theexample-app
directory. - Replace the predefined values:
MERCHANT_SERVER_URL
: the URL to your server.CLIENT_KEY
: your client key. Find out how to obtain it here.MERCHANT_ACCOUNT
: your merchant account identifier.AUTHORIZATION_HEADER_NAME
: the name of the authorization header as expected by your server. You can use an empty string if this is not applicable for you.AUTHORIZATION_HEADER_VALUE
: the value for the authorization header. You can use an empty string if this is not applicable for you.
- Sync the project.
- Run on any device or emulator.
Warning
In case you don't have your own server you can connect to the Adyen Checkout API directly for testing purposes only. Be aware this could potentially leak your credentials, the market-ready application must never connect to Adyen API directly.
To connect to the Adyen Checkout API directly you can use the following values:
MERCHANT_SERVER_URL
:https://checkout-test.adyen.com/{VERSION}/
(check here for the latest version).AUTHORIZATION_HEADER_NAME
:x-api-key
.AUTHORIZATION_HEADER_VALUE
: your API key.