Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/abacatepay/abacatepay-nodejs-sdk

AbacatePay NodeJS SDK for you to start receiving payments in seconds
https://github.com/abacatepay/abacatepay-nodejs-sdk

Last synced: about 1 month ago
JSON representation

AbacatePay NodeJS SDK for you to start receiving payments in seconds

Awesome Lists containing this project

README

        

# abacatepay-nodejs-sdk
AbacatePay NodeJS SDK for you to start receiving payments in seconds

## Example
```js
import AbacatePay from 'abacatepay';

const abacate = AbacatePay('{{ key }}');

const billing = abacate.billing.create({
frequency: "ONE_TIME",
methods: ["PIX"],
products: [
{
externalId: "PRO-PLAN",
name: "Pro plan",
quantity: 1,
price: 1000
}
],
returnUrl: "https://yoursite.com/app",
completionUrl: "https://yoursite.com/pagamento/sucesso",
customer: {
email: '[email protected]'
}
});

console.log(billing)
/* Returns:
{
_id: 'bill_12345667',
url: 'https://abacatepay.com/pay/bill_12345667',
amount: 1000,
status: 'PENDING',
devMode: true,
methods: ['PIX'],
frequency: 'ONE_TIME',
nextBilling: null,
customer: {
id: 'cust_12345',
metadata: {
email: '[email protected]'
}
},
createdAt: '2024-11-04T18:38:28.573',
updatedAt: '2024-11-04T18:38:28.573',
}
*/
```