
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
A simple sdk made to abstract most of the Asaas payment gateway api requests.
last update: 06/05/2024 Items updated:
Import the package and instantitate a new Client:
import { AsaasClient } from 'asaas';
const asaas = new AsaasClient(process.env.ASAAS_API_KEY);
Every request to the Asaas API needs an API Key, which must be passed as the first parameter in the constructor. To obtain your API Key, access the Integration Tab in the Account Settings area.
Optionally you can set base url, enable sandbox mode and set sandbox mode base url.
import { AsaasClient } from 'asaas';
//Instantiate a new client
const asaas = new AsaasClient(process.env.ASAAS_API_KEY, {
//baseUrl?: string (default: https://api.asaas.com/v3);
//sandbox?: boolean;
//sandboxUrl?: string (default: https://sandbox.asaas.com/api/v3);
//printError?: boolean (default: true); // Determines whether errors will be automatically logged to the console
});
To enable Sandbox Mode, pass to the client's constructor, as the second parameter, an object with sandbox information as true. The default sandbox URL is https://sandbox.asaas.com/api/v3
import { AsaasClient } from 'asaas';
const asaas = new AsaasClient(process.env.ASAAS_API_KEY, {
sandbox: true;
//sandboxUrl?: string (default: https://sandbox.asaas.com/api/v3);
//baseUrl?: string (default: https://api.asaas.com/v3);
});
By default, the library automatically logs errors to the console when request failures occur. You can disable this behavior by setting the printError option to false:
import { AsaasClient } from 'asaas';
const asaas = new AsaasClient(process.env.ASAAS_API_KEY, {
printError: false // Disables automatic error logging to the console
});
Returns customers. Filters can be applied, passing an object with the items allowed in the official documentation.
import { AsaasClient } from 'asaas';
const asaas = new AsaasClient(process.env.ASAAS_API_KEY, {
// sandbox: boolean;
//sandboxUrl?: string (default: https://sandbox.asaas.com/api/v3);
//baseUrl?: string (default: https://api.asaas.com/v3);
});
//It lists all registered customers and makes a filter by email.
await asaas.customers.list({
email: "email@email.com"
});
| Parameter | Type | Description |
|---|---|---|
name | string | Filter by Name. |
email | string | Filter by Email. |
cpfCnpj | string | Filter by CPF or CNPJ. |
groupName | string | Filter by Group. |
externalReference | string | Filter by External Reference. |
offset | number | Offset of search. |
limit | number | Limit of results. |
import { AsaasClient } from 'asaas';
const asaas = new AsaasClient(process.env.ASAAS_API_KEY, {
// sandbox: boolean;
//sandboxUrl?: string (default: https://sandbox.asaas.com/api/v3);
//baseUrl?: string (default: https://api.asaas.com/v3);
});
//It returns a customer by ID.
await asaas.customers.getById("cus_123abcde456");
| Parameter | Type | Description |
|---|---|---|
id | string | Required. Customer ID |
Returns payments. Filters can be applied, passing an object with the items allowed in the official documentation.
import { AsaasClient } from 'asaas';
const asaas = new AsaasClient(process.env.ASAAS_API_KEY, {
// sandbox: boolean;
//sandboxUrl?: string (default: https://sandbox.asaas.com/api/v3);
//baseUrl?: string (default: https://api.asaas.com/v3);
});
//It lists all registered payments and makes a filter by customer ID.
await asaas.payments.list({
customer: "cus_123abcde456"
});
| Parameter | Type | Description |
|---|---|---|
customer | string | Filter by Customer ID. |
customerGroupName | string | Filter by Customer group name. |
billingType | string | Filter by Billing Type. |
status | string | Filter by Status. |
subscription | string | Filter by Subscription ID. |
installment | string | Filter by Installment ID. |
externalReference | string | Filter by External Reference. |
paymentDate | ` |
FAQs
Unofficial Asaas Payment Gateway SDK
The npm package asaas receives a total of 505 weekly downloads. As such, asaas popularity was classified as not popular.
We found that asaas demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.