Home
Softono
a

adyen-examples

Professional software vendor delivering innovative solutions on the Softono platform. Specialized in both open-source and proprietary software development.

Total Products
3

Software by adyen-examples

adyen-java-spring-online-payments
Open Source

adyen-java-spring-online-payments

# Adyen Online Payment Integration Demos This repository includes a collection of PCI-compliant UI integrations that show how to integrate with Adyen using different payment methods. The demos below leverages Adyen's API Library for Java using Spring ([GitHub](https://github.com/Adyen/adyen-java-api-library) | [Documentation](https://docs.adyen.com/development-resources/libraries?tab=java_2)). ## One-click setup with GitHub Codespaces You can run these examples in a pre-configured, cloud-based development environment using GitHub Codespaces. For setup instructions, see the [GitHub Codespaces Instructions](codespaces-instructions.md). Get started by navigating to one of the supported demos below. | Demos | Description | Details | |------------------------------------------------------------------------:|:-----------------------------------------------------------------------------------------|:-----------------------------------------------| | [`Checkout Example`](checkout-example) | E-commerce checkout flow with different payment methods. | [See below](#checkout-example) | | [`Advanced Checkout Example`](checkout-example-advanced) | E-commerce checkout flow with different payment methods, using the 3 steps flow. | [See below](#advanced-checkout-example) | | [`Authorisation Adjustment Example`](authorisation-adjustment-example) | Pre-authorise a payment, adjust the authorised amount, capture or reverse the payment. | [See below](#authorisation-adjustment-example) | | [`In-person Payments Example`](in-person-payments-example) | In-person payments using a POS terminal and the terminal-api/sync endpoint. | [See below](#in-person-payments-example) | | [`Gift Card Example`](giftcard-example) | Gift Cards checkout flow using partial orders. | [See below](#gift-card-example) | | [`Pay By Link Example`](paybylink-example) | Create payment links in seconds. | [See below](#paybylink-example) | | [`Subscription Example`](subscription-example) | Subscription flow using Adyen tokenization. | [See below](#subscription-example) | | [`Giving Example`](giving-example) | Donation flow using Adyen Giving. | [See below](#giving-example) | ## [Checkout Example](checkout-example) [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new/adyen-examples/adyen-java-spring-online-payments?ref=main&dev_container_path=.devcontainer%2Fcheckout-example%2Fdevcontainer.json) The [checkout example](checkout-example) repository includes examples of PCI-compliant UI integrations for online payments with Adyen. Within this demo app, you'll find a simplified version of an e-commerce website, complete with commented code to highlight key features and concepts of Adyen's API. Check out the underlying code to see how you can integrate Adyen to give your shoppers the option to pay with their preferred payment methods, all in a seamless checkout experience. ![Card Checkout Demo](checkout-example/src/main/resources/static/images/cardcheckout.gif) ## [Advanced Checkout Example](checkout-example-advanced) [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new/adyen-examples/adyen-java-spring-online-payments?ref=main&dev_container_path=.devcontainer%2Fcheckout-example-advanced%2Fdevcontainer.json) The [advanced checkout example](checkout-example-advanced) performs the same functionality as the [checkout example](checkout-example) but using the 3 stages of the Checkout API (Initiate, Submit, and Details) instead of the single `/sessions` endpoint. See the [advanced integration flow](https://docs.adyen.com/online-payments/web-drop-in/additional-use-cases?tab=sessions_flow_advanced_flow_1) for more information. ![Card Checkout Demo](checkout-example/src/main/resources/static/images/cardcheckout.gif) ## [Authorisation Adjustment Example](authorisation-adjustment-example) [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new/adyen-examples/adyen-java-spring-online-payments?ref=main&dev_container_path=.devcontainer%2Fauthorisation-adjustment-example%2Fdevcontainer.json) The [`authorisation adjustment example`](authorisation-adjustment-example) repository includes adjust authorisation example for the following three use cases after a pre-authorised payment: incremental, decremental adjustments. Within this demo app, you'll find a simplified version of a hotel booking, where the shopper perform a booking and administrators can **[1] adjust** (increase/decrease) the payment amount, **[2] extend** the authorisation expiry date, **[3] capture** the final amount and/or **[4] reverse** (cancel or refund) an authorised payment ![Authorisation Adjustment Card Demo](authorisation-adjustment-example/src/main/resources/static/images/cardauthorisationadjustment.gif) ## [In-person Payments Example](in-person-payments-example) [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new/adyen-examples/adyen-java-spring-online-payments?ref=main&dev_container_path=.devcontainer%2Fin-person-payments-example%2Fdevcontainer.json) The [in-person payments example](in-person-payments-example) features an in-person payment [cloud terminal API](https://docs.adyen.com/point-of-sale/design-your-integration/choose-your-architecture/cloud/) integration. Within this demo app, you can make in-person payments using a terminal, initiate reversals (refunds) and check transaction statuses. ![Card In-person Payments Demo](in-person-payments-example/src/main/resources/static/images/cardinpersonpayments.gif) ## [Gift Card Example](giftcard-example) [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new/adyen-examples/adyen-java-spring-online-payments?ref=main&dev_container_path=.devcontainer%2Fgiftcard-example%2Fdevcontainer.json) The [gift card example](giftcard-example) repository includes a gift card flow during checkout. Within this demo app, you'll find a simplified version of an e-commerce website. The shopper can choose to use gift cards to complete their purchase or use their preferred payment method to pay the remaining amount. ![Gift Card Demo](giftcard-example/src/main/resources/static/images/cardgiftcard.gif) ## [PayByLink Example](paybylink-example) [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new/adyen-examples/adyen-java-spring-online-payments?ref=main&dev_container_path=.devcontainer%2Fpaybylink-example%2Fdevcontainer.json) The [paybylink example](paybylink-example) repository includes a simple example interface to manage pay by links payment. Within this demo app, you can create payment links, and see their status updated in real-time. If you want to know more about Pay by link, check out our related [blog post](https://www.adyen.com/blog/pay-by-link-for-developers) or the [documentation](https://docs.adyen.com/checkout/pay-by-link). ![Pay By Link Demo](paybylink-example/src/main/resources/images/paybylink.gif) ## [Subscription Example](subscription-example) [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new/adyen-examples/adyen-java-spring-online-payments?ref=main&dev_container_path=.devcontainer%2Fsubscription-example%2Fdevcontainer.json) The [subscription example](subscription-example) repository includes a tokenization example for subscriptions. Within this demo app, you'll find a simplified version of a website that offers a music subscription service. The shopper can purchase a subscription and administrators can manage the saved (tokenized) payment methods on a separate admin panel. The panel allows admins to make payments on behalf of the shopper using this token. ![Subscription Demo](subscription-example/src/main/resources/static/images/cardsubscription.gif) ## [Giving Example](giving-example) [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new/adyen-examples/adyen-java-spring-online-payments?ref=main&dev_container_path=.devcontainer%2Fgiving-example%2Fdevcontainer.json) The [giving example](giving-example) repository includes a sample designed to demonstrate the Adyen Giving donations workflow. First make a test payment using one of our test card numbers, so you can see the donation screen appear. ![Giving Demo](giving-example/src/main/resources/static/images/donations.gif) ## Contributing We commit all our new features directly into our GitHub repository. Feel free to request or suggest new features or code changes yourself as well! Find out more in our [contributing](https://github.com/adyen-examples/.github/blob/main/CONTRIBUTING.md) guidelines. ## License MIT license. For more information, see the **LICENSE** file.

