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
ConstructorsConstructorDescriptionDefaultCheckoutComApplePayWebClientProvider(CheckoutComApplePayCertificateAndKeyProvider certificatesProvider) -
Method Summary
Modifier and TypeMethodDescriptionprotected StringgenerateCacheKey(String applicationId, String tenantId) org.springframework.web.reactive.function.client.WebClientgetApplePayWebClient(String applicationId, String tenantId) Create and return theWebClientwith the Apple Pay certificates.protected io.netty.handler.ssl.SslContextgetSslContext(String applicationId, String tenantId) Builds theSslContextfor web client with the Apple Pay certificates.protected StringgetUniqueApplePayClientCertificateAlias(String applicationId, String tenantId) protected StringgetUniqueApplePayClientKeyAlias(String applicationId, String tenantId) protected CertificateloadCertificate(InputStream inputStream) protected byte[]readPemContent(InputStream inputStream) protected PrivateKeyreadPrivateKey(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:CheckoutComApplePayWebClientProviderCreate and return theWebClientwith the Apple Pay certificates.- Specified by:
getApplePayWebClientin 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 theSslContextfor 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
SslContextfor web client with the Apple Pay certificates - See Also:
-
getUniqueApplePayClientCertificateAlias
-
getUniqueApplePayClientKeyAlias
-
loadCertificate
protected Certificate loadCertificate(InputStream inputStream) throws IOException, GeneralSecurityException - Throws:
IOExceptionGeneralSecurityException
-
readPrivateKey
protected PrivateKey readPrivateKey(InputStream inputStream) throws NoSuchAlgorithmException, IOException, InvalidKeySpecException -
readPemContent
- Throws:
IOException
-