Wallet
List the saved payment methods of the customer, and add a new one.
Gets the payment methods the signed-in customer saved for one currency. A payment method belongs to a gateway, and a gateway belongs to a currency, so a customer who pays in two currencies has two sets. Needs an authenticated customer.
Method parameters
currencyCodeRequiredstringCurrency to list, such as USD. Take it from
shop.currencies[].abbreviation.
ReturnsPromise<PaymentMethod[]>
The saved payment methods.
List the payment methods
Gets the token a gateway widget needs before it can collect card details. Run it
first, hand the token to the gateway's own SDK, then save what the gateway gives
back with subbly.wallet.store.
Method parameters
payloadRequiredWalletSetupPayloadThe gateway to set up.
ReturnsPromise<WalletSetupResponse>
The token for the gateway widget.
Start a Stripe card setup
Saves a payment source for the customer from the token the gateway widget returned. The saved method can then be set on the cart or on a subscription. Needs an authenticated customer.
Method parameters
payloadRequiredPaymentMethodStorePayloadThe source to save.
ReturnsPromise<PaymentMethod>
The payment method saved.
Save a Stripe card
Gets a Subbly-hosted page where Stripe runs 3-D Secure on a new card. Send the
customer to subblyUrl; Stripe returns them to the redirectUrl you gave.
Needs an authenticated customer.
Method parameters
payloadRequiredWalletSetupIntentPayloadThe gateway to verify with, and where to come back to.
ReturnsPromise<WalletSetupIntentResponse>
Where to send the customer, and how long the link lasts.
Verify a card with 3-D Secure