Parameters
PaymentMethodsFilters
Optional filters to narrow down payment methods.
Return value
Promise<PaymentMethod[]>
Promise that resolves to an array of available payment methods.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Retrieve available payment methods
async getPaymentsMethods(
parameters?: PaymentMethodsFilters
): Promise<PaymentMethod[]>
interface PaymentMethod {
id: string;
name: string;
type: string;
currencies: string[];
countries: string[];
}
const payviox = new Payviox('your_api_token');
const methods = await payviox.getPaymentsMethods();
console.log('Available payment methods:', methods);
const payviox = new Payviox('your_api_token');
const methods = await payviox.getPaymentsMethods({
currencies: 'USD'
});
console.log('USD payment methods:', methods);
const payviox = new Payviox('your_api_token');
const methods = await payviox.getPaymentsMethods({
currencies: ['USD', 'EUR'],
countries: ['FR', 'DE']
});
console.log('Filtered methods:', methods);
const payviox = new Payviox('your_api_token');
const methods = await payviox.getPaymentsMethods({
currencies: 'USD'
});
const container = document.getElementById('payment-methods');
methods.forEach(method => {
container.innerHTML += `
<div class="payment-method">
<h3>${method.name}</h3>
<p>Type: ${method.type}</p>
<p>ID: ${method.id}</p>
</div>
`;
});
try {
const methods = await payviox.getPaymentsMethods();
if (methods.length === 0) {
console.warn('No payment methods available');
}
} catch (error) {
console.error('Failed to fetch payment methods:', error);
}