Class DefaultChasePaymentApplePayWebClientProvider
java.lang.Object
com.broadleafcommerce.vendor.chasepayment.service.wallet.provider.DefaultChasePaymentApplePayWebClientProvider
- All Implemented Interfaces:
ChasePaymentApplePayWebClientProvider
public class DefaultChasePaymentApplePayWebClientProvider
extends Object
implements ChasePaymentApplePayWebClientProvider
Default implementation of
ChasePaymentApplePayWebClientProvider-
Constructor Summary
ConstructorsConstructorDescriptionDefaultChasePaymentApplePayWebClientProvider(ChasePaymentApplePayMerchantIdentityCertificateAndKeyProvider certificatesProvider) -
Method Summary
Modifier and TypeMethodDescriptionprotected StringdetermineKeyManagerFactoryPassword(String applicationId, String tenantId) Hook point to populate the password for the SSL KeyManagerFactory.protected 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 X509CertificateloadCertificate(InputStream certificateInputStream) protected PrivateKeyreadPrivateKey(InputStream keyInputStream)
-
Constructor Details
-
DefaultChasePaymentApplePayWebClientProvider
public DefaultChasePaymentApplePayWebClientProvider(ChasePaymentApplePayMerchantIdentityCertificateAndKeyProvider certificatesProvider)
-
-
Method Details
-
getApplePayWebClient
public org.springframework.web.reactive.function.client.WebClient getApplePayWebClient(@Nullable String applicationId, @Nullable String tenantId) Description copied from interface:ChasePaymentApplePayWebClientProviderCreate and return theWebClientwith the Apple Pay certificates.- Specified by:
getApplePayWebClientin interfaceChasePaymentApplePayWebClientProvider- 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:
-
readPrivateKey
protected PrivateKey readPrivateKey(InputStream keyInputStream) throws GeneralSecurityException, IOException - Parameters:
keyInputStream- Base64 encoded input stream for the private key- Returns:
- the decoded and loaded
PrivateKeyfor the merchant identity private key - Throws:
GeneralSecurityExceptionIOException
-
loadCertificate
protected X509Certificate loadCertificate(InputStream certificateInputStream) throws GeneralSecurityException, IOException - Parameters:
certificateInputStream- Base64 encoded input stream for the certificate- Returns:
- the decoded and loaded
X509Certificatefor the merchant identity certificate - Throws:
GeneralSecurityExceptionIOException
-
determineKeyManagerFactoryPassword
protected String determineKeyManagerFactoryPassword(@Nullable String applicationId, @Nullable String tenantId) Hook point to populate the password for the SSL KeyManagerFactory.- Parameters:
applicationId- the application idtenantId- the tenant id- Returns:
- the SSL KeyManagerFactory password
-