@Test public void shouldCreateApplePayPayment() throws WorldpayModelTransformationException { final ApplePayHeader applePayHeader = new ApplePayHeader(); applePayHeader.setEphemeralPublicKey(EPHEMERAL_PUBLIC_KEY); applePayHeader.setPublicKeyHash(PUBLIC_KEY_HASH); applePayHeader.setTransactionId(TRANSACTION_ID); final ApplePayAdditionalAuthInfo additionalInfoApplePayData = new ApplePayAdditionalAuthInfo(); additionalInfoApplePayData.setHeader(applePayHeader); additionalInfoApplePayData.setData(DATA); additionalInfoApplePayData.setSignature(SIGNATURE); additionalInfoApplePayData.setVersion(VERSION); final ApplePay result = (ApplePay) testObj.createApplePayPayment(additionalInfoApplePayData); assertThat(result.getData()).isEqualTo(DATA); assertThat(result.getSignature()).isEqualTo(SIGNATURE); assertThat(result.getVersion()).isEqualTo(VERSION); final Header header = (Header) result.getHeader().transformToInternalModel(); assertThat(header.getEphemeralPublicKey()).isEqualTo(EPHEMERAL_PUBLIC_KEY); assertThat(header.getPublicKeyHash()).isEqualTo(PUBLIC_KEY_HASH); assertThat(header.getTransactionId()).isEqualTo(TRANSACTION_ID); }
@Override public Payment createApplePayPayment(final ApplePayAdditionalAuthInfo worldpayAdditionalInfoApplePayData) { final Header header = new Header(worldpayAdditionalInfoApplePayData.getHeader().getEphemeralPublicKey(), worldpayAdditionalInfoApplePayData.getHeader().getPublicKeyHash(), worldpayAdditionalInfoApplePayData.getHeader().getTransactionId(), null); return new ApplePay(header, worldpayAdditionalInfoApplePayData.getSignature(), worldpayAdditionalInfoApplePayData.getVersion(), worldpayAdditionalInfoApplePayData.getData(), null); }
DefaultWorldpayOrderService implements WorldpayOrderService { @Override public Payment createApplePayPayment(final ApplePayAdditionalAuthInfo worldpayAdditionalInfoApplePayData) { final Header header = new Header(worldpayAdditionalInfoApplePayData.getHeader().getEphemeralPublicKey(), worldpayAdditionalInfoApplePayData.getHeader().getPublicKeyHash(), worldpayAdditionalInfoApplePayData.getHeader().getTransactionId(), null); return new ApplePay(header, worldpayAdditionalInfoApplePayData.getSignature(), worldpayAdditionalInfoApplePayData.getVersion(), worldpayAdditionalInfoApplePayData.getData(), null); } }
DefaultWorldpayOrderService implements WorldpayOrderService { @Override public Payment createApplePayPayment(final ApplePayAdditionalAuthInfo worldpayAdditionalInfoApplePayData) { final Header header = new Header(worldpayAdditionalInfoApplePayData.getHeader().getEphemeralPublicKey(), worldpayAdditionalInfoApplePayData.getHeader().getPublicKeyHash(), worldpayAdditionalInfoApplePayData.getHeader().getTransactionId(), null); return new ApplePay(header, worldpayAdditionalInfoApplePayData.getSignature(), worldpayAdditionalInfoApplePayData.getVersion(), worldpayAdditionalInfoApplePayData.getData(), null); } DefaultWorldpayOrderService(final CommonI18NService commonI18NService, final WorldpayUrlService worldpayUrlService, final SiteConfigService siteConfigService); }
DefaultWorldpayOrderService implements WorldpayOrderService { @Override public Payment createApplePayPayment(final ApplePayAdditionalAuthInfo worldpayAdditionalInfoApplePayData) { final Header header = new Header(worldpayAdditionalInfoApplePayData.getHeader().getEphemeralPublicKey(), worldpayAdditionalInfoApplePayData.getHeader().getPublicKeyHash(), worldpayAdditionalInfoApplePayData.getHeader().getTransactionId(), null); return new ApplePay(header, worldpayAdditionalInfoApplePayData.getSignature(), worldpayAdditionalInfoApplePayData.getVersion(), worldpayAdditionalInfoApplePayData.getData(), null); } DefaultWorldpayOrderService(final CommonI18NService commonI18NService, final WorldpayUrlService worldpayUrlService, final SiteConfigService siteConfigService); @Override Amount createAmount(final Currency currency, final int amount); @Override Amount createAmount(final CurrencyModel currencyModel, final double amount); @Override Amount createAmount(final Currency currency, final double amount); @Override BigDecimal convertAmount(final Amount amount); @Override Session createSession(final WorldpayAdditionalInfoData worldpayAdditionalInfo); @Override Browser createBrowser(final WorldpayAdditionalInfoData worldpayAdditionalInfo); @Override BasicOrderInfo createBasicOrderInfo(final String worldpayOrderCode, final String description, final Amount amount); @Override Shopper createShopper(final String customerEmail, final Session session, final Browser browser); @Override Shopper createAuthenticatedShopper(final String customerEmail, final String authenticatedShopperID, final Session session, final Browser browser); @Override TokenRequest createTokenRequest(final String tokenEventReference, final String tokenReason); @Override TokenRequest createTokenRequestForDeletion(final String tokenEventReference, final String tokenReason, final String authenticatedShopperId); @Override CreateTokenServiceRequest createTokenServiceRequest(final MerchantInfo merchantInfo, final String authenticatedShopperId,
                                                               final Payment csePayment, final TokenRequest tokenRequest); @Override Payment createBankPayment(final String paymentMethod, final String shopperBankCode); @Override Payment createKlarnaPayment(final String countryCode, final String languageCode, final String extraMerchantData); @Override Token createToken(final String subscriptionId, final String securityCode); @Override UpdateTokenServiceRequest createUpdateTokenServiceRequest(final MerchantInfo merchantInfo, final WorldpayAdditionalInfoData worldpayAdditionalInfoData,
                                                                     final TokenRequest tokenRequest, final String paymentTokenID,
                                                                     final CardDetails cardDetails); @Override Payment createApplePayPayment(final ApplePayAdditionalAuthInfo worldpayAdditionalInfoApplePayData); @Override Additional3DSData createAdditional3DSData(final WorldpayAdditionalInfoData worldpayAdditionalInfoData); @Override Cse createCsePayment(final CSEAdditionalAuthInfo cseAdditionalAuthInfo, final Address billingAddress); @Override PayWithGoogleSSL createGooglePayPayment(final String protocolVersion, final String signature, final String signedMessage); @Override StoredCredentials createStoredCredentials(final Usage usage, final MerchantInitiatedReason merchantInitiatedReason, final String transactionIdentifier); }
