Skip to content

Instantly share code, notes, and snippets.

@deepu105
Created June 24, 2020 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deepu105/931e4ad64ea92e6bf049d303005585f5 to your computer and use it in GitHub Desktop.
Save deepu105/931e4ad64ea92e6bf049d303005585f5 to your computer and use it in GitHub Desktop.
@PostMapping("/checkout/payment-methods")
public ResponseEntity<PaymentMethodsResponse> paymentMethods() throws EntityNotFoundException, IOException, ApiException {
PaymentMethodsRequest paymentMethodsRequest = new PaymentMethodsRequest();
paymentMethodsRequest.setMerchantAccount(merchantAccount);
paymentMethodsRequest.setCountryCode("NL");
paymentMethodsRequest.setShopperLocale("nl-NL");
paymentMethodsRequest.setChannel(PaymentMethodsRequest.ChannelEnum.WEB);
Amount amount = getAmountFromCart();
paymentMethodsRequest.setAmount(amount);
log.debug("REST request to get Adyen payment methods {}", paymentMethodsRequest);
PaymentMethodsResponse response = checkout.paymentMethods(paymentMethodsRequest);
return ResponseEntity.ok()
.body(response);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment