(paymentMethods)
- list - Retrieve a list of payment methods associated with a Moov account. Read our payment methods guide to learn more.
To access this endpoint using an access token
you'll need to specify the /accounts/{accountID}/payment-methods.read
scope.
- get - Get the specified payment method associated with a Moov account. Read our payment methods guide to learn more.
To access this endpoint using an access token
you'll need to specify the /accounts/{accountID}/payment-methods.read
scope.
Retrieve a list of payment methods associated with a Moov account. Read our payment methods guide to learn more.
To access this endpoint using an access token
you'll need to specify the /accounts/{accountID}/payment-methods.read
scope.
import { Moov } from "@moovio/sdk";
const moov = new Moov({
security: {
username: "",
password: "",
},
});
async function run() {
const result = await moov.paymentMethods.list({
accountID: "c8a232aa-0b11-4b8a-b005-71e9e705d0e6",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { MoovCore } from "@moovio/sdk/core.js";
import { paymentMethodsList } from "@moovio/sdk/funcs/paymentMethodsList.js";
// Use `MoovCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const moov = new MoovCore({
security: {
username: "",
password: "",
},
});
async function run() {
const res = await paymentMethodsList(moov, {
accountID: "c8a232aa-0b11-4b8a-b005-71e9e705d0e6",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.ListPaymentMethodsRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.ListPaymentMethodsResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.APIError | 4XX, 5XX | */* |
Get the specified payment method associated with a Moov account. Read our payment methods guide to learn more.
To access this endpoint using an access token
you'll need to specify the /accounts/{accountID}/payment-methods.read
scope.
import { Moov } from "@moovio/sdk";
const moov = new Moov({
security: {
username: "",
password: "",
},
});
async function run() {
const result = await moov.paymentMethods.get({
accountID: "b888f774-3e7c-4135-a18c-6b985523c4bc",
paymentMethodID: "e50f7622-81da-484b-9c66-1c8a99c6b71b",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { MoovCore } from "@moovio/sdk/core.js";
import { paymentMethodsGet } from "@moovio/sdk/funcs/paymentMethodsGet.js";
// Use `MoovCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const moov = new MoovCore({
security: {
username: "",
password: "",
},
});
async function run() {
const res = await paymentMethodsGet(moov, {
accountID: "b888f774-3e7c-4135-a18c-6b985523c4bc",
paymentMethodID: "e50f7622-81da-484b-9c66-1c8a99c6b71b",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.GetPaymentMethodRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.GetPaymentMethodResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.APIError | 4XX, 5XX | */* |