Class DefaultCheckoutComApplePayWebClientProvider
java.lang.Object
com.broadleafcommerce.vendor.checkoutcom.service.sesseion.DefaultCheckoutComApplePayWebClientProvider
- All Implemented Interfaces:
CheckoutComApplePayWebClientProvider
public class DefaultCheckoutComApplePayWebClientProvider
extends Object
implements CheckoutComApplePayWebClientProvider
Default implementation for
CheckoutComApplePayWebClientProvider
.- Author:
- Dima Myroniuk (dmyroniuk)
-
Constructor Summary
ConstructorDescriptionDefaultCheckoutComApplePayWebClientProvider
(CheckoutComApplePayCertificateAndKeyProvider certificatesProvider) -
Method Summary
Modifier and TypeMethodDescriptionprotected String
generateCacheKey
(String applicationId, String tenantId) org.springframework.web.reactive.function.client.WebClient
getApplePayWebClient
(String applicationId, String tenantId) Create and return theWebClient
with the Apple Pay certificates.protected io.netty.handler.ssl.SslContext
getSslContext
(String applicationId, String tenantId) Builds theSslContext
for web client with the Apple Pay certificates.protected String
getUniqueApplePayClientCertificateAlias
(String applicationId, String tenantId) protected String
getUniqueApplePayClientKeyAlias
(String applicationId, String tenantId) protected Certificate
loadCertificate
(InputStream inputStream) protected byte[]
readPemContent
(InputStream inputStream) protected PrivateKey
readPrivateKey
(InputStream inputStream)
-
Constructor Details
-
DefaultCheckoutComApplePayWebClientProvider
public DefaultCheckoutComApplePayWebClientProvider(CheckoutComApplePayCertificateAndKeyProvider certificatesProvider)
-
-
Method Details
-
getApplePayWebClient
public org.springframework.web.reactive.function.client.WebClient getApplePayWebClient(@Nullable String applicationId, @Nullable String tenantId) Description copied from interface:CheckoutComApplePayWebClientProvider
Create and return theWebClient
with the Apple Pay certificates.- Specified by:
getApplePayWebClient
in interfaceCheckoutComApplePayWebClientProvider
- Parameters:
applicationId
- the application idtenantId
- the tenant id- Returns:
- the web client with the Apple Pay certificates
-
generateCacheKey
-
getSslContext
protected io.netty.handler.ssl.SslContext getSslContext(@Nullable String applicationId, @Nullable String tenantId) Builds theSslContext
for web client with the Apple Pay certificates. This is required to execute the secure request to the Apple Pay API.- Parameters:
applicationId
- the application idtenantId
- the tenant id- Returns:
- the
SslContext
for web client with the Apple Pay certificates - See Also:
-
getUniqueApplePayClientCertificateAlias
-
getUniqueApplePayClientKeyAlias
-
loadCertificate
protected Certificate loadCertificate(InputStream inputStream) throws IOException, GeneralSecurityException - Throws:
IOException
GeneralSecurityException
-
readPrivateKey
protected PrivateKey readPrivateKey(InputStream inputStream) throws NoSuchAlgorithmException, IOException, InvalidKeySpecException -
readPemContent
- Throws:
IOException
-