Class DefaultStripeSetupIntentService

java.lang.Object
com.broadleafcommerce.vendor.stripe.service.setupintent.DefaultStripeSetupIntentService
All Implemented Interfaces:
StripeSetupIntentService

public class DefaultStripeSetupIntentService extends Object implements StripeSetupIntentService
The default implementation for StripeSetupIntentService.
Author:
Dima Myroniuk (dmyroniuk)
  • Field Details

  • Constructor Details

  • Method Details

    • createSetupIntent

      public SetupIntentResponse createSetupIntent(@NonNull @NonNull SetupIntentRequest request)
      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 new Customer 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 the SetupIntentRequest.additionalFields with "us_bank_account" value.

      Specified by:
      createSetupIntent in interface StripeSetupIntentService
      Parameters:
      request - the request to create the SetupIntent
      Returns:
      the response that contains the SetupIntent.getClientSecret() and the Customer ID for which this intent was created
    • getSetupIntentInfo

      public SetupIntentResponse getSetupIntentInfo(@NonNull @NonNull ReadSetupIntentRequest request)
      Description copied from interface: StripeSetupIntentService
      Gets a SetupIntent info for the specified id.
      Specified by:
      getSetupIntentInfo in interface StripeSetupIntentService
      Parameters:
      request - the request to read the SetupIntent
      Returns:
      the SetupIntent info for the specified id
    • validateSetupIntentRequest

      protected void validateSetupIntentRequest(@NonNull @NonNull SetupIntentRequest request)
    • getSetupIntentCreateParams

      protected com.stripe.param.SetupIntentCreateParams getSetupIntentCreateParams(@NonNull @NonNull SetupIntentRequest request) throws com.stripe.exception.StripeException
      Throws:
      com.stripe.exception.StripeException
    • buildMetadata

      protected Map<String,String> buildMetadata(@NonNull @NonNull SetupIntentRequest request)
    • 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

      protected com.stripe.model.Customer createCustomer(@NonNull @NonNull SetupIntentRequest request)
    • 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

      protected com.stripe.net.RequestOptions buildRequestOptions(@Nullable String applicationId, @Nullable String tenantId)
    • populateSetupIntentResponse

      protected SetupIntentResponse populateSetupIntentResponse(@NonNull @NonNull com.stripe.model.SetupIntent setupIntent)
    • getStripeService

      protected StripeExternalCallService getStripeService()
    • getRestConfigurationProperties

      protected StripeRestConfigurationProperties getRestConfigurationProperties()