Skip to content

Commit

Permalink
Add section to README explaining how to run the example app
Browse files Browse the repository at this point in the history
COAND-831
  • Loading branch information
OscarSpruit committed Mar 11, 2024
1 parent a0fdfd8 commit 0b8aa4b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ If you are upgrading from 4.x.x to a current release, check out our [migration g
If you use ProGuard or R8, you do not need to manually add any rules, as they are automatically embedded in the artifacts.
Please let us know if you find any issues.

## Development

For development and testing purposes the project is accompanied by a test app. See [here](example-app/README.md) how to set it up and run it.

## Support

If you have a feature request, or spotted a bug or a technical problem, [create an issue here][github.newIssue].
Expand Down
27 changes: 27 additions & 0 deletions example-app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Example app

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](https://docs.adyen.com/online-payments/build-your-integration/) for best practices on integration.

## Running the app

Steps to run the example app:
1. 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](https://docs.adyen.com/api-explorer/Checkout/latest/post/sessions) for the sessions flow and [/paymentMethods](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods), [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) and [/payments/details](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/details) for the advanced flow).
* The API key should be managed on the server.
2. Duplicate `example.local.gradle` and name it `local.gradle`. Make sure the file is placed in the `example-app` directory.
3. Replace the predefined values:
* `MERCHANT_SERVER_URL`: the URL to your server.
* `CLIENT_KEY`: your client key. Find out how to obtain it [here](https://docs.adyen.com/development-resources/client-side-authentication/#get-your-client-key).
* `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.
4. Sync the project.
5. 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](https://docs.adyen.com/api-explorer/Checkout/latest/overview) for the latest version).
* `AUTHORIZATION_HEADER_NAME`: `x-api-key`.
* `AUTHORIZATION_HEADER_VALUE`: your API key.

0 comments on commit 0b8aa4b

Please sign in to comment.