Skip to main content

PaymentMethods

Methods for handling Payment Methods.

listPaymentMethods v1.0.0 read payment methods Types

Get a paginated list of paymentMethods for the store.

import { listPaymentMethods } from '@rechargeapps/storefront-client';
await listPaymentMethods(session, {
limit: 25,
});

getPaymentMethod v1.0.0 read payment methods Types

Get a Payment Method.

import { getPaymentMethod } from '@rechargeapps/storefront-client';
await 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.

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',
});

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.

import { updatePaymentMethod } from '@rechargeapps/storefront-client';
await updatePaymentMethod(session, 123, { default: true });