Class DefaultStripeSetupIntentService
java.lang.Object
com.broadleafcommerce.vendor.stripe.service.setupintent.DefaultStripeSetupIntentService
- All Implemented Interfaces:
StripeSetupIntentService
The default implementation for
StripeSetupIntentService
.- Author:
- Dima Myroniuk (dmyroniuk)
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefaultStripeSetupIntentService
(StripeExternalCallService stripeService, StripeRestConfigurationProperties restConfigurationProperties) -
Method Summary
Modifier and TypeMethodDescriptionprotected com.stripe.param.SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections
buildFinancialConnections
(@NonNull SetupIntentRequest request) buildMetadata
(@NonNull SetupIntentRequest request) protected com.stripe.net.RequestOptions
buildRequestOptions
(@NonNull SetupIntentRequest request) protected com.stripe.net.RequestOptions
buildRequestOptions
(String applicationId, String tenantId) protected com.stripe.param.SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount
buildUsBankAccountOptions
(@NonNull SetupIntentRequest request) protected com.stripe.model.Customer
createCustomer
(@NonNull SetupIntentRequest request) createSetupIntent
(@NonNull SetupIntentRequest request) Creates a SetupIntent object for the provided request.protected StripeRestConfigurationProperties
protected com.stripe.param.SetupIntentCreateParams
getSetupIntentCreateParams
(@NonNull SetupIntentRequest request) getSetupIntentInfo
(@NonNull ReadSetupIntentRequest request) Gets aSetupIntent
info for the specified id.protected StripeExternalCallService
protected com.stripe.param.SetupIntentCreateParams.Usage
getUsage
(@NonNull SetupIntentRequest request) protected void
populateAdditionalParameters
(com.stripe.param.SetupIntentCreateParams.Builder paramsBuilder, @NonNull SetupIntentRequest request) protected com.broadleafcommerce.paymentgateway.domain.GatewayCustomer<com.broadleafcommerce.paymentgateway.domain.PaymentRequest>
populateCustomer
(@NonNull com.broadleafcommerce.paymentgateway.domain.GatewayCustomer<com.broadleafcommerce.paymentgateway.domain.PaymentRequest> customer, @NonNull SetupIntentRequest request) protected com.broadleafcommerce.paymentgateway.domain.GatewayCustomer<com.broadleafcommerce.paymentgateway.domain.PaymentRequest>
populateCustomerName
(@NonNull com.broadleafcommerce.paymentgateway.domain.GatewayCustomer<com.broadleafcommerce.paymentgateway.domain.PaymentRequest> customer, @NonNull SetupIntentRequest request) protected SetupIntentResponse
populateSetupIntentResponse
(@NonNull com.stripe.model.SetupIntent setupIntent) protected void
validateSetupIntentRequest
(@NonNull SetupIntentRequest request)
-
Field Details
-
US_BANK_ACCOUNT
- See Also:
-
-
Constructor Details
-
DefaultStripeSetupIntentService
public DefaultStripeSetupIntentService(StripeExternalCallService stripeService, StripeRestConfigurationProperties restConfigurationProperties)
-
-
Method Details
-
createSetupIntent
Description copied from interface:StripeSetupIntentService
Creates a SetupIntent object for the provided request. It can be used to attach a payment method and confirm to collect any required permissions to charge the payment method later.If the
SetupIntentRequest.getStripeCustomerId()
is not provided the newCustomer
will be created.This method supports creating the SetupIntent for the "us_bank_account" payment method type (ACH). To specify this type add
PAYMENT_METHOD_TYPE
to theSetupIntentRequest.additionalFields
with "us_bank_account" value.- Specified by:
createSetupIntent
in interfaceStripeSetupIntentService
- Parameters:
request
- the request to create theSetupIntent
- Returns:
- the response that contains the
SetupIntent.getClientSecret()
and theCustomer
ID for which this intent was created
-
getSetupIntentInfo
Description copied from interface:StripeSetupIntentService
Gets aSetupIntent
info for the specified id.- Specified by:
getSetupIntentInfo
in interfaceStripeSetupIntentService
- Parameters:
request
- the request to read the SetupIntent- Returns:
- the SetupIntent info for the specified id
-
validateSetupIntentRequest
-
getSetupIntentCreateParams
protected com.stripe.param.SetupIntentCreateParams getSetupIntentCreateParams(@NonNull @NonNull SetupIntentRequest request) throws com.stripe.exception.StripeException - Throws:
com.stripe.exception.StripeException
-
buildMetadata
-
populateAdditionalParameters
protected void populateAdditionalParameters(@NonNull com.stripe.param.SetupIntentCreateParams.Builder paramsBuilder, @NonNull @NonNull SetupIntentRequest request) -
buildUsBankAccountOptions
protected com.stripe.param.SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount buildUsBankAccountOptions(@NonNull @NonNull SetupIntentRequest request) -
buildFinancialConnections
protected com.stripe.param.SetupIntentCreateParams.PaymentMethodOptions.UsBankAccount.FinancialConnections buildFinancialConnections(@NonNull @NonNull SetupIntentRequest request) -
createCustomer
-
getUsage
protected com.stripe.param.SetupIntentCreateParams.Usage getUsage(@NonNull @NonNull SetupIntentRequest request) -
populateCustomer
protected com.broadleafcommerce.paymentgateway.domain.GatewayCustomer<com.broadleafcommerce.paymentgateway.domain.PaymentRequest> populateCustomer(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.GatewayCustomer<com.broadleafcommerce.paymentgateway.domain.PaymentRequest> customer, @NonNull @NonNull SetupIntentRequest request) -
populateCustomerName
protected com.broadleafcommerce.paymentgateway.domain.GatewayCustomer<com.broadleafcommerce.paymentgateway.domain.PaymentRequest> populateCustomerName(@NonNull @NonNull com.broadleafcommerce.paymentgateway.domain.GatewayCustomer<com.broadleafcommerce.paymentgateway.domain.PaymentRequest> customer, @NonNull @NonNull SetupIntentRequest request) -
buildRequestOptions
protected com.stripe.net.RequestOptions buildRequestOptions(@NonNull @NonNull SetupIntentRequest request) -
buildRequestOptions
-
populateSetupIntentResponse
protected SetupIntentResponse populateSetupIntentResponse(@NonNull @NonNull com.stripe.model.SetupIntent setupIntent) -
getStripeService
-
getRestConfigurationProperties
-