From 2f0946814d5aad0beaedf39fa0fca8223e079956 Mon Sep 17 00:00:00 2001 From: kpieloch <113994423+kpieloch@users.noreply.github.com> Date: Mon, 4 Nov 2024 06:45:07 +0100 Subject: [PATCH 1/2] AD-336: Google Express Payments, fix for java-lib update --- .../expresscheckout/GooglePayExpressCheckoutController.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/adyenocc/src/com/adyen/commerce/controllers/expresscheckout/GooglePayExpressCheckoutController.java b/adyenocc/src/com/adyen/commerce/controllers/expresscheckout/GooglePayExpressCheckoutController.java index 8704ec5a..a52f55cc 100644 --- a/adyenocc/src/com/adyen/commerce/controllers/expresscheckout/GooglePayExpressCheckoutController.java +++ b/adyenocc/src/com/adyen/commerce/controllers/expresscheckout/GooglePayExpressCheckoutController.java @@ -6,6 +6,7 @@ import com.adyen.commerce.resolver.PaymentRedirectReturnUrlResolver; import com.adyen.commerce.response.OCCPlaceOrderResponse; import com.adyen.model.checkout.CheckoutPaymentMethod; +import com.adyen.model.checkout.GooglePayDetails; import com.adyen.model.checkout.PaymentRequest; import com.adyen.v6.constants.Adyenv6coreConstants; import com.adyen.v6.facades.AdyenExpressCheckoutFacade; @@ -52,6 +53,7 @@ public class GooglePayExpressCheckoutController extends ExpressCheckoutControlle @ApiBaseSiteIdUserIdAndCartIdParam public ResponseEntity googlePayCartExpressCheckout(final HttpServletRequest request, @RequestBody GooglePayExpressPDPRequest googlePayExpressPDPRequest) throws Exception { PaymentRequest paymentRequest = new PaymentRequest(); + googlePayExpressPDPRequest.getGooglePayDetails().setType(GooglePayDetails.TypeEnum.GOOGLEPAY); paymentRequest.setPaymentMethod(new CheckoutPaymentMethod(googlePayExpressPDPRequest.getGooglePayDetails())); OCCPlaceOrderResponse placeOrderResponse = handlePayment(request, paymentRequest, Adyenv6coreConstants.PAYMENT_METHOD_GOOGLE_PAY, googlePayExpressPDPRequest.getAddressData(), googlePayExpressPDPRequest.getProductCode(), true); @@ -66,6 +68,7 @@ public ResponseEntity googlePayCartExpressCheckout(final HttpServletRequ @ApiBaseSiteIdUserIdAndCartIdParam public ResponseEntity googlePayCartExpressCheckout(final HttpServletRequest request, @RequestBody GooglePayExpressCartRequest googlePayExpressCartRequest) throws Exception { PaymentRequest paymentRequest = new PaymentRequest(); + googlePayExpressCartRequest.getGooglePayDetails().setType(GooglePayDetails.TypeEnum.GOOGLEPAY); paymentRequest.setPaymentMethod(new CheckoutPaymentMethod(googlePayExpressCartRequest.getGooglePayDetails())); OCCPlaceOrderResponse placeOrderResponse = handlePayment(request, paymentRequest, Adyenv6coreConstants.PAYMENT_METHOD_GOOGLE_PAY, googlePayExpressCartRequest.getAddressData(), null, false); From 47a4d0718013cf383f721f56336dbb58dc9a545b Mon Sep 17 00:00:00 2001 From: kpieloch <113994423+kpieloch@users.noreply.github.com> Date: Tue, 5 Nov 2024 10:00:08 +0100 Subject: [PATCH 2/2] AD-336: Google Express Payments, fix for java-lib update --- .../GooglePayExpressCheckoutController.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/adyenocc/src/com/adyen/commerce/controllers/expresscheckout/GooglePayExpressCheckoutController.java b/adyenocc/src/com/adyen/commerce/controllers/expresscheckout/GooglePayExpressCheckoutController.java index a52f55cc..ac6cd436 100644 --- a/adyenocc/src/com/adyen/commerce/controllers/expresscheckout/GooglePayExpressCheckoutController.java +++ b/adyenocc/src/com/adyen/commerce/controllers/expresscheckout/GooglePayExpressCheckoutController.java @@ -3,6 +3,7 @@ import com.adyen.commerce.constants.AdyenoccConstants; import com.adyen.commerce.request.GooglePayExpressCartRequest; import com.adyen.commerce.request.GooglePayExpressPDPRequest; +import com.adyen.commerce.request.PlaceOrderRequest; import com.adyen.commerce.resolver.PaymentRedirectReturnUrlResolver; import com.adyen.commerce.response.OCCPlaceOrderResponse; import com.adyen.model.checkout.CheckoutPaymentMethod; @@ -51,7 +52,9 @@ public class GooglePayExpressCheckoutController extends ExpressCheckoutControlle @Operation(operationId = "placeOrderGooglePayExpressPDP", summary = "Handle googlePayExpress place order request", description = "Places order based on request data") @ApiBaseSiteIdUserIdAndCartIdParam - public ResponseEntity googlePayCartExpressCheckout(final HttpServletRequest request, @RequestBody GooglePayExpressPDPRequest googlePayExpressPDPRequest) throws Exception { + public ResponseEntity googlePayCartExpressCheckoutPDP(final HttpServletRequest request, @RequestBody String googlePayExpressPDPRequestString) throws Exception { + GooglePayExpressPDPRequest googlePayExpressPDPRequest = objectMapper.readValue(googlePayExpressPDPRequestString, GooglePayExpressPDPRequest.class); + PaymentRequest paymentRequest = new PaymentRequest(); googlePayExpressPDPRequest.getGooglePayDetails().setType(GooglePayDetails.TypeEnum.GOOGLEPAY); paymentRequest.setPaymentMethod(new CheckoutPaymentMethod(googlePayExpressPDPRequest.getGooglePayDetails())); @@ -66,7 +69,8 @@ public ResponseEntity googlePayCartExpressCheckout(final HttpServletRequ @Operation(operationId = "placeOrderGooglePayExpressCart", summary = "Handle googlePayExpress place order request", description = "Places order based on request data") @ApiBaseSiteIdUserIdAndCartIdParam - public ResponseEntity googlePayCartExpressCheckout(final HttpServletRequest request, @RequestBody GooglePayExpressCartRequest googlePayExpressCartRequest) throws Exception { + public ResponseEntity googlePayCartExpressCheckoutCart(final HttpServletRequest request, @RequestBody String googlePayExpressCartRequestString) throws Exception { + GooglePayExpressCartRequest googlePayExpressCartRequest = objectMapper.readValue(googlePayExpressCartRequestString, GooglePayExpressCartRequest.class); PaymentRequest paymentRequest = new PaymentRequest(); googlePayExpressCartRequest.getGooglePayDetails().setType(GooglePayDetails.TypeEnum.GOOGLEPAY); paymentRequest.setPaymentMethod(new CheckoutPaymentMethod(googlePayExpressCartRequest.getGooglePayDetails()));