interface CustomerAdapter {
    fetchPaymentMethods(): Promise<object[]>;
    attachPaymentMethod(paymentMethodId: string): Promise<object>;
    detachPaymentMethod(paymentMethodId: String): Promise<object>;
    setSelectedPaymentOption(paymentOption: null | string): Promise<void>;
    fetchSelectedPaymentOption(): Promise<null | string>;
    setupIntentClientSecretForCustomerAttach(): Promise<string>;
}

Methods

  • Retrieves a list of Payment Methods attached to a customer. If you are implementing your own CustomerAdapter: Call the list method ( https://stripe.com/docs/api/payment_methods/list ) with the Stripe customer. Return the list of payment methods in JSON format.

    Returns Promise<object[]>

  • Adds a Payment Method to a customer. If you are implementing your own CustomerAdapter: On your backend, retrieve the Stripe customer associated with your logged-in user. Then, call the Attach method on the Payment Method with that customer's ID ( https://stripe.com/docs/api/payment_methods/attach ).

    • Parameters:
      • paymentMethod: A valid Stripe Payment Method ID Return the payment method in JSON format.

    Parameters

    • paymentMethodId: string

    Returns Promise<object>

  • Deletes the given Payment Method from the customer. If you are implementing your own CustomerAdapter: Call the Detach method ( https://stripe.com/docs/api/payment_methods/detach ) on the Payment Method.

    • Parameters:
      • paymentMethod: The Stripe Payment Method ID to delete from the customer Return the payment method in JSON format.

    Parameters

    • paymentMethodId: String

    Returns Promise<object>

  • Set the last selected payment method for the customer. To unset the default payment method, null is passed as the paymentOption. If you are implementing your own CustomerAdapter: Save a representation of the passed paymentOption as the customer's default payment method.

    Parameters

    • paymentOption: null | string

    Returns Promise<void>

  • Retrieve the last selected payment method for the customer. If you are implementing your own CustomerAdapter: Return a CustomerPaymentOption for the customer's default selected payment method. If no default payment method is selected, return null.

    Returns Promise<null | string>

  • Creates a SetupIntent configured to attach a new payment method to a customer, then returns the client secret for the created SetupIntent.

    Returns Promise<string>

MMNEPVFCICPMFPCPTTAAATR