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

Upgrade to Adyen Java v23.0.1 #196

Merged
merged 3 commits into from
Feb 12, 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
14 changes: 7 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
strategy:
matrix:
java: [ '17' ]
name: Java ${{ matrix.Java }} sample
name: checkout-example build with Java ${{ matrix.Java }}
steps:
- uses: actions/checkout@v3
- name: Setup java
Expand All @@ -41,7 +41,7 @@ jobs:
strategy:
matrix:
java: [ '17' ]
name: Java ${{ matrix.Java }} sample
name: checkout-example-advanced build with Java ${{ matrix.Java }}
steps:
- uses: actions/checkout@v3
- name: Setup java
Expand All @@ -59,7 +59,7 @@ jobs:
strategy:
matrix:
java: [ '17' ]
name: Java ${{ matrix.Java }} sample
name: giftcard-example build with Java ${{ matrix.Java }}
steps:
- uses: actions/checkout@v3
- name: Setup java
Expand All @@ -77,7 +77,7 @@ jobs:
strategy:
matrix:
java: [ '17' ]
name: Java ${{ matrix.Java }} sample
name: subscription-example build with Java ${{ matrix.Java }}
steps:
- uses: actions/checkout@v3
- name: Setup java
Expand All @@ -95,7 +95,7 @@ jobs:
strategy:
matrix:
java: [ '17' ]
name: Java ${{ matrix.Java }} sample
name: paybylink-example build with Java ${{ matrix.Java }}
steps:
- uses: actions/checkout@v3
- name: Setup java
Expand All @@ -113,7 +113,7 @@ jobs:
strategy:
matrix:
java: [ '17' ]
name: Java ${{ matrix.Java }} sample
name: giving-example build with Java ${{ matrix.Java }}
steps:
- uses: actions/checkout@v3
- name: Setup java
Expand All @@ -131,7 +131,7 @@ jobs:
strategy:
matrix:
java: [ '17' ]
name: Java ${{ matrix.Java }} sample
name: authorisation-adjustment-example build with Java ${{ matrix.Java }}
steps:
- uses: actions/checkout@v3
- name: Setup java
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.adyen.enums.Environment;
import com.adyen.giving.util.DonationUtil;
import com.adyen.model.checkout.*;
import com.adyen.service.checkout.DonationsApi;
import com.adyen.service.checkout.PaymentsApi;
import com.adyen.service.exception.ApiException;
import jakarta.servlet.http.HttpServletRequest;
Expand All @@ -31,6 +32,7 @@ public class CheckoutResource {
private final ApplicationProperty applicationProperty;

private final PaymentsApi paymentsApi;
private final DonationsApi donationsApi;

public CheckoutResource(ApplicationProperty applicationProperty) {

Expand All @@ -43,6 +45,7 @@ public CheckoutResource(ApplicationProperty applicationProperty) {

var client = new Client(applicationProperty.getApiKey(), Environment.TEST);
this.paymentsApi = new PaymentsApi(client);
this.donationsApi = new DonationsApi(client);
}


Expand All @@ -63,15 +66,15 @@ public ResponseEntity<DonationPaymentResponse> donations(@RequestBody Amount bod

donationRequest.amount(body);
donationRequest.reference(UUID.randomUUID().toString());
donationRequest.setPaymentMethod(new DonationPaymentMethod(new CardDetails()));
donationRequest.setPaymentMethod(new DonationPaymentMethod(new CardDonations()));
donationRequest.setDonationToken(donationToken);
donationRequest.donationOriginalPspReference(pspReference);
donationRequest.setDonationAccount(this.applicationProperty.getDonationMerchantAccount());
donationRequest.returnUrl(request.getScheme() + "://" + host);
donationRequest.setMerchantAccount(this.applicationProperty.getMerchantAccount());
donationRequest.shopperInteraction(DonationPaymentRequest.ShopperInteractionEnum.CONTAUTH);

DonationPaymentResponse result = this.paymentsApi.donations(donationRequest);
DonationPaymentResponse result = this.donationsApi.donations(donationRequest);

return ResponseEntity.ok().body(result);
} catch (NotFoundException e) {
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[versions]
adyenVersion="22.1.0"
adyenVersion="23.0.1"
springVersion="3.1.4"
springDependendyManagementVersion="1.1.3"

Expand Down
Loading