@Test public void shouldCreateTokenRequestWithMerchantScope() { when(siteConfigServiceMock.getBoolean(WORLDPAY_MERCHANT_TOKEN_ENABLED, false)).thenReturn(true); final TokenRequest result = testObj.createTokenRequest(TOKEN_EVENT_REFERENCE, TOKEN_REASON); assertEquals(TOKEN_EVENT_REFERENCE, result.getTokenEventReference()); assertEquals(TOKEN_REASON, result.getTokenReason()); assertTrue(result.isMerchantToken()); }
@Override public TokenRequest createTokenRequest(final String tokenEventReference, final String tokenReason) { if (isMerchantTokenEnabled()) { return createMerchantTokenRequest(tokenEventReference, tokenReason); } return createShopperTokenRequest(tokenEventReference, tokenReason); }
DefaultWorldpayOrderService implements WorldpayOrderService { @Override public TokenRequest createTokenRequest(final String tokenEventReference, final String tokenReason) { if (isMerchantTokenEnabled()) { return createMerchantTokenRequest(tokenEventReference, tokenReason); } return createShopperTokenRequest(tokenEventReference, tokenReason); } }
DefaultWorldpayOrderService implements WorldpayOrderService { @Override public TokenRequest createTokenRequest(final String tokenEventReference, final String tokenReason) { if (isMerchantTokenEnabled()) { return createMerchantTokenRequest(tokenEventReference, tokenReason); } return createShopperTokenRequest(tokenEventReference, tokenReason); } DefaultWorldpayOrderService(final CommonI18NService commonI18NService, final WorldpayUrlService worldpayUrlService, final SiteConfigService siteConfigService); }
DefaultWorldpayOrderService implements WorldpayOrderService { @Override public TokenRequest createTokenRequest(final String tokenEventReference, final String tokenReason) { if (isMerchantTokenEnabled()) { return createMerchantTokenRequest(tokenEventReference, tokenReason); } return createShopperTokenRequest(tokenEventReference, tokenReason); } 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 TokenRequest createTokenRequest(final String tokenEventReference, final String tokenReason) { if (isMerchantTokenEnabled()) { return createMerchantTokenRequest(tokenEventReference, tokenReason); } return createShopperTokenRequest(tokenEventReference, tokenReason); } 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);  }