Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/authorisation adjustment example #193

Merged
merged 15 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,9 @@ updates:
interval: "daily"
- package-ecosystem: "gradle"
directory: "/in-person-payments-example"
schedule:
interval: "daily"
- package-ecosystem: "gradle"
directory: "/authorisation-adjustment-example"
schedule:
interval: "daily"
18 changes: 18 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ jobs:
run: chmod +x paybylink-example/gradlew
- name: Build with Gradle
run: cd paybylink-example; ./gradlew build

build-giving:
runs-on: ubuntu-latest
strategy:
Expand All @@ -125,3 +126,20 @@ jobs:
- name: Build with Gradle
run: cd giving-example; ./gradlew build

build-authorisation-adjustment:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ '17' ]
name: Java ${{ matrix.Java }} sample
steps:
- uses: actions/checkout@v3
- name: Setup java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
- name: Grant execute permission for gradlew
run: chmod +x authorisation-adjustment-example/gradlew
- name: Build with Gradle
run: cd authorisation-adjustment-example; ./gradlew build
23 changes: 23 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,26 @@ jobs:
run: docker run --rm --name adyen-testing-suite -e PLAYWRIGHT_FOLDERNAME=giving -e ADYEN_HMAC_KEY=${{ secrets.ADYEN_HMAC_KEY }} --network host ghcr.io/adyen-examples/adyen-testing-suite:main


authorisation-adjustment:

runs-on: ubuntu-latest
steps:
- name: Authorisation Adjustment project
uses: actions/checkout@v3
- name: Setup java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- name: Grant execute permission for gradlew
run: chmod +x authorisation-adjustment-example/gradlew
- name: Build authorisation-adjustment-example with Gradle
run: cd authorisation-adjustment-example; ./gradlew build
- name: Build authorisation-adjustment-example image
run: docker build -t authorisation-adjustment-example:latest authorisation-adjustment-example
- name: Start authorisation-adjustment container
run: docker run --rm -d --name authorisation-adjustment-example -p 8080:8080 -e ADYEN_API_KEY="${{ secrets.ADYEN_API_KEY }}" -e ADYEN_MERCHANT_ACCOUNT=${{ secrets.ADYEN_MERCHANT_ACCOUNT }} -e ADYEN_CLIENT_KEY=${{ secrets.ADYEN_CLIENT_KEY }} -e ADYEN_HMAC_KEY=${{ secrets.ADYEN_HMAC_KEY }} authorisation-adjustment-example:latest
- name: Run testing suite
run: docker run --rm --name adyen-testing-suite -e PLAYWRIGHT_FOLDERNAME=authorisation-adjustment -e ADYEN_HMAC_KEY=${{ secrets.ADYEN_HMAC_KEY }} --network host ghcr.io/adyen-examples/adyen-testing-suite:main


4 changes: 4 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ tasks:
echo "Build paybylink-example application"
cd paybylink-example && ./gradlew bootJar
;;
"authorisation-adjustment-example")
echo "Build authorisation-adjustment-example application"
cd authorisation-adjustment-example && ./gradlew bootJar
;;
*)
echo "Build default checkout-example application instead because '$path' is not defined ..."
cd checkout-example && ./gradlew bootJar
Expand Down
29 changes: 20 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ The demos below leverages Adyen's API Library for Java using Spring ([GitHub](ht

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) |
| [`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) |
| 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)
Expand All @@ -41,6 +42,16 @@ See the [advanced integration flow](https://docs.adyen.com/online-payments/web-d

![Card Checkout Demo](checkout-example/src/main/resources/static/images/cardcheckout.gif)

## [Authorisation Adjustment Example](authorisation-adjustment-example)
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/adyen-examples/adyen-java-spring-online-payments/tree/main/authorisation-adjustment-example)

[First time with Gitpod?](https://github.com/adyen-examples/.github/blob/main/pages/gitpod-get-started.md)

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 Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/adyen-examples/adyen-dotnet-online-payments/tree/main/in-person-payments-example)

Expand Down
3 changes: 3 additions & 0 deletions authorisation-adjustment-example/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM amazoncorretto:17-alpine-jdk
COPY build/libs/adyen-java-spring-online-payments-authorisation-adjustment-0.0.1-SNAPSHOT.jar adyen-java-spring-online-payments-authorisation-adjustment-0.0.1-SNAPSHOT.jar
ENTRYPOINT ["java","-jar","/adyen-java-spring-online-payments-authorisation-adjustment-0.0.1-SNAPSHOT.jar"]
Loading