DefaultWorldpayOrderService implements WorldpayOrderService { @Override public Payment createApplePayPayment(final ApplePayAdditionalAuthInfo worldpayAdditionalInfoApplePayData) { final Header header = new Header(worldpayAdditionalInfoApplePayData.getHeader().getEphemeralPublicKey(), worldpayAdditionalInfoApplePayData.getHeader().getPublicKeyHash(), worldpayAdditionalInfoApplePayData.getHeader().getTransactionId(), null); return new ApplePay(header, worldpayAdditionalInfoApplePayData.getSignature(), worldpayAdditionalInfoApplePayData.getVersion(), worldpayAdditionalInfoApplePayData.getData(), null); } DefaultWorldpayOrderService(final CommonI18NService commonI18NService, final WorldpayUrlService worldpayUrlService, final SiteConfigService siteConfigService); @Override Amount createAmount(final Currency currency, final int amount); @Override Amount createAmount(final CurrencyModel currencyModel, final double amount); @Override Amount createAmount(final Currency currency, final double amount); @Override BigDecimal convertAmount(final Amount amount); @Override Session createSession(final WorldpayAdditionalInfoData worldpayAdditionalInfo); @Override Browser createBrowser(final WorldpayAdditionalInfoData worldpayAdditionalInfo); @Override BasicOrderInfo createBasicOrderInfo(final String worldpayOrderCode, final String description, final Amount amount); @Override Shopper createShopper(final String customerEmail, final Session session, final Browser browser); @Override Shopper createAuthenticatedShopper(final String customerEmail, final String authenticatedShopperID, final Session session, final Browser browser); @Override TokenRequest createTokenRequest(final String tokenEventReference, final String tokenReason); @Override TokenRequest createTokenRequestForDeletion(final String tokenEventReference, final String tokenReason, final String authenticatedShopperId); @Override CreateTokenServiceRequest createTokenServiceRequest(final MerchantInfo merchantInfo, final String authenticatedShopperId,
                                                               final Payment csePayment, final TokenRequest tokenRequest); @Override Payment createBankPayment(final String paymentMethod, final String shopperBankCode); @Override Payment createKlarnaPayment(final String countryCode, final String languageCode, final String extraMerchantData); @Override Token createToken(final String subscriptionId, final String securityCode); @Override UpdateTokenServiceRequest createUpdateTokenServiceRequest(final MerchantInfo merchantInfo, final WorldpayAdditionalInfoData worldpayAdditionalInfoData,
                                                                     final TokenRequest tokenRequest, final String paymentTokenID,
                                                                     final CardDetails cardDetails); @Override Payment createApplePayPayment(final ApplePayAdditionalAuthInfo worldpayAdditionalInfoApplePayData); @Override Additional3DSData createAdditional3DSData(final WorldpayAdditionalInfoData worldpayAdditionalInfoData); @Override Cse createCsePayment(final CSEAdditionalAuthInfo cseAdditionalAuthInfo, final Address billingAddress); @Override PayWithGoogleSSL createGooglePayPayment(final String protocolVersion, final String signature, final String signedMessage); @Override StoredCredentials createStoredCredentials(final Usage usage, final MerchantInitiatedReason merchantInitiatedReason, final String transactionIdentifier);  }