PaymentMethods
Methods for handling Payment Methods.
listPaymentMethods v1.0.0 read payment methods Types
Get a paginated list of paymentMethods for the store.
- ESM
- UMD
import { listPaymentMethods } from '@rechargeapps/storefront-client';
await listPaymentMethods(session, {
limit: 25,
});
await recharge.paymentMethod.listPaymentMethods(session, {
limit: 25,
});
getPaymentMethod v1.0.0 read payment methods Types
Get a Payment Method.
- ESM
- UMD
import { getPaymentMethod } from '@rechargeapps/storefront-client';
await getPaymentMethod(session, 123);
await recharge.paymentMethod.getPaymentMethod(session, 123);
createPaymentMethod v1.12.0 write payment methods Types
Create a Payment Method.
Currently, shopify_payments
is in read-only mode and can only be managed by Shopify.
- ESM
- UMD
import { createPaymentMethod } from '@rechargeapps/storefront-client';
await createPaymentMethod(session, {
default: true,
payment_type: 'CREDIT_CARD',
processor_customer_token: 'cus_JGYtLWi2HS8ymD',
processor_name: 'stripe',
processor_payment_method_token: 'pm_34jdshjs',
});
await recharge.paymentMethod.createPaymentMethod(session, {
default: true,
payment_type: 'CREDIT_CARD',
processor_customer_token: 'cus_JGYtLWi2HS8ymD',
processor_name: 'stripe',
processor_payment_method_token: 'pm_34jdshjs',
});
updatePaymentMethod v1.0.0 write payment methods Types
Update a Payment Method.
Currently, shopify_payments
is in read-only mode and can only be managed by Shopify.
If using shopify_payments
you can notify a customer to update their payment method via sendCustomerNotification, which allows you to send a link to the customer so they can update a specific payment method.
- ESM
- UMD
import { updatePaymentMethod } from '@rechargeapps/storefront-client';
await updatePaymentMethod(session, 123, { default: true });
await recharge.paymentMethod.updatePaymentMethod(session, 123, { default: true });