Web Development Payment & Checkout
71 Github Stars
adyen-angular-online-payments
Open Source

adyen-angular-online-payments

# Adyen [online payment](https://docs.adyen.com/online-payments) integration demos [![Angular Build](https://github.com/adyen-examples/adyen-angular-online-payments/actions/workflows/build.yml/badge.svg)](https://github.com/adyen-examples/adyen-angular-online-payments/actions/workflows/build.yml) [![E2E (Playwright)](https://github.com/adyen-examples/adyen-angular-online-payments/actions/workflows/e2e.yml/badge.svg)](https://github.com/adyen-examples/adyen-angular-online-payments/actions/workflows/e2e.yml) ## Details This repository showcases a PCI-compliant integration of the [Sessions Flow](https://docs.adyen.com/online-payments/build-your-integration/additional-use-cases/), the default integration that we recommend for merchants. Explore this simplified e-commerce demo to discover the code, libraries and configuration you need to enable various payment options in your checkout experience. ![Card checkout demo](checkout/src/assets/images/cardcheckout.gif) The demo leverages Adyen's API Library for Node.js ([GitHub](https://github.com/Adyen/adyen-node-api-library) | [Docs](https://docs.adyen.com/development-resources/libraries#javascript)). ## Requirements Node.js 20.0+ Angular 18+ ## Run with GitHub Codespaces This repository is configured to work with GitHub Codespaces. Click the badge below to launch a Codespace with all dependencies pre-installed. [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new/adyen-examples/adyen-anqular-online-payments?ref=main&devcontainer_path=.devcontainer%2Fdevcontainer.json) For detailed setup instructions, see the [GitHub Codespaces Instructions](https://github.com/adyen-examples/.github/blob/main/pages/codespaces-instructions.md). ## Installation 1. Clone this repo: ``` git clone https://github.com/adyen-examples/adyen-angular-online-payments.git ``` 2. Navigate to `checkout` and install dependencies: ``` npm install ``` 3. Navigate to `node-api` and install dependencies: ``` npm install ``` ## Usage 1. Create a `.env` file with all required configuration - [API key](https://docs.adyen.com/user-management/how-to-get-the-api-key) (required) - [Client Key](https://docs.adyen.com/user-management/client-side-authentication) (required) - [Merchant Account](https://docs.adyen.com/account/account-structure) (required) - [HMAC Key](https://docs.adyen.com/development-resources/webhooks/verify-hmac-signatures) (optional, recommended) Remember to include `http://localhost:8080` in the list of Allowed Origins ``` ADYEN_API_KEY="your_adyen_api_key_here" ADYEN_MERCHANT_ACCOUNT="your_adyen_merchant_account_here" ADYEN_CLIENT_KEY="your_adyen_client_key_here" ADYEN_HMAC_KEY="your_adyen_hmac_key_here" ``` 2. Start the Express server: ``` $ cd node-api $ npm start ``` 3. Serve the Angular application: ``` $ cd checkout $ ng serve --proxy-config proxy.conf.json ``` 5. Visit [http://localhost:8080/](http://localhost:8080/) to select an integration type. To try out integrations with test card numbers and payment method details, see [Test card numbers](https://docs.adyen.com/development-resources/test-cards/test-card-numbers). # Webhooks Webhooks deliver asynchronous notifications about the payment status and other events that are important to receive and process. You can find more information about webhooks in [this blog post](https://www.adyen.com/knowledge-hub/consuming-webhooks). ### Webhook setup In the Customer Area under the `Developers → Webhooks` section, [create](https://docs.adyen.com/development-resources/webhooks/#set-up-webhooks-in-your-customer-area) a new `Standard webhook`. A good practice is to set up basic authentication, copy the generated HMAC Key and set it as an environment variable. The application will use this to verify the [HMAC signatures](https://docs.adyen.com/development-resources/webhooks/verify-hmac-signatures/). Make sure the webhook is **enabled**, so it can receive notifications. ### Expose an endpoint This demo provides a simple webhook implementation exposed at `/api/webhooks/notifications` that shows you how to receive, validate and consume the webhook payload. ### Test your webhook The following webhooks `events` should be enabled: * **AUTHORISATION** To make sure that the Adyen platform can reach your application, we have written a [Webhooks Testing Guide](https://github.com/adyen-examples/.github/blob/main/pages/webhooks-testing.md) that explores several options on how you can easily achieve this (e.g. running on localhost or cloud).

