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 voidaddRawResponse(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, com.stripe.model.StripeError stripeError) buildAddressForStripeUser(@NonNull StripePaymentRequest stripePaymentRequest) protected com.stripe.param.CustomerCreateParams.AddressbuildCustomerAddress(@NonNull StripePaymentRequest stripePaymentRequest) buildCustomerShippingAddress(@NonNull com.broadleafcommerce.paymentgateway.domain.Address<com.broadleafcommerce.paymentgateway.domain.PaymentRequest> shipTo) buildCustomerShippingData(@NonNull StripePaymentRequest stripePaymentRequest) protected StringbuildIdempotencyKey(@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.ShippingbuildPaymentIntentShipping(@NonNull StripePaymentRequest stripePaymentRequest) protected com.stripe.param.PaymentIntentCreateParams.Shipping.AddressbuildPaymentIntentShippingAddress(@NonNull com.broadleafcommerce.paymentgateway.domain.Address<com.broadleafcommerce.paymentgateway.domain.PaymentRequest> shipTo) protected com.stripe.net.RequestOptionsbuildRequestOptions(@NonNull StripePaymentRequest stripePaymentRequest) Builds aRequestOptionsobject including API credentials & an idempotencyKeyprotected com.stripe.net.RequestOptionsbuildRequestOptionsForUpdatePaymentIntent(@NonNull StripePaymentRequest stripePaymentRequest) protected com.stripe.param.CustomerUpdateParams.AddressbuildUpdateCustomerAddressPayload(@NonNull StripePaymentRequest stripePaymentRequest) protected com.stripe.param.CustomerUpdateParams.Shipping.AddressbuildUpdateCustomerShippingAddressPayload(@NonNull com.broadleafcommerce.paymentgateway.domain.Address<com.broadleafcommerce.paymentgateway.domain.PaymentRequest> shipTo) protected com.stripe.param.CustomerUpdateParams.ShippingbuildUpdateCustomerShippingPayload(@NonNull StripePaymentRequest stripePaymentRequest) com.stripe.model.StripeObjectcall(@NonNull StripePaymentRequest paymentRequest) protected com.stripe.model.StripeObjectcaptureCharge(@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.StripeObjectcapturePaymentIntent(@NonNull StripePaymentRequest stripePaymentRequest, @NonNull com.stripe.net.RequestOptions requestOptions) com.stripe.model.StripeObjectcommunicateWithVendor(@NonNull StripePaymentRequest stripePaymentRequest) protected com.stripe.model.StripeObjectcommunicateWithVendorChargesAPI(@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.StripeObjectcommunicateWithVendorCustomerAPI(@NonNull StripePaymentRequest stripePaymentRequest, @NonNull com.stripe.net.RequestOptions requestOptions) protected com.stripe.model.StripeObjectcommunicateWithVendorPaymentIntentsAPI(@NonNull StripePaymentRequest stripePaymentRequest, @NonNull com.stripe.net.RequestOptions requestOptions) protected com.stripe.model.StripeObjectconfirmPaymentIntent(@NonNull StripePaymentRequest stripePaymentRequest, @NonNull com.stripe.net.RequestOptions requestOptions) protected com.stripe.model.StripeObjectconfirmPaymentIntentForAch(@NonNull StripePaymentRequest stripePaymentRequest, @NonNull com.stripe.net.RequestOptions requestOptions) protected com.stripe.model.StripeObjectcreateCharge(@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.StripeObjectcreateChargeFromPaymentIntent(@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.StripeObjectcreateCustomer(@NonNull StripePaymentRequest stripePaymentRequest, @NonNull com.stripe.net.RequestOptions requestOptions) protected com.stripe.model.StripeObjectcreatePaymentIntent(@NonNull StripePaymentRequest stripePaymentRequest, @NonNull com.stripe.net.RequestOptions requestOptions) protected com.stripe.model.StripeObjectdeleteCustomer(@NonNull StripePaymentRequest stripePaymentRequest, @NonNull com.stripe.net.RequestOptions requestOptions) protected StringdetermineCustomerEmail(@NonNull StripePaymentRequest stripePaymentRequest) protected StringdetermineCustomerName(@NonNull StripePaymentRequest stripePaymentRequest) protected StringdetermineCustomerPhone(@NonNull StripePaymentRequest stripePaymentRequest) protected StringdetermineDeclineType(String responseCode) Determine whether the decline code should be considered a hard or soft decline.protected StringdetermineFailureTypeForCardException(com.stripe.exception.CardException cardException) protected LongdetermineLineItemDiscountAmount(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, @NonNull com.broadleafcommerce.paymentgateway.domain.LineItem lineItem) protected StringdetermineLineItemProductCode(@NonNull com.broadleafcommerce.paymentgateway.domain.LineItem lineItem) protected StringdetermineProductDescription(@NonNull com.broadleafcommerce.paymentgateway.domain.LineItem lineItem) javax.money.MonetaryAmountgetAmountInMajorUnits(@NonNull Long amount, @NonNull String currencyCode) protected LonggetAmountInMinorUnits(@NonNull javax.money.MonetaryAmount amount) protected StripeConfigurationgetCustomMetadata(@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 StripeRestConfigurationPropertiesprotected org.springframework.retry.support.RetryTemplateprotected com.stripe.param.PaymentIntentCreateParams.SetupFutureUsagegetSetupFutureUsage(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) protected StringgetShippingCustomerName(@NonNull com.broadleafcommerce.paymentgateway.domain.Address<com.broadleafcommerce.paymentgateway.domain.PaymentRequest> shipTo) protected LonggetShippingTotalInMinorUnits(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) protected StringgetStripeAccount(@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 LonggetSubtotalInMinorUnits(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) protected LonggetTaxTotalInMinorUnits(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) getTransactionTotalInMinorUnits(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) protected com.stripe.model.StripeObjecthandleCustomCustomerOperation(@NonNull StripePaymentRequest stripePaymentRequest, @NonNull com.stripe.net.RequestOptions requestOptions, @NonNull StripeMethodType methodType) protected com.stripe.model.StripeObjecthandleCustomPaymentIntentOperation(@NonNull StripePaymentRequest stripePaymentRequest, @NonNull com.stripe.net.RequestOptions requestOptions, @NonNull StripeMethodType methodType) protected com.stripe.model.StripeObjecthandleCustomVendorChargeOperation(@NonNull StripePaymentRequest stripePaymentRequest, @NonNull com.stripe.net.RequestOptions requestOptions, @NonNull StripeMethodType methodType) protected booleanisAch(@NonNull StripePaymentRequest stripePaymentRequest) protected booleanisACHPaymentRequest(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) protected booleanisInvalidPaymentMethodFailureType(String declineCode) protected booleanisLevel3DataEnabled(@NonNull StripePaymentRequest stripePaymentRequest) booleanisPaymentIntentRequest(@NonNull StripePaymentRequest stripePaymentRequest) protected booleanisStripeCustomerRequest(@NonNull StripeMethodType stripeMethodType) protected Stringprotected voidpopulateCustomCaptureChargeParams(Map<String, Object> params, @NonNull StripePaymentRequest stripePaymentRequest) protected voidpopulateCustomCaptureIntentParams(Map<String, Object> params, @NonNull StripePaymentRequest stripePaymentRequest) populateCustomConfirmIntentParams(Map<String, Object> params, @NonNull StripePaymentRequest stripePaymentRequest) protected voidpopulateCustomCreateChargeFromIntentParams(Map<String, Object> params, @NonNull StripePaymentRequest stripePaymentRequest) protected voidpopulateCustomCreateChargeParams(Map<String, Object> params, @NonNull StripePaymentRequest stripePaymentRequest) protected voidpopulateCustomerAdditionalAttributes(@NonNull StripePaymentRequest stripePaymentRequest, @NonNull Map<String, Object> params) populateCustomerMetadata(@NonNull StripePaymentRequest stripePaymentRequest) protected voidpopulateCustomMetadata(@NonNull StripePaymentRequest stripePaymentRequest, @NonNull Map<String, Object> params) Hookpoint for populating metadata on stripe requests that support it in their params.protected voidpopulateCustomRefundChargeParams(Map<String, Object> params, @NonNull StripePaymentRequest stripePaymentRequest) protected voidpopulateCustomRefundIntentParams(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.PaymentIntentCreateParamspopulatePaymentIntentCreateParams(@NonNull StripePaymentRequest stripePaymentRequest, @NonNull String paymentMethodId) voidprocessStripeException(@NonNull Exception e, @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) protected com.stripe.model.StripeObjectrefundCharge(@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.StripeObjectrefundPaymentIntent(@NonNull StripePaymentRequest stripePaymentRequest, @NonNull com.stripe.net.RequestOptions requestOptions) protected com.stripe.model.StripeObjectretrievePaymentIntent(@NonNull StripePaymentRequest stripePaymentRequest, @NonNull com.stripe.net.RequestOptions requestOptions) protected com.stripe.model.StripeObjectupdateCustomer(@NonNull StripePaymentRequest stripePaymentRequest, @NonNull com.stripe.net.RequestOptions requestOptions) protected com.stripe.model.PaymentIntentupdatePaymentIntent(@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:
callin interfaceStripeExternalCallService
-
communicateWithVendor
public com.stripe.model.StripeObject communicateWithVendor(@NonNull @NonNull StripePaymentRequest stripePaymentRequest) throws Exception - Specified by:
communicateWithVendorin 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:
getTransactionTotalInMinorUnitsin 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:
getAmountInMajorUnitsin 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:
processStripeExceptionin 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:
isPaymentIntentRequestin interfaceStripeExternalCallService
-
buildRequestOptions
protected com.stripe.net.RequestOptions buildRequestOptions(@NonNull @NonNull StripePaymentRequest stripePaymentRequest) Builds aRequestOptionsobject 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:
getFailureReportingThresholdin interfacecom.broadleafcommerce.paymentgateway.service.FailureCountExposable- Specified by:
getFailureReportingThresholdin classcom.broadleafcommerce.paymentgateway.service.AbstractExternalPaymentGatewayCall<StripePaymentRequest,com.stripe.model.StripeObject>
-
getServiceName
- Specified by:
getServiceNamein 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()
-