From 9f4605f237c455c5c6394d5a53e6cd5886773719 Mon Sep 17 00:00:00 2001 From: Beppe Catanese Date: Thu, 12 Sep 2024 17:12:41 +0200 Subject: [PATCH] Add missing countryCode --- .../src/main/java/com/adyen/checkout/api/CheckoutResource.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/checkout-example-advanced/src/main/java/com/adyen/checkout/api/CheckoutResource.java b/checkout-example-advanced/src/main/java/com/adyen/checkout/api/CheckoutResource.java index 43e2615..8c75ebc 100644 --- a/checkout-example-advanced/src/main/java/com/adyen/checkout/api/CheckoutResource.java +++ b/checkout-example-advanced/src/main/java/com/adyen/checkout/api/CheckoutResource.java @@ -84,7 +84,8 @@ public ResponseEntity payments(@RequestHeader String host, @Req paymentRequest.setReturnUrl(request.getScheme() + "://" + host + "/api/handleShopperRedirect?orderRef=" + orderRef); paymentRequest.setAmount(amount); - // set lineItems required for some payment methods (ie Klarna) + // set countryCode and lineItems required for some payment methods (ie Klarna) + paymentRequest.setCountryCode("NL"); paymentRequest.setLineItems(Arrays.asList( new LineItem().quantity(1L).amountIncludingTax(5000L).description("Sunglasses"), new LineItem().quantity(1L).amountIncludingTax(5000L).description("Headphones"))