From d1fee76f66533b16a3e36aeb6986a0f7bd917717 Mon Sep 17 00:00:00 2001 From: Beppe Catanese <1771700+gcatanese@users.noreply.github.com> Date: Fri, 13 Sep 2024 11:08:23 +0200 Subject: [PATCH] Upgrade to Adyen Java library v25.1.0 (#231) * Upgrade to Adyen Java library v25.1.0 * Log exception stack * set payment method for donation --- authorisation-adjustment-example/build.gradle | 2 +- checkout-example-advanced/build.gradle | 2 +- checkout-example/build.gradle | 2 +- giftcard-example/build.gradle | 2 +- giving-example/build.gradle | 2 +- .../main/java/com/adyen/giving/api/CheckoutResource.java | 7 +++++-- in-person-payments-example/build.gradle | 2 +- paybylink-example/build.gradle | 2 +- subscription-example/build.gradle | 2 +- 9 files changed, 13 insertions(+), 10 deletions(-) diff --git a/authorisation-adjustment-example/build.gradle b/authorisation-adjustment-example/build.gradle index 202dbce..563ab2a 100644 --- a/authorisation-adjustment-example/build.gradle +++ b/authorisation-adjustment-example/build.gradle @@ -19,7 +19,7 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect' - implementation 'com.adyen:adyen-java-api-library:24.0.0' + implementation 'com.adyen:adyen-java-api-library:25.1.0' developmentOnly 'org.springframework.boot:spring-boot-devtools' diff --git a/checkout-example-advanced/build.gradle b/checkout-example-advanced/build.gradle index 202dbce..563ab2a 100644 --- a/checkout-example-advanced/build.gradle +++ b/checkout-example-advanced/build.gradle @@ -19,7 +19,7 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect' - implementation 'com.adyen:adyen-java-api-library:24.0.0' + implementation 'com.adyen:adyen-java-api-library:25.1.0' developmentOnly 'org.springframework.boot:spring-boot-devtools' diff --git a/checkout-example/build.gradle b/checkout-example/build.gradle index 645623e..84d780f 100644 --- a/checkout-example/build.gradle +++ b/checkout-example/build.gradle @@ -19,7 +19,7 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect' - implementation 'com.adyen:adyen-java-api-library:24.0.0' + implementation 'com.adyen:adyen-java-api-library:25.1.0' developmentOnly 'org.springframework.boot:spring-boot-devtools' diff --git a/giftcard-example/build.gradle b/giftcard-example/build.gradle index 202dbce..563ab2a 100644 --- a/giftcard-example/build.gradle +++ b/giftcard-example/build.gradle @@ -19,7 +19,7 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect' - implementation 'com.adyen:adyen-java-api-library:24.0.0' + implementation 'com.adyen:adyen-java-api-library:25.1.0' developmentOnly 'org.springframework.boot:spring-boot-devtools' diff --git a/giving-example/build.gradle b/giving-example/build.gradle index 202dbce..563ab2a 100644 --- a/giving-example/build.gradle +++ b/giving-example/build.gradle @@ -19,7 +19,7 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect' - implementation 'com.adyen:adyen-java-api-library:24.0.0' + implementation 'com.adyen:adyen-java-api-library:25.1.0' developmentOnly 'org.springframework.boot:spring-boot-devtools' diff --git a/giving-example/src/main/java/com/adyen/giving/api/CheckoutResource.java b/giving-example/src/main/java/com/adyen/giving/api/CheckoutResource.java index 6e433d0..e9c1c96 100644 --- a/giving-example/src/main/java/com/adyen/giving/api/CheckoutResource.java +++ b/giving-example/src/main/java/com/adyen/giving/api/CheckoutResource.java @@ -66,7 +66,10 @@ public ResponseEntity donations(@RequestBody Amount bod donationRequest.amount(body); donationRequest.reference(UUID.randomUUID().toString()); - donationRequest.setPaymentMethod(new DonationPaymentMethod(new CardDonations())); + // set payment method for donation + CardDonations cardDetails = new CardDonations().type(CardDonations.TypeEnum.SCHEME); + donationRequest.paymentMethod(new DonationPaymentMethod(cardDetails)); + // set donaton token donationRequest.setDonationToken(donationToken); donationRequest.donationOriginalPspReference(pspReference); donationRequest.setDonationAccount(this.applicationProperty.getDonationMerchantAccount()); @@ -81,7 +84,7 @@ public ResponseEntity donations(@RequestBody Amount bod log.warn(e.getMessage()); return ResponseEntity.notFound().build(); } catch (Exception e) { - log.error(e.getMessage()); + log.error(e.getMessage(), e); return ResponseEntity.status(500).build(); } } diff --git a/in-person-payments-example/build.gradle b/in-person-payments-example/build.gradle index 202dbce..563ab2a 100644 --- a/in-person-payments-example/build.gradle +++ b/in-person-payments-example/build.gradle @@ -19,7 +19,7 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect' - implementation 'com.adyen:adyen-java-api-library:24.0.0' + implementation 'com.adyen:adyen-java-api-library:25.1.0' developmentOnly 'org.springframework.boot:spring-boot-devtools' diff --git a/paybylink-example/build.gradle b/paybylink-example/build.gradle index 202dbce..563ab2a 100644 --- a/paybylink-example/build.gradle +++ b/paybylink-example/build.gradle @@ -19,7 +19,7 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect' - implementation 'com.adyen:adyen-java-api-library:24.0.0' + implementation 'com.adyen:adyen-java-api-library:25.1.0' developmentOnly 'org.springframework.boot:spring-boot-devtools' diff --git a/subscription-example/build.gradle b/subscription-example/build.gradle index 202dbce..563ab2a 100644 --- a/subscription-example/build.gradle +++ b/subscription-example/build.gradle @@ -19,7 +19,7 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect' - implementation 'com.adyen:adyen-java-api-library:24.0.0' + implementation 'com.adyen:adyen-java-api-library:25.1.0' developmentOnly 'org.springframework.boot:spring-boot-devtools'