@Test public void testAuthoriseOrder() throws WorldpayException, InvalidCartException { doNothing().when(worldpayApplePayPaymentCheckoutFacadeMock).saveBillingAddresses(billingContactMock); when(authorisationRequestMock.getBillingContact()).thenReturn(billingContactMock); when(authorisationRequestMock.getToken().getPaymentData()).thenReturn(paymentDataMock); testObj.authoriseOrder(authorisationRequestMock); verify(worldpayApplePayPaymentCheckoutFacadeMock).saveBillingAddresses(billingContactMock); verify(worldpayDirectOrderFacadeMock).authoriseApplePayDirect(paymentDataMock); }
@Secured( {"ROLE_CUSTOMERGROUP", "ROLE_GUEST", "ROLE_CUSTOMERMANAGERGROUP", "ROLE_TRUSTED_CLIENT"}) @PostMapping(value = "/authorise-order", consumes = {MediaType.APPLICATION_JSON_VALUE}) @ResponseBody public DirectResponseData authoriseOrder(@RequestBody final ApplePayAuthorisationRequest authorisationRequest) throws WorldpayException, InvalidCartException { worldpayApplePayPaymentCheckoutFacade.saveBillingAddresses(authorisationRequest.getBillingContact()); return worldpayDirectOrderFacade.authoriseApplePayDirect(authorisationRequest.getToken().getPaymentData()); }
ApplePayController extends AbstractWorldpayController { @Secured( {"ROLE_CUSTOMERGROUP", "ROLE_GUEST", "ROLE_CUSTOMERMANAGERGROUP", "ROLE_TRUSTED_CLIENT"}) @PostMapping(value = "/authorise-order", consumes = {MediaType.APPLICATION_JSON_VALUE}) @ResponseBody public DirectResponseData authoriseOrder(@RequestBody final ApplePayAuthorisationRequest authorisationRequest) throws WorldpayException, InvalidCartException { worldpayApplePayPaymentCheckoutFacade.saveBillingAddresses(authorisationRequest.getBillingContact()); return worldpayDirectOrderFacade.authoriseApplePayDirect(authorisationRequest.getToken().getPaymentData()); } }
ApplePayController extends AbstractWorldpayController { @Secured( {"ROLE_CUSTOMERGROUP", "ROLE_GUEST", "ROLE_CUSTOMERMANAGERGROUP", "ROLE_TRUSTED_CLIENT"}) @PostMapping(value = "/authorise-order", consumes = {MediaType.APPLICATION_JSON_VALUE}) @ResponseBody public DirectResponseData authoriseOrder(@RequestBody final ApplePayAuthorisationRequest authorisationRequest) throws WorldpayException, InvalidCartException { worldpayApplePayPaymentCheckoutFacade.saveBillingAddresses(authorisationRequest.getBillingContact()); return worldpayDirectOrderFacade.authoriseApplePayDirect(authorisationRequest.getToken().getPaymentData()); }  }
ApplePayController extends AbstractWorldpayController { @Secured( {"ROLE_CUSTOMERGROUP", "ROLE_GUEST", "ROLE_CUSTOMERMANAGERGROUP", "ROLE_TRUSTED_CLIENT"}) @PostMapping(value = "/authorise-order", consumes = {MediaType.APPLICATION_JSON_VALUE}) @ResponseBody public DirectResponseData authoriseOrder(@RequestBody final ApplePayAuthorisationRequest authorisationRequest) throws WorldpayException, InvalidCartException { worldpayApplePayPaymentCheckoutFacade.saveBillingAddresses(authorisationRequest.getBillingContact()); return worldpayDirectOrderFacade.authoriseApplePayDirect(authorisationRequest.getToken().getPaymentData()); }  @Secured({"ROLE_CUSTOMERGROUP", "ROLE_GUEST", "ROLE_CUSTOMERMANAGERGROUP", "ROLE_TRUSTED_CLIENT"}) @PostMapping(value = "/request-session", consumes = {MediaType.APPLICATION_JSON_VALUE}) @ResponseBody Object requestPaymentSession(@RequestBody final ValidateMerchantRequestWsDTO validateMerchantRequestWsDTO); @Secured( {"ROLE_CUSTOMERGROUP", "ROLE_GUEST", "ROLE_CUSTOMERMANAGERGROUP", "ROLE_TRUSTED_CLIENT"}) @PostMapping(value = "/authorise-order", consumes = {MediaType.APPLICATION_JSON_VALUE}) @ResponseBody DirectResponseData authoriseOrder(@RequestBody final ApplePayAuthorisationRequest authorisationRequest); @Secured( {"ROLE_CUSTOMERGROUP", "ROLE_GUEST", "ROLE_CUSTOMERMANAGERGROUP", "ROLE_TRUSTED_CLIENT"}) @PostMapping(value = "/update-payment-method", consumes = {MediaType.APPLICATION_JSON_VALUE}) @ResponseBody ApplePayOrderUpdate updatePaymentMethod(@RequestBody final ApplePayPaymentMethodUpdateRequest paymentMethodUpdateRequest); }
ApplePayController extends AbstractWorldpayController { @Secured( {"ROLE_CUSTOMERGROUP", "ROLE_GUEST", "ROLE_CUSTOMERMANAGERGROUP", "ROLE_TRUSTED_CLIENT"}) @PostMapping(value = "/authorise-order", consumes = {MediaType.APPLICATION_JSON_VALUE}) @ResponseBody public DirectResponseData authoriseOrder(@RequestBody final ApplePayAuthorisationRequest authorisationRequest) throws WorldpayException, InvalidCartException { worldpayApplePayPaymentCheckoutFacade.saveBillingAddresses(authorisationRequest.getBillingContact()); return worldpayDirectOrderFacade.authoriseApplePayDirect(authorisationRequest.getToken().getPaymentData()); }  @Secured({"ROLE_CUSTOMERGROUP", "ROLE_GUEST", "ROLE_CUSTOMERMANAGERGROUP", "ROLE_TRUSTED_CLIENT"}) @PostMapping(value = "/request-session", consumes = {MediaType.APPLICATION_JSON_VALUE}) @ResponseBody Object requestPaymentSession(@RequestBody final ValidateMerchantRequestWsDTO validateMerchantRequestWsDTO); @Secured( {"ROLE_CUSTOMERGROUP", "ROLE_GUEST", "ROLE_CUSTOMERMANAGERGROUP", "ROLE_TRUSTED_CLIENT"}) @PostMapping(value = "/authorise-order", consumes = {MediaType.APPLICATION_JSON_VALUE}) @ResponseBody DirectResponseData authoriseOrder(@RequestBody final ApplePayAuthorisationRequest authorisationRequest); @Secured( {"ROLE_CUSTOMERGROUP", "ROLE_GUEST", "ROLE_CUSTOMERMANAGERGROUP", "ROLE_TRUSTED_CLIENT"}) @PostMapping(value = "/update-payment-method", consumes = {MediaType.APPLICATION_JSON_VALUE}) @ResponseBody ApplePayOrderUpdate updatePaymentMethod(@RequestBody final ApplePayPaymentMethodUpdateRequest paymentMethodUpdateRequest);  }