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 voidaddRawResponse(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, @NonNull Object response) com.broadleafcommerce.paymentgateway.domain.PaymentResponseauthorize(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) com.broadleafcommerce.paymentgateway.domain.PaymentResponseauthorizeAndCapture(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) protected com.broadleafcommerce.paymentgateway.domain.NextActionbuildNextAction(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, @NonNull com.stripe.model.PaymentIntent paymentIntent) protected StringbuildRedirectUrl(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, @NonNull com.stripe.model.PaymentIntent paymentIntent, @NonNull String customMicroDepositVerificationURL) com.broadleafcommerce.paymentgateway.domain.PaymentResponsecapture(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) protected StringdetermineRecommendedSavedPaymentMethodStatus(@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.PaymentResponsedoAuthAndOrCapture(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, boolean capture) protected com.broadleafcommerce.paymentgateway.domain.PaymentResponsedoAuthAndOrCaptureForAch(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) protected voidfillResponse(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, com.stripe.model.PaymentIntent paymentIntent) Deprecated.protected voidfillResponse(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, com.stripe.model.PaymentIntent paymentIntent, String stripeMethodType) Populates thePaymentResponsebased on the providedPaymentIntentSee the following for all possible values of Stripe's Payment Intent statuses: https://stripe.com/docs/payments/payment-intents/statusprotected voidfillResponse(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, com.stripe.model.Charge charge) Deprecated.in favor offillResponse(PaymentResponse, Charge, String)protected voidfillResponse(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, com.stripe.model.Charge charge, String stripeMethodType) Populates thePaymentResponsebased on the providedChargeprotected voidfillResponse(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, com.stripe.model.Refund refund) Deprecated.in favor offillResponse(PaymentResponse, Refund, String)protected voidfillResponse(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, com.stripe.model.Refund refund, String stripeMethodType) protected StripeConfigurationPropertiesprotected StripeCustomerNotificationServiceprotected StringgetCustomMicroDepositVerificationURL(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, @NonNull com.stripe.model.PaymentIntent paymentIntent) protected StringgetGatewayTransactionId(@NonNull com.stripe.model.StripeObject stripeObject) protected StringgetHostedVerificationUrl(@NonNull com.stripe.model.PaymentIntent paymentIntent) protected StringgetMicroDepositType(@NonNull com.stripe.model.PaymentIntent paymentIntent) protected PaymentIntentAccessTokenServicegetPaymentMethodPropertiesForFutureUse(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, @NonNull com.stripe.model.PaymentIntent paymentIntent) protected com.broadleafcommerce.paymentgateway.util.PaymentResponseUtilprotected StringgetRequestId(@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 StringgetResponseCode(@NonNull com.stripe.model.PaymentIntent paymentIntent) protected StripeExternalCallServiceprotected com.broadleafcommerce.common.extension.TypeFactoryprotected voidhandlePaymentIntentErrors(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, @NonNull com.stripe.model.PaymentIntent paymentIntent) protected voidhandlePaymentIntentProcessingStatus(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, @NonNull com.stripe.model.PaymentIntent paymentIntent, String stripeMethodType) protected voidhandlePaymentIntentRequiresAction(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, @NonNull com.stripe.model.PaymentIntent paymentIntent) protected voidhandlePaymentIntentRequiresPaymentMethod(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest, @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentResponse paymentResponse, @NonNull com.stripe.model.PaymentIntent paymentIntent) protected StringidentifyFailureType(com.stripe.model.StripeError stripePaymentError, String transactionReferenceId) protected booleanisACHPaymentRequest(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) protected BooleanisFlaggedForManualReview(@NonNull com.stripe.model.PaymentIntent paymentIntent) Determines whether the payment transaction has been flagged for manual review.protected com.broadleafcommerce.paymentgateway.domain.PaymentResponsepopulateMicroDepositVerificationDetails(@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.PaymentResponserefund(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) protected booleanrequiresMicroDepositVerification(@NonNull com.stripe.model.PaymentIntent paymentIntent) com.broadleafcommerce.paymentgateway.domain.PaymentResponsereverseAuthorize(@NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) voidsetConfigProperties(StripeConfigurationProperties configProperties) voidsetCustomerNotificationService(StripeCustomerNotificationService customerNotificationService) voidsetPaymentIntentAccessTokenService(PaymentIntentAccessTokenService paymentIntentAccessTokenService) voidsetPaymentResponseUtil(com.broadleafcommerce.paymentgateway.util.PaymentResponseUtil paymentResponseUtil) voidsetTypeFactory(com.broadleafcommerce.common.extension.TypeFactory typeFactory) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
authorizein interfacecom.broadleafcommerce.paymentgateway.service.PaymentGatewayTransactionService
-
capture
public com.broadleafcommerce.paymentgateway.domain.PaymentResponse capture(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) - Specified by:
capturein interfacecom.broadleafcommerce.paymentgateway.service.PaymentGatewayTransactionService
-
authorizeAndCapture
public com.broadleafcommerce.paymentgateway.domain.PaymentResponse authorizeAndCapture(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) - Specified by:
authorizeAndCapturein 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:
reverseAuthorizein interfacecom.broadleafcommerce.paymentgateway.service.PaymentGatewayTransactionService
-
refund
public com.broadleafcommerce.paymentgateway.domain.PaymentResponse refund(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.PaymentRequest paymentRequest) - Specified by:
refundin 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 thePaymentResponsebased 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 thePaymentResponsebased on the providedPaymentIntentSee 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_METHODif the transaction's failure type isDefaultSavedPaymentMethodStatuses.INVALID_PAYMENT_METHOD.DefaultSavedPaymentMethodStatuses.AWAITING_ASYNC_RESULTSif the transaction succeeds but awaiting an asynchronous result
-
getGatewayType
- Specified by:
getGatewayTypein 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)