Payments

A Payment resource is an attempt by your customer to send you money in exchange for your product. This is a reference to an amount that you are expecting to receive if a payment resource with paid status becomes a part of a payout. If the payment status is failed, you can determine the reason for failure.
โ€‹More Detailsโ€‹

/**
* These are the required properties
* @param {Object} data Data payload
* @param {Object} data.attributes Payload attributes
* @param {number} data.attributes.amount Amount int32
* @param {number} data.attributes.currency Three-letter ISO currency code, in uppercase. PHP is the only supported currency as of the moment.
* @param {Object} data.attributes.source The source object from checkout
* @param {string} data.attributes.source.id Id of a Source resource
* @param {string} data.attributes.source.type Type of a Source resource. Possible value is 'source'.
*/
const result = await paymongo.payments.create(data);
โ€‹

{
data: {
attributes: {
amount: 30000,
currency: 'PHP',
source: {
id: 'abc', // Id of the Source resource.
type: 'source', //
}
}
}
}
โ€‹

const result = await paymongo.payments.list();

{
data: [] // array of payments
}

/**
* @param {string} id Payment id
*/
const result = await paymongo.payments.retrieve();
โ€‹
Last modified 7mo ago
Copy link
On this page
The Payment Resource
Creating a Payment
Listing Payments
Retrieving a Payment