Payment & Checkout
13 Github Stars
adyen-kotlin-spring-online-payments
Open Source

adyen-kotlin-spring-online-payments

# Adyen [online payment](https://docs.adyen.com/checkout) integration demos [![Kotlin Build](https://github.com/adyen-examples/adyen-kotlin-spring-online-payments/actions/workflows/build.yml/badge.svg)](https://github.com/adyen-examples/adyen-kotlin-spring-online-payments/actions/workflows/build.yml) [![E2E (Playwright)](https://github.com/adyen-examples/adyen-kotlin-spring-online-payments/actions/workflows/e2e.yml/badge.svg)](https://github.com/adyen-examples/adyen-kotlin-spring-online-payments/actions/workflows/e2e.yml) ## Details This repository includes examples of PCI-compliant UI integrations for online payments with Adyen. Within this demo app, you'll find a simplified version of an e-commerce website, complete with commented code to highlight key features and concepts of Adyen's API. Check out the underlying code to see how you can integrate Adyen to give your shoppers the option to pay with their preferred payment methods, all in a seamless checkout experience. ![Card checkout demo](src/main/resources/static/images/cardcheckout.gif) ## Supported Integrations **Kotlin + Spring Boot + Thymeleaf** demos of the following client-side integrations are currently available in this repository: - [Drop-in](https://docs.adyen.com/checkout/drop-in-web) - [Component](https://docs.adyen.com/checkout/components-web) - ACH - Alipay - Card (3DS2) - Dotpay - giropay - iDEAL - Klarna (Pay now, Pay later, Slice it) - SOFORT The Demo leverages Adyen's API Library for Java ([GitHub](https://github.com/Adyen/adyen-java-api-library) | [Docs](https://docs.adyen.com/development-resources/libraries#java)). ## Requirements - Java 17 - Kotlin 1.3 - Network access to maven central This repository is configured to work with [GitHub Codespaces](https://github.com/features/codespaces). Each example can be opened in its own Codespace with all dependencies pre-installed. For detailed setup instructions, see the [GitHub Codespaces Instructions](https://github.com/adyen-examples/.github/blob/main/pages/codespaces-instructions.md). ### Prerequisites Before running any example, you'll need to set up the following environment variables in your Codespace: - `ADYEN_API_KEY` - [Your Adyen API key](https://docs.adyen.com/user-management/how-to-get-the-api-key) - `ADYEN_CLIENT_KEY` - [Your Adyen client key ](https://docs.adyen.com/user-management/client-side-authentication) - `ADYEN_MERCHANT_ACCOUNT` - [Your Adyen merchant account](https://docs.adyen.com/account/account-structure) - `ADYEN_HMAC_KEY` - [Your Adyen HMAC key for webhook validation](https://docs.adyen.com/development-resources/webhooks/verify-hmac-signatures) (optional) ### Setting Environment Variables 1. Go to [Codespaces settings](https://github.com/settings/codespaces) 2. Under Secrets, Click on "New secret" 4. Add the required environment variables and repo access 5. Restart your Codespace Alternatively, you can set them in the terminal after starting Codespaces: ```bash export ADYEN_API_KEY="your_adyen_api_key" export ADYEN_CLIENT_KEY="your_adyen_client_key" export ADYEN_MERCHANT_ACCOUNT="your_adyen_merchant_account" ``` [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new/adyen-examples/adyen-kotlin-online-payments?ref=main&devcontainer_path=.devcontainer%2Fdevcontainer.json) For detailed setup instructions, see the [GitHub Codespaces Instructions](https://github.com/adyen-examples/.github/blob/main/pages/codespaces-instructions.md). ## Installation 1. Clone this repo: ``` git clone https://github.com/adyen-examples/adyen-kotlin-spring-online-payments.git ``` ## Usage 1. Set environment variables for your [API key](https://docs.adyen.com/user-management/how-to-get-the-api-key), [Client Key](https://docs.adyen.com/user-management/client-side-authentication) - Remember to add `http://localhost:8080` as an origin for client key, and merchant account name: ```shell export ADYEN_API_KEY=yourAdyenApiKey export ADYEN_MERCHANT_ACCOUNT=yourAdyenMerchantAccount export ADYEN_CLIENT_KEY=yourAdyenClientKey export ADYEN_HMAC_KEY=yourHmacKey ``` On Windows CMD you can use below commands instead ```shell set ADYEN_API_KEY=yourAdyenApiKey set ADYEN_MERCHANT_ACCOUNT=yourAdyenMerchantAccount set ADYEN_CLIENT_KEY=yourAdyenClientKey set ADYEN_HMAC_KEY=yourHmacKey ``` 2. Start the server: ``` ./gradlew bootRun ``` 3. Visit [http://localhost:8080/](http://localhost:8080/) to select an integration type. To try out integrations with test card numbers and payment method details, see [Test card numbers](https://docs.adyen.com/development-resources/test-cards/test-card-numbers). ## Testing webhooks Webhooks deliver asynchronous notifications and it is important to test them during the setup of your integration. You can find more information about webhooks in [this detailed blog post](https://www.adyen.com/blog/Integrating-webhooks-notifications-with-Adyen-Checkout). This sample application provides a simple webhook integration exposed at `/api/webhooks/notifications`. For it to work, you need to: 1. Provide a way for the Adyen platform to reach your running application 2. Add a Standard webhook in your Customer Area ### Making your server reachable Your endpoint that will consume the incoming webhook must be publicly accessible. There are typically 3 options: * deploy on your own cloud provider * deploy on Gitpod * expose your localhost with tunneling software (i.e. ngrok) #### Option 1: cloud deployment If you deploy on your cloud provider (or your own public server) the webhook URL will be the URL of the server ``` https://{cloud-provider}/api/webhooks/notifications ``` #### Option 2: Gitpod If you use Gitpod the webhook URL will be the host assigned by Gitpod ``` https://myorg-myrepo-y8ad7pso0w5.ws-eu75.gitpod.io/api/webhooks/notifications ``` **Note:** when starting a new Gitpod workspace the host changes, make sure to **update the Webhook URL** in the Customer Area #### Option 3: localhost via tunneling software If you use a tunneling service like [ngrok](ngrok) the webhook URL will be the generated URL (ie `https://c991-80-113-16-28.ngrok.io`) ```bash $ ngrok http 8080 Session Status online Account ############ Version ######### Region United States (us) Forwarding http://c991-80-113-16-28.ngrok.io -> http://localhost:8080 Forwarding https://c991-80-113-16-28.ngrok.io -> http://localhost:8080 ``` **Note:** when restarting ngrok a new URL is generated, make sure to **update the Webhook URL** in the Customer Area ### Set up a webhook * In the Customer Area go to Developers -> Webhooks and create a new 'Standard notification' webhook. * Enter the URL of your application/endpoint (see options [above](#making-your-server-reachable)) * Define username and password for Basic Authentication * Generate the HMAC Key * Optionally, in Additional Settings, add the data you want to receive. A good example is 'Payment Account Reference'. * Make sure the webhook is **Enabled** (therefore it can receive the notifications) That's it! Every time you perform a new payment, your application will receive a notification from the Adyen platform. ### Making your server reachable Your application runs on the cloud: this is normally enough (your server accepts incoming requests) Your application runs on your local machine: you need to use a service like [ngrok](https://ngrok.com/) to "tunnel" the webhook notifications. Once you have set up ngrok, make sure to add the provided ngrok URL to the list of **Allowed Origins** in the “API Credentials" of your Customer Area. ### Setting up a webhook * In the “Developers" -> “Webhooks" section create a new ‘Standard notification' webhook. * In “Additional Settings” section configure (if necessary) the additional data you want to receive (i.e. 'Payment Account Reference’). That's it! Every time you perform a payment method, your server will receive a notification from Adyen's server. You can find more information in the [Webhooks documentation](https://docs.adyen.com/development-resources/webhooks) and in [this blog post](https://www.adyen.com/blog/Integrating-webhooks-notifications-with-Adyen-Checkout). ## Contributing We commit all our new features directly into our GitHub repository. Feel free to request or suggest new features or code changes yourself as well! Find out more in our [Contributing](https://github.com/adyen-examples/.github/blob/main/CONTRIBUTING.md) guidelines. ## License MIT license. For more information, see the **LICENSE** file in the root directory.

Payment & Checkout
11 Github Stars