Class DefaultStripeTransactionService
java.lang.Object
com.broadleafcommerce.payment.service.gateway.DefaultStripeTransactionService
- All Implemented Interfaces:
StripeTransactionService
,com.broadleafcommerce.paymentgateway.service.PaymentGatewayTransactionService
,com.broadleafcommerce.paymentgateway.service.PaymentGatewayTypeAware
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addRawResponse
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, @NonNull Object response) com.broadleafcommerce.paymentgateway.domain.PaymentResponse
authorize
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) com.broadleafcommerce.paymentgateway.domain.PaymentResponse
authorizeAndCapture
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) protected com.broadleafcommerce.paymentgateway.domain.NextAction
buildNextAction
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, @NonNull com.stripe.model.PaymentIntent paymentIntent) protected String
buildRedirectUrl
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, @NonNull com.stripe.model.PaymentIntent paymentIntent, @NonNull String customMicroDepositVerificationURL) com.broadleafcommerce.paymentgateway.domain.PaymentResponse
capture
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) protected String
determineRecommendedSavedPaymentMethodStatus
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse) Returns the recommended saved payment method status if it should be created.protected com.broadleafcommerce.paymentgateway.domain.PaymentResponse
doAuthAndOrCapture
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, boolean capture) protected com.broadleafcommerce.paymentgateway.domain.PaymentResponse
doAuthAndOrCaptureForAch
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) protected void
fillResponse
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, com.stripe.model.PaymentIntent paymentIntent) Deprecated.protected void
fillResponse
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, com.stripe.model.PaymentIntent paymentIntent, String stripeMethodType) Populates thePaymentResponse
based on the providedPaymentIntent
See the following for all possible values of Stripe's Payment Intent statuses: https://stripe.com/docs/payments/payment-intents/statusprotected void
fillResponse
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, com.stripe.model.Charge charge) Deprecated.in favor offillResponse(PaymentResponse, Charge, String)
protected void
fillResponse
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, com.stripe.model.Charge charge, String stripeMethodType) Populates thePaymentResponse
based on the providedCharge
protected void
fillResponse
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, com.stripe.model.Refund refund) Deprecated.in favor offillResponse(PaymentResponse, Refund, String)
protected void
fillResponse
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, com.stripe.model.Refund refund, String stripeMethodType) protected StripeConfigurationProperties
protected StripeCustomerNotificationService
protected String
getCustomMicroDepositVerificationURL
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, @NonNull com.stripe.model.PaymentIntent paymentIntent) protected String
getGatewayTransactionId
(@NonNull com.stripe.model.StripeObject stripeObject) protected String
getHostedVerificationUrl
(@NonNull com.stripe.model.PaymentIntent paymentIntent) protected String
getMicroDepositType
(@NonNull com.stripe.model.PaymentIntent paymentIntent) protected PaymentIntentAccessTokenService
getPaymentMethodPropertiesForFutureUse
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, @NonNull com.stripe.model.PaymentIntent paymentIntent) protected com.broadleafcommerce.paymentgateway.util.PaymentResponseUtil
protected String
getRequestId
(@NonNull com.stripe.model.Charge charge) Deprecated, for removal: This API element is subject to removal in a future version.usegetGatewayTransactionId(com.stripe.model.StripeObject)
instead of thisprotected String
getResponseCode
(@NonNull com.stripe.model.PaymentIntent paymentIntent) protected StripeExternalCallService
protected com.broadleafcommerce.common.extension.TypeFactory
protected void
handlePaymentIntentErrors
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, @NonNull com.stripe.model.PaymentIntent paymentIntent) protected void
handlePaymentIntentProcessingStatus
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, @NonNull com.stripe.model.PaymentIntent paymentIntent, String stripeMethodType) protected void
handlePaymentIntentRequiresAction
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, @NonNull com.stripe.model.PaymentIntent paymentIntent) protected void
handlePaymentIntentRequiresPaymentMethod
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, @NonNull com.stripe.model.PaymentIntent paymentIntent) protected String
identifyFailureType
(com.stripe.model.StripeError stripePaymentError, String transactionReferenceId) protected boolean
isACHPaymentRequest
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) protected Boolean
isFlaggedForManualReview
(@NonNull com.stripe.model.PaymentIntent paymentIntent) Determines whether the payment transaction has been flagged for manual review.protected com.broadleafcommerce.paymentgateway.domain.PaymentResponse
populateMicroDepositVerificationDetails
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, @NonNull com.stripe.model.PaymentIntent paymentIntent, String stripeMethodType) com.broadleafcommerce.paymentgateway.domain.PaymentResponse
refund
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) protected boolean
requiresMicroDepositVerification
(@NonNull com.stripe.model.PaymentIntent paymentIntent) com.broadleafcommerce.paymentgateway.domain.PaymentResponse
reverseAuthorize
(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) void
setConfigProperties
(StripeConfigurationProperties configProperties) void
setCustomerNotificationService
(StripeCustomerNotificationService customerNotificationService) void
setPaymentIntentAccessTokenService
(PaymentIntentAccessTokenService paymentIntentAccessTokenService) void
setPaymentResponseUtil
(com.broadleafcommerce.paymentgateway.util.PaymentResponseUtil paymentResponseUtil) void
setTypeFactory
(com.broadleafcommerce.common.extension.TypeFactory typeFactory) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.broadleafcommerce.paymentgateway.service.PaymentGatewayTransactionService
detachedCredit, identifyParentTransactionReferenceIfExists, identifyTransactionReferenceIdOverrideForInitialTransaction, identifyTransactionTypeFromTransactionResults
-
Field Details
-
REDIRECT_URL_PAYMENT_INTENT_ID_PARAM
- See Also:
-
REDIRECT_URL_PAYMENT_INTENT_ACCESS_TOKEN_PARAM
- See Also:
-
-
Constructor Details
-
DefaultStripeTransactionService
-
-
Method Details
-
authorize
public com.broadleafcommerce.paymentgateway.domain.PaymentResponse authorize(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) - Specified by:
authorize
in interfacecom.broadleafcommerce.paymentgateway.service.PaymentGatewayTransactionService
-
capture
public com.broadleafcommerce.paymentgateway.domain.PaymentResponse capture(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) - Specified by:
capture
in interfacecom.broadleafcommerce.paymentgateway.service.PaymentGatewayTransactionService
-
authorizeAndCapture
public com.broadleafcommerce.paymentgateway.domain.PaymentResponse authorizeAndCapture(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) - Specified by:
authorizeAndCapture
in interfacecom.broadleafcommerce.paymentgateway.service.PaymentGatewayTransactionService
-
isACHPaymentRequest
protected boolean isACHPaymentRequest(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) -
doAuthAndOrCaptureForAch
protected com.broadleafcommerce.paymentgateway.domain.PaymentResponse doAuthAndOrCaptureForAch(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) -
doAuthAndOrCapture
protected com.broadleafcommerce.paymentgateway.domain.PaymentResponse doAuthAndOrCapture(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, boolean capture) -
reverseAuthorize
public com.broadleafcommerce.paymentgateway.domain.PaymentResponse reverseAuthorize(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) - Specified by:
reverseAuthorize
in interfacecom.broadleafcommerce.paymentgateway.service.PaymentGatewayTransactionService
-
refund
public com.broadleafcommerce.paymentgateway.domain.PaymentResponse refund(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) - Specified by:
refund
in interfacecom.broadleafcommerce.paymentgateway.service.PaymentGatewayTransactionService
-
fillResponse
@Deprecated protected void fillResponse(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, com.stripe.model.Charge charge) Deprecated.in favor offillResponse(PaymentResponse, Charge, String)
-
fillResponse
protected void fillResponse(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, com.stripe.model.Charge charge, @Nullable String stripeMethodType) Populates thePaymentResponse
based on the providedCharge
- Parameters:
paymentResponse
- the response object that should be populated & which will be returned from this service's public methodscharge
- the Stripe API's returned object that hold the results of the transaction
-
fillResponse
@Deprecated protected void fillResponse(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, com.stripe.model.Refund refund) Deprecated.in favor offillResponse(PaymentResponse, Refund, String)
-
fillResponse
protected void fillResponse(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, com.stripe.model.Refund refund, @Nullable String stripeMethodType) -
fillResponse
@Deprecated protected void fillResponse(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, com.stripe.model.PaymentIntent paymentIntent) throws StripePaymentIntentRequiresActionException Deprecated. -
fillResponse
protected void fillResponse(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, com.stripe.model.PaymentIntent paymentIntent, @Nullable String stripeMethodType) throws StripePaymentIntentRequiresActionException Populates thePaymentResponse
based on the providedPaymentIntent
See the following for all possible values of Stripe's Payment Intent statuses: https://stripe.com/docs/payments/payment-intents/status- Parameters:
paymentRequest
- the request object whose data was sent to Stripe for this transactionpaymentResponse
- the response object that should be populated & which will be returned from this service's public methodspaymentIntent
- the Stripe API's returned object that hold the results of the transaction- Throws:
StripePaymentIntentRequiresActionException
-
handlePaymentIntentProcessingStatus
protected void handlePaymentIntentProcessingStatus(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, @NonNull @NonNull com.stripe.model.PaymentIntent paymentIntent, @Nullable String stripeMethodType) -
isFlaggedForManualReview
@Nullable protected Boolean isFlaggedForManualReview(@NonNull @NonNull com.stripe.model.PaymentIntent paymentIntent) Determines whether the payment transaction has been flagged for manual review.- See Also:
-
Review.getOpen()
-
getPaymentMethodPropertiesForFutureUse
-
addRawResponse
protected void addRawResponse(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, @NonNull @NonNull Object response) -
handlePaymentIntentRequiresAction
protected void handlePaymentIntentRequiresAction(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, @NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, @NonNull @NonNull com.stripe.model.PaymentIntent paymentIntent) throws StripePaymentIntentRequiresActionException -
handlePaymentIntentRequiresPaymentMethod
protected void handlePaymentIntentRequiresPaymentMethod(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, @NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, @NonNull @NonNull com.stripe.model.PaymentIntent paymentIntent) throws StripePaymentIntentRequiresPaymentMethodException -
handlePaymentIntentErrors
protected void handlePaymentIntentErrors(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, @NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, @NonNull @NonNull com.stripe.model.PaymentIntent paymentIntent) -
identifyFailureType
-
getGatewayTransactionId
@Nullable protected String getGatewayTransactionId(@NonNull @NonNull com.stripe.model.StripeObject stripeObject) -
getRequestId
@Deprecated(forRemoval=true) @Nullable protected String getRequestId(@NonNull @NonNull com.stripe.model.Charge charge) Deprecated, for removal: This API element is subject to removal in a future version.usegetGatewayTransactionId(com.stripe.model.StripeObject)
instead of this -
getResponseCode
@Nullable protected String getResponseCode(@NonNull @NonNull com.stripe.model.PaymentIntent paymentIntent) -
requiresMicroDepositVerification
protected boolean requiresMicroDepositVerification(@NonNull @NonNull com.stripe.model.PaymentIntent paymentIntent) -
populateMicroDepositVerificationDetails
protected com.broadleafcommerce.paymentgateway.domain.PaymentResponse populateMicroDepositVerificationDetails(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, @NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, @NonNull @NonNull com.stripe.model.PaymentIntent paymentIntent, @Nullable String stripeMethodType) -
buildNextAction
protected com.broadleafcommerce.paymentgateway.domain.NextAction buildNextAction(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, @NonNull @NonNull com.stripe.model.PaymentIntent paymentIntent) -
getCustomMicroDepositVerificationURL
@Nullable protected String getCustomMicroDepositVerificationURL(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, @NonNull @NonNull com.stripe.model.PaymentIntent paymentIntent) -
buildRedirectUrl
-
getHostedVerificationUrl
@Nullable protected String getHostedVerificationUrl(@NonNull @NonNull com.stripe.model.PaymentIntent paymentIntent) -
getMicroDepositType
@Nullable protected String getMicroDepositType(@NonNull @NonNull com.stripe.model.PaymentIntent paymentIntent) -
determineRecommendedSavedPaymentMethodStatus
@Nullable protected String determineRecommendedSavedPaymentMethodStatus(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, @NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse) Returns the recommended saved payment method status if it should be created.- Returns:
DefaultSavedPaymentMethodStatuses.INVALID_PAYMENT_METHOD
if the transaction's failure type isDefaultSavedPaymentMethodStatuses.INVALID_PAYMENT_METHOD
.DefaultSavedPaymentMethodStatuses.AWAITING_ASYNC_RESULTS
if the transaction succeeds but awaiting an asynchronous result
-
getGatewayType
- Specified by:
getGatewayType
in interfacecom.broadleafcommerce.paymentgateway.service.PaymentGatewayTypeAware
-
getStripeService
-
getPaymentResponseUtil
protected com.broadleafcommerce.paymentgateway.util.PaymentResponseUtil getPaymentResponseUtil() -
setPaymentResponseUtil
@Autowired public void setPaymentResponseUtil(com.broadleafcommerce.paymentgateway.util.PaymentResponseUtil paymentResponseUtil) -
getConfigProperties
-
setConfigProperties
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory() -
setTypeFactory
@Autowired public void setTypeFactory(com.broadleafcommerce.common.extension.TypeFactory typeFactory) -
getPaymentIntentAccessTokenService
-
setPaymentIntentAccessTokenService
@Autowired public void setPaymentIntentAccessTokenService(PaymentIntentAccessTokenService paymentIntentAccessTokenService) -
getCustomerNotificationService
-
setCustomerNotificationService
@Autowired public void setCustomerNotificationService(StripeCustomerNotificationService customerNotificationService)
-
fillResponse(PaymentRequest, PaymentResponse, PaymentIntent, String)