Class DefaultStripeExternalCallService<T>
java.lang.Object
com.broadleafcommerce.paymentgateway.service.AbstractExternalPaymentGatewayCall<StripePaymentRequest,com.stripe.model.StripeObject>
com.broadleafcommerce.payment.service.gateway.DefaultStripeExternalCallService<T>
- All Implemented Interfaces:
StripeExternalCallService
,com.broadleafcommerce.paymentgateway.service.FailureCountExposable
,com.broadleafcommerce.paymentgateway.vendor.service.monitor.ServiceStatusDetectable<StripePaymentRequest>
public class DefaultStripeExternalCallService<T>
extends com.broadleafcommerce.paymentgateway.service.AbstractExternalPaymentGatewayCall<StripePaymentRequest,com.stripe.model.StripeObject>
implements StripeExternalCallService
-
Field Summary
FieldsFields inherited from class com.broadleafcommerce.paymentgateway.service.AbstractExternalPaymentGatewayCall
failureCount, isUp
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultStripeExternalCallService
(StripeConfiguration configuration, StripeRestConfigurationProperties restConfigurationProperties, org.springframework.retry.support.RetryTemplate retryTemplate) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addRawResponse
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, com.stripe.model.StripeError stripeError) buildAddressForStripeUser
(@NonNull StripePaymentRequest stripePaymentRequest) protected com.stripe.param.CustomerCreateParams.Address
buildCustomerAddress
(@NonNull StripePaymentRequest stripePaymentRequest) buildCustomerShippingAddress
(@NonNull com.broadleafcommerce.paymentgateway.domain.Address<com.broadleafcommerce.paymentgateway.domain.PaymentRequest> shipTo) buildCustomerShippingData
(@NonNull StripePaymentRequest stripePaymentRequest) protected String
buildIdempotencyKey
(@NonNull StripePaymentRequest stripePaymentRequest) Builds or gathers the idempotencyKey for the request.buildPaymentIntentConfirmationParams
(@NonNull com.stripe.model.PaymentIntent paymentIntent, @NonNull StripePaymentRequest stripePaymentRequest) protected com.stripe.param.PaymentIntentCreateParams.Shipping
buildPaymentIntentShipping
(@NonNull StripePaymentRequest stripePaymentRequest) protected com.stripe.param.PaymentIntentCreateParams.Shipping.Address
buildPaymentIntentShippingAddress
(@NonNull com.broadleafcommerce.paymentgateway.domain.Address<com.broadleafcommerce.paymentgateway.domain.PaymentRequest> shipTo) protected com.stripe.net.RequestOptions
buildRequestOptions
(@NonNull StripePaymentRequest stripePaymentRequest) Builds aRequestOptions
object including API credentials & an idempotencyKeyprotected com.stripe.net.RequestOptions
buildRequestOptionsForUpdatePaymentIntent
(@NonNull StripePaymentRequest stripePaymentRequest) protected com.stripe.param.CustomerUpdateParams.Address
buildUpdateCustomerAddressPayload
(@NonNull StripePaymentRequest stripePaymentRequest) protected com.stripe.param.CustomerUpdateParams.Shipping.Address
buildUpdateCustomerShippingAddressPayload
(@NonNull com.broadleafcommerce.paymentgateway.domain.Address<com.broadleafcommerce.paymentgateway.domain.PaymentRequest> shipTo) protected com.stripe.param.CustomerUpdateParams.Shipping
buildUpdateCustomerShippingPayload
(@NonNull StripePaymentRequest stripePaymentRequest) com.stripe.model.StripeObject
call
(@NonNull StripePaymentRequest paymentRequest) protected com.stripe.model.StripeObject
captureCharge
(@NonNull StripePaymentRequest stripePaymentRequest, @NonNull com.stripe.net.RequestOptions requestOptions) Deprecated, for removal: This API element is subject to removal in a future version.The usage of the Charges API is not compliant with SCA, so high rates of declines are likely in EEA.protected com.stripe.model.StripeObject
capturePaymentIntent
(@NonNull StripePaymentRequest stripePaymentRequest, @NonNull com.stripe.net.RequestOptions requestOptions) com.stripe.model.StripeObject
communicateWithVendor
(@NonNull StripePaymentRequest stripePaymentRequest) protected com.stripe.model.StripeObject
communicateWithVendorChargesAPI
(@NonNull StripePaymentRequest stripePaymentRequest, @NonNull com.stripe.net.RequestOptions requestOptions) Deprecated, for removal: This API element is subject to removal in a future version.The usage of the Charges API is not compliant with SCA, so high rates of declines are likely in EEA.protected com.stripe.model.StripeObject
communicateWithVendorCustomerAPI
(@NonNull StripePaymentRequest stripePaymentRequest, @NonNull com.stripe.net.RequestOptions requestOptions) protected com.stripe.model.StripeObject
communicateWithVendorPaymentIntentsAPI
(@NonNull StripePaymentRequest stripePaymentRequest, @NonNull com.stripe.net.RequestOptions requestOptions) protected com.stripe.model.StripeObject
confirmPaymentIntent
(@NonNull StripePaymentRequest stripePaymentRequest, @NonNull com.stripe.net.RequestOptions requestOptions) protected com.stripe.model.StripeObject
confirmPaymentIntentForAch
(@NonNull StripePaymentRequest stripePaymentRequest, @NonNull com.stripe.net.RequestOptions requestOptions) protected com.stripe.model.StripeObject
createCharge
(@NonNull StripePaymentRequest stripePaymentRequest, @NonNull com.stripe.net.RequestOptions requestOptions) Deprecated, for removal: This API element is subject to removal in a future version.The usage of the Charges API is not compliant with SCA, so high rates of declines are likely in EEA.protected com.stripe.model.StripeObject
createChargeFromPaymentIntent
(@NonNull StripePaymentRequest stripePaymentRequest, @NonNull com.stripe.net.RequestOptions requestOptions) Deprecated, for removal: This API element is subject to removal in a future version.The usage of the Charges API is not compliant with SCA, so high rates of declines are likely in EEA.protected com.stripe.model.StripeObject
createCustomer
(@NonNull StripePaymentRequest stripePaymentRequest, @NonNull com.stripe.net.RequestOptions requestOptions) protected com.stripe.model.StripeObject
createPaymentIntent
(@NonNull StripePaymentRequest stripePaymentRequest, @NonNull com.stripe.net.RequestOptions requestOptions) protected com.stripe.model.StripeObject
deleteCustomer
(@NonNull StripePaymentRequest stripePaymentRequest, @NonNull com.stripe.net.RequestOptions requestOptions) protected String
determineCustomerEmail
(@NonNull StripePaymentRequest stripePaymentRequest) protected String
determineCustomerName
(@NonNull StripePaymentRequest stripePaymentRequest) protected String
determineCustomerPhone
(@NonNull StripePaymentRequest stripePaymentRequest) protected String
determineDeclineType
(String responseCode) Determine whether the decline code should be considered a hard or soft decline.protected String
determineFailureTypeForCardException
(com.stripe.exception.CardException cardException) protected Long
determineLineItemDiscountAmount
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, @NonNull com.broadleafcommerce.paymentgateway.domain.LineItem lineItem) protected String
determineLineItemProductCode
(@NonNull com.broadleafcommerce.paymentgateway.domain.LineItem lineItem) protected String
determineProductDescription
(@NonNull com.broadleafcommerce.paymentgateway.domain.LineItem lineItem) javax.money.MonetaryAmount
getAmountInMajorUnits
(@NonNull Long amount, @NonNull String currencyCode) protected Long
getAmountInMinorUnits
(@NonNull javax.money.MonetaryAmount amount) protected StripeConfiguration
getCustomMetadata
(@NonNull StripePaymentRequest stripePaymentRequest) Add the transactionReferenceId to the custom metadata so that we can link Stripe's record of the transaction to our record of the transactionprotected StripeRestConfigurationProperties
protected org.springframework.retry.support.RetryTemplate
protected com.stripe.param.PaymentIntentCreateParams.SetupFutureUsage
getSetupFutureUsage
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) protected String
getShippingCustomerName
(@NonNull com.broadleafcommerce.paymentgateway.domain.Address<com.broadleafcommerce.paymentgateway.domain.PaymentRequest> shipTo) protected Long
getShippingTotalInMinorUnits
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) protected String
getStripeAccount
(@NonNull StripePaymentRequest stripePaymentRequest) When integrating with Stripe Connect functionality such as for a marketplace implementation, this will retrieve the the Stripe Account ID for the connected account so that it can be added to the request.protected Long
getSubtotalInMinorUnits
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) protected Long
getTaxTotalInMinorUnits
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) getTransactionTotalInMinorUnits
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) protected com.stripe.model.StripeObject
handleCustomCustomerOperation
(@NonNull StripePaymentRequest stripePaymentRequest, @NonNull com.stripe.net.RequestOptions requestOptions, @NonNull StripeMethodType methodType) protected com.stripe.model.StripeObject
handleCustomPaymentIntentOperation
(@NonNull StripePaymentRequest stripePaymentRequest, @NonNull com.stripe.net.RequestOptions requestOptions, @NonNull StripeMethodType methodType) protected com.stripe.model.StripeObject
handleCustomVendorChargeOperation
(@NonNull StripePaymentRequest stripePaymentRequest, @NonNull com.stripe.net.RequestOptions requestOptions, @NonNull StripeMethodType methodType) protected boolean
isAch
(@NonNull StripePaymentRequest stripePaymentRequest) protected boolean
isACHPaymentRequest
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) protected boolean
isInvalidPaymentMethodFailureType
(String declineCode) protected boolean
isLevel3DataEnabled
(@NonNull StripePaymentRequest stripePaymentRequest) boolean
isPaymentIntentRequest
(@NonNull StripePaymentRequest stripePaymentRequest) protected boolean
isStripeCustomerRequest
(@NonNull StripeMethodType stripeMethodType) protected String
protected void
populateCustomCaptureChargeParams
(Map<String, Object> params, @NonNull StripePaymentRequest stripePaymentRequest) protected void
populateCustomCaptureIntentParams
(Map<String, Object> params, @NonNull StripePaymentRequest stripePaymentRequest) populateCustomConfirmIntentParams
(Map<String, Object> params, @NonNull StripePaymentRequest stripePaymentRequest) protected void
populateCustomCreateChargeFromIntentParams
(Map<String, Object> params, @NonNull StripePaymentRequest stripePaymentRequest) protected void
populateCustomCreateChargeParams
(Map<String, Object> params, @NonNull StripePaymentRequest stripePaymentRequest) protected void
populateCustomerAdditionalAttributes
(@NonNull StripePaymentRequest stripePaymentRequest, @NonNull Map<String, Object> params) populateCustomerMetadata
(@NonNull StripePaymentRequest stripePaymentRequest) protected void
populateCustomMetadata
(@NonNull StripePaymentRequest stripePaymentRequest, @NonNull Map<String, Object> params) Hookpoint for populating metadata on stripe requests that support it in their params.protected void
populateCustomRefundChargeParams
(Map<String, Object> params, @NonNull StripePaymentRequest stripePaymentRequest) protected void
populateCustomRefundIntentParams
(Map<String, Object> params, @NonNull StripePaymentRequest stripePaymentRequest) populateLevel3Data
(@NonNull StripePaymentRequest stripePaymentRequest) {@link 'https://stripe.com/guides/3d-secure-2'}populateLineItemData
(@NonNull StripePaymentRequest stripePaymentRequest) protected com.stripe.param.PaymentIntentCreateParams
populatePaymentIntentCreateParams
(@NonNull StripePaymentRequest stripePaymentRequest, @NonNull String paymentMethodId) void
processStripeException
(@NonNull Exception e, @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) protected com.stripe.model.StripeObject
refundCharge
(@NonNull StripePaymentRequest stripePaymentRequest, @NonNull com.stripe.net.RequestOptions requestOptions) Deprecated, for removal: This API element is subject to removal in a future version.The usage of the Charges API is not compliant with SCA, so high rates of declines are likely in EEA.protected com.stripe.model.StripeObject
refundPaymentIntent
(@NonNull StripePaymentRequest stripePaymentRequest, @NonNull com.stripe.net.RequestOptions requestOptions) protected com.stripe.model.StripeObject
retrievePaymentIntent
(@NonNull StripePaymentRequest stripePaymentRequest, @NonNull com.stripe.net.RequestOptions requestOptions) protected com.stripe.model.StripeObject
updateCustomer
(@NonNull StripePaymentRequest stripePaymentRequest, @NonNull com.stripe.net.RequestOptions requestOptions) protected com.stripe.model.PaymentIntent
updatePaymentIntent
(@NonNull StripePaymentRequest stripePaymentRequest, @NonNull com.stripe.model.PaymentIntent paymentIntent) Methods inherited from class com.broadleafcommerce.paymentgateway.service.AbstractExternalPaymentGatewayCall
clearStatus, getServiceStatus, incrementFailure, process
-
Field Details
-
DEFAULT_CURRENCY_USD
- See Also:
-
-
Constructor Details
-
DefaultStripeExternalCallService
public DefaultStripeExternalCallService(StripeConfiguration configuration, StripeRestConfigurationProperties restConfigurationProperties, org.springframework.retry.support.RetryTemplate retryTemplate)
-
-
Method Details
-
call
- Specified by:
call
in interfaceStripeExternalCallService
-
communicateWithVendor
public com.stripe.model.StripeObject communicateWithVendor(@NonNull @NonNull StripePaymentRequest stripePaymentRequest) throws Exception - Specified by:
communicateWithVendor
in classcom.broadleafcommerce.paymentgateway.service.AbstractExternalPaymentGatewayCall<StripePaymentRequest,
com.stripe.model.StripeObject> - Throws:
Exception
-
communicateWithVendorChargesAPI
@Deprecated(forRemoval=true) protected com.stripe.model.StripeObject communicateWithVendorChargesAPI(@NonNull @NonNull StripePaymentRequest stripePaymentRequest, @NonNull @NonNull com.stripe.net.RequestOptions requestOptions) throws Exception Deprecated, for removal: This API element is subject to removal in a future version.The usage of the Charges API is not compliant with SCA, so high rates of declines are likely in EEA. Related documentation https://stripe.com/docs/strong-customer-authentication#preparing- Throws:
Exception
-
communicateWithVendorPaymentIntentsAPI
protected com.stripe.model.StripeObject communicateWithVendorPaymentIntentsAPI(@NonNull @NonNull StripePaymentRequest stripePaymentRequest, @NonNull @NonNull com.stripe.net.RequestOptions requestOptions) throws Exception - Throws:
Exception
-
communicateWithVendorCustomerAPI
protected com.stripe.model.StripeObject communicateWithVendorCustomerAPI(@NonNull @NonNull StripePaymentRequest stripePaymentRequest, @NonNull @NonNull com.stripe.net.RequestOptions requestOptions) throws Exception - Throws:
Exception
-
createCharge
@Deprecated(forRemoval=true) protected com.stripe.model.StripeObject createCharge(@NonNull @NonNull StripePaymentRequest stripePaymentRequest, @NonNull @NonNull com.stripe.net.RequestOptions requestOptions) throws Exception Deprecated, for removal: This API element is subject to removal in a future version.The usage of the Charges API is not compliant with SCA, so high rates of declines are likely in EEA. Related documentation https://stripe.com/docs/strong-customer-authentication#preparing- Throws:
Exception
-
populateCustomCreateChargeParams
protected void populateCustomCreateChargeParams(Map<String, Object> params, @NonNull @NonNull StripePaymentRequest stripePaymentRequest) -
captureCharge
@Deprecated(forRemoval=true) protected com.stripe.model.StripeObject captureCharge(@NonNull @NonNull StripePaymentRequest stripePaymentRequest, @NonNull @NonNull com.stripe.net.RequestOptions requestOptions) throws Exception Deprecated, for removal: This API element is subject to removal in a future version.The usage of the Charges API is not compliant with SCA, so high rates of declines are likely in EEA. Related documentation https://stripe.com/docs/strong-customer-authentication#preparing- Throws:
Exception
-
populateCustomCaptureChargeParams
protected void populateCustomCaptureChargeParams(Map<String, Object> params, @NonNull @NonNull StripePaymentRequest stripePaymentRequest) -
refundCharge
@Deprecated(forRemoval=true) protected com.stripe.model.StripeObject refundCharge(@NonNull @NonNull StripePaymentRequest stripePaymentRequest, @NonNull @NonNull com.stripe.net.RequestOptions requestOptions) throws Exception Deprecated, for removal: This API element is subject to removal in a future version.The usage of the Charges API is not compliant with SCA, so high rates of declines are likely in EEA. Related documentation https://stripe.com/docs/strong-customer-authentication#preparing- Throws:
Exception
-
populateCustomRefundChargeParams
protected void populateCustomRefundChargeParams(Map<String, Object> params, @NonNull @NonNull StripePaymentRequest stripePaymentRequest) -
handleCustomVendorChargeOperation
protected com.stripe.model.StripeObject handleCustomVendorChargeOperation(@NonNull @NonNull StripePaymentRequest stripePaymentRequest, @NonNull @NonNull com.stripe.net.RequestOptions requestOptions, @NonNull @NonNull StripeMethodType methodType) throws Exception - Throws:
Exception
-
createPaymentIntent
protected com.stripe.model.StripeObject createPaymentIntent(@NonNull @NonNull StripePaymentRequest stripePaymentRequest, @NonNull @NonNull com.stripe.net.RequestOptions requestOptions) throws Exception - Throws:
Exception
-
confirmPaymentIntent
protected com.stripe.model.StripeObject confirmPaymentIntent(@NonNull @NonNull StripePaymentRequest stripePaymentRequest, @NonNull @NonNull com.stripe.net.RequestOptions requestOptions) throws Exception - Throws:
Exception
-
isAch
-
confirmPaymentIntentForAch
protected com.stripe.model.StripeObject confirmPaymentIntentForAch(@NonNull @NonNull StripePaymentRequest stripePaymentRequest, @NonNull @NonNull com.stripe.net.RequestOptions requestOptions) throws Exception - Throws:
Exception
-
retrievePaymentIntent
protected com.stripe.model.StripeObject retrievePaymentIntent(@NonNull @NonNull StripePaymentRequest stripePaymentRequest, @NonNull @NonNull com.stripe.net.RequestOptions requestOptions) throws Exception - Throws:
Exception
-
updatePaymentIntent
protected com.stripe.model.PaymentIntent updatePaymentIntent(@NonNull @NonNull StripePaymentRequest stripePaymentRequest, @NonNull @NonNull com.stripe.model.PaymentIntent paymentIntent) throws com.stripe.exception.StripeException - Throws:
com.stripe.exception.StripeException
-
buildPaymentIntentConfirmationParams
protected Map<String,Object> buildPaymentIntentConfirmationParams(@NonNull @NonNull com.stripe.model.PaymentIntent paymentIntent, @NonNull @NonNull StripePaymentRequest stripePaymentRequest) -
populateCustomConfirmIntentParams
-
createChargeFromPaymentIntent
@Deprecated(forRemoval=true) protected com.stripe.model.StripeObject createChargeFromPaymentIntent(@NonNull @NonNull StripePaymentRequest stripePaymentRequest, @NonNull @NonNull com.stripe.net.RequestOptions requestOptions) throws Exception Deprecated, for removal: This API element is subject to removal in a future version.The usage of the Charges API is not compliant with SCA, so high rates of declines are likely in EEA. Related documentation https://stripe.com/docs/strong-customer-authentication#preparing- Throws:
Exception
-
populateCustomCreateChargeFromIntentParams
protected void populateCustomCreateChargeFromIntentParams(Map<String, Object> params, @NonNull @NonNull StripePaymentRequest stripePaymentRequest) -
capturePaymentIntent
protected com.stripe.model.StripeObject capturePaymentIntent(@NonNull @NonNull StripePaymentRequest stripePaymentRequest, @NonNull @NonNull com.stripe.net.RequestOptions requestOptions) throws Exception - Throws:
Exception
-
populateCustomCaptureIntentParams
protected void populateCustomCaptureIntentParams(Map<String, Object> params, @NonNull @NonNull StripePaymentRequest stripePaymentRequest) -
refundPaymentIntent
protected com.stripe.model.StripeObject refundPaymentIntent(@NonNull @NonNull StripePaymentRequest stripePaymentRequest, @NonNull @NonNull com.stripe.net.RequestOptions requestOptions) throws Exception - Throws:
Exception
-
populateCustomRefundIntentParams
protected void populateCustomRefundIntentParams(Map<String, Object> params, @NonNull @NonNull StripePaymentRequest stripePaymentRequest) -
handleCustomPaymentIntentOperation
protected com.stripe.model.StripeObject handleCustomPaymentIntentOperation(@NonNull @NonNull StripePaymentRequest stripePaymentRequest, @NonNull @NonNull com.stripe.net.RequestOptions requestOptions, @NonNull @NonNull StripeMethodType methodType) throws Exception - Throws:
Exception
-
createCustomer
protected com.stripe.model.StripeObject createCustomer(@NonNull @NonNull StripePaymentRequest stripePaymentRequest, @NonNull @NonNull com.stripe.net.RequestOptions requestOptions) throws Exception - Throws:
Exception
-
buildCustomerShippingData
protected Map<String,Object> buildCustomerShippingData(@NonNull @NonNull StripePaymentRequest stripePaymentRequest) -
buildCustomerShippingAddress
-
getShippingCustomerName
@Nullable protected String getShippingCustomerName(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.Address<com.broadleafcommerce.paymentgateway.domain.PaymentRequest> shipTo) -
buildCustomerAddress
@Nullable protected com.stripe.param.CustomerCreateParams.Address buildCustomerAddress(@NonNull @NonNull StripePaymentRequest stripePaymentRequest) -
updateCustomer
protected com.stripe.model.StripeObject updateCustomer(@NonNull @NonNull StripePaymentRequest stripePaymentRequest, @NonNull @NonNull com.stripe.net.RequestOptions requestOptions) throws Exception - Throws:
Exception
-
buildUpdateCustomerShippingPayload
@Nullable protected com.stripe.param.CustomerUpdateParams.Shipping buildUpdateCustomerShippingPayload(@NonNull @NonNull StripePaymentRequest stripePaymentRequest) -
buildUpdateCustomerShippingAddressPayload
protected com.stripe.param.CustomerUpdateParams.Shipping.Address buildUpdateCustomerShippingAddressPayload(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.Address<com.broadleafcommerce.paymentgateway.domain.PaymentRequest> shipTo) -
buildUpdateCustomerAddressPayload
@Nullable protected com.stripe.param.CustomerUpdateParams.Address buildUpdateCustomerAddressPayload(@NonNull @NonNull StripePaymentRequest stripePaymentRequest) -
deleteCustomer
protected com.stripe.model.StripeObject deleteCustomer(@NonNull @NonNull StripePaymentRequest stripePaymentRequest, @NonNull @NonNull com.stripe.net.RequestOptions requestOptions) throws Exception - Throws:
Exception
-
handleCustomCustomerOperation
protected com.stripe.model.StripeObject handleCustomCustomerOperation(@NonNull @NonNull StripePaymentRequest stripePaymentRequest, @NonNull @NonNull com.stripe.net.RequestOptions requestOptions, @NonNull @NonNull StripeMethodType methodType) throws Exception - Throws:
Exception
-
determineCustomerEmail
protected String determineCustomerEmail(@NonNull @NonNull StripePaymentRequest stripePaymentRequest) -
determineCustomerName
@Nullable protected String determineCustomerName(@NonNull @NonNull StripePaymentRequest stripePaymentRequest) -
determineCustomerPhone
@Nullable protected String determineCustomerPhone(@NonNull @NonNull StripePaymentRequest stripePaymentRequest) -
populatePaymentIntentCreateParams
protected com.stripe.param.PaymentIntentCreateParams populatePaymentIntentCreateParams(@NonNull @NonNull StripePaymentRequest stripePaymentRequest, @NonNull @NonNull String paymentMethodId) -
isACHPaymentRequest
protected boolean isACHPaymentRequest(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) -
buildPaymentIntentShipping
@Nullable protected com.stripe.param.PaymentIntentCreateParams.Shipping buildPaymentIntentShipping(@NonNull @NonNull StripePaymentRequest stripePaymentRequest) -
buildPaymentIntentShippingAddress
protected com.stripe.param.PaymentIntentCreateParams.Shipping.Address buildPaymentIntentShippingAddress(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.Address<com.broadleafcommerce.paymentgateway.domain.PaymentRequest> shipTo) -
getTransactionTotalInMinorUnits
public Long getTransactionTotalInMinorUnits(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) - Specified by:
getTransactionTotalInMinorUnits
in interfaceStripeExternalCallService
-
getSubtotalInMinorUnits
protected Long getSubtotalInMinorUnits(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) -
getShippingTotalInMinorUnits
protected Long getShippingTotalInMinorUnits(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) -
getTaxTotalInMinorUnits
protected Long getTaxTotalInMinorUnits(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) -
getAmountInMinorUnits
-
getAmountInMajorUnits
public javax.money.MonetaryAmount getAmountInMajorUnits(@NonNull @NonNull Long amount, @NonNull @NonNull String currencyCode) - Specified by:
getAmountInMajorUnits
in interfaceStripeExternalCallService
-
processStripeException
public void processStripeException(@NonNull @NonNull Exception e, @NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, @NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) - Specified by:
processStripeException
in interfaceStripeExternalCallService
-
addRawResponse
protected void addRawResponse(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, @Nullable com.stripe.model.StripeError stripeError) -
determineFailureTypeForCardException
protected String determineFailureTypeForCardException(com.stripe.exception.CardException cardException) -
isInvalidPaymentMethodFailureType
-
determineDeclineType
Determine whether the decline code should be considered a hard or soft decline.- Parameters:
responseCode
- Stripe's reason for declining the transaction- Returns:
- Whether the decline code should be considered a hard or soft decline.
-
isStripeCustomerRequest
-
populateCustomerMetadata
protected Map<String,Object> populateCustomerMetadata(@NonNull @NonNull StripePaymentRequest stripePaymentRequest) -
populateLevel3Data
@Nullable protected Map<String,Object> populateLevel3Data(@NonNull @NonNull StripePaymentRequest stripePaymentRequest) {@link 'https://stripe.com/guides/3d-secure-2'} -
isLevel3DataEnabled
-
getSetupFutureUsage
protected com.stripe.param.PaymentIntentCreateParams.SetupFutureUsage getSetupFutureUsage(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) -
maxLength
-
populateLineItemData
protected Map<String,Object> populateLineItemData(@NonNull @NonNull StripePaymentRequest stripePaymentRequest) -
determineProductDescription
protected String determineProductDescription(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.LineItem lineItem) -
determineLineItemProductCode
protected String determineLineItemProductCode(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.LineItem lineItem) -
determineLineItemDiscountAmount
protected Long determineLineItemDiscountAmount(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, @NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.LineItem lineItem) -
populateCustomMetadata
protected void populateCustomMetadata(@NonNull @NonNull StripePaymentRequest stripePaymentRequest, @NonNull @NonNull Map<String, Object> params) Hookpoint for populating metadata on stripe requests that support it in their params.- Parameters:
stripePaymentRequest
- the request that will be sent to Stripeparams
- The request parameter map- See Also:
-
getCustomMetadata
protected Map<String,String> getCustomMetadata(@NonNull @NonNull StripePaymentRequest stripePaymentRequest) Add the transactionReferenceId to the custom metadata so that we can link Stripe's record of the transaction to our record of the transaction- Parameters:
stripePaymentRequest
- the request that will be sent to Stripe- Returns:
- the map of custom metadata
- See Also:
-
populateCustomerAdditionalAttributes
protected void populateCustomerAdditionalAttributes(@NonNull @NonNull StripePaymentRequest stripePaymentRequest, @NonNull @NonNull Map<String, Object> params) -
isPaymentIntentRequest
- Specified by:
isPaymentIntentRequest
in interfaceStripeExternalCallService
-
buildRequestOptions
protected com.stripe.net.RequestOptions buildRequestOptions(@NonNull @NonNull StripePaymentRequest stripePaymentRequest) Builds aRequestOptions
object including API credentials & an idempotencyKey- Parameters:
stripePaymentRequest
- the request that will be sent to Stripe- Returns:
- the configured request options
-
buildRequestOptionsForUpdatePaymentIntent
protected com.stripe.net.RequestOptions buildRequestOptionsForUpdatePaymentIntent(@NonNull @NonNull StripePaymentRequest stripePaymentRequest) -
buildIdempotencyKey
Builds or gathers the idempotencyKey for the request. This value will guarantee that the request cannot be processed twice & that if the request is made twice, that the second response will be the same as the first response. Note: this value must be unique for eachTransactionType
. For example, if we want to authorize & later capture a Stripe Payment, the capture request's idempotencyKey must be different than the authorization request's idempotencyKey.- Parameters:
stripePaymentRequest
- the request that will be sent to Stripe- Returns:
- the idempotencyKey
-
getStripeAccount
@Nullable protected String getStripeAccount(@NonNull @NonNull StripePaymentRequest stripePaymentRequest) When integrating with Stripe Connect functionality such as for a marketplace implementation, this will retrieve the the Stripe Account ID for the connected account so that it can be added to the request.- Parameters:
stripePaymentRequest
- the request that will be sent to Stripe- Returns:
- the connected Stripe Account ID
-
getFailureReportingThreshold
- Specified by:
getFailureReportingThreshold
in interfacecom.broadleafcommerce.paymentgateway.service.FailureCountExposable
- Specified by:
getFailureReportingThreshold
in classcom.broadleafcommerce.paymentgateway.service.AbstractExternalPaymentGatewayCall<StripePaymentRequest,
com.stripe.model.StripeObject>
-
getServiceName
- Specified by:
getServiceName
in interfacecom.broadleafcommerce.paymentgateway.vendor.service.monitor.ServiceStatusDetectable<T>
-
buildAddressForStripeUser
protected Map<String,Object> buildAddressForStripeUser(@NonNull @NonNull StripePaymentRequest stripePaymentRequest) -
getConfiguration
-
getRestConfigurationProperties
-
getRetryTemplate
protected org.springframework.retry.support.RetryTemplate getRetryTemplate()
-