@abacatepay/types 0.0.4 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -13
- package/dist/index.d.ts +6 -1
- package/dist/index.js +6 -1
- package/dist/{routes.d.ts → v1/routes.d.ts} +1 -2
- package/dist/{routes.js → v1/routes.js} +0 -1
- package/dist/v2/entities/checkout.d.ts +106 -0
- package/dist/v2/entities/checkout.js +29 -0
- package/dist/v2/entities/coupon.d.ts +63 -0
- package/dist/v2/entities/coupon.js +14 -0
- package/dist/v2/entities/customer.d.ts +41 -0
- package/dist/v2/entities/customer.js +1 -0
- package/dist/v2/entities/payout.d.ts +51 -0
- package/dist/v2/entities/payout.js +11 -0
- package/dist/v2/entities/pix.d.ts +48 -0
- package/dist/v2/entities/pix.js +1 -0
- package/dist/v2/entities/products.d.ts +49 -0
- package/dist/v2/entities/products.js +5 -0
- package/dist/v2/entities/store.d.ts +36 -0
- package/dist/v2/entities/store.js +1 -0
- package/dist/v2/entities/subscription.d.ts +110 -0
- package/dist/v2/entities/subscription.js +8 -0
- package/dist/v2/index.d.ts +12 -0
- package/dist/v2/index.js +12 -0
- package/dist/v2/rest.d.ts +681 -0
- package/dist/v2/rest.js +1 -0
- package/dist/v2/routes.d.ts +129 -0
- package/dist/v2/routes.js +162 -0
- package/dist/v2/utils.d.ts +26 -0
- package/dist/v2/utils.js +42 -0
- package/dist/v2/webhook.d.ts +135 -0
- package/dist/v2/webhook.js +9 -0
- package/dist/version.d.ts +8 -2
- package/dist/version.js +9 -4
- package/package.json +25 -4
package/README.md
CHANGED
|
@@ -1,29 +1,37 @@
|
|
|
1
|
-
<
|
|
2
|
-
<p align="center">Tipagens oficiais e helpers modernos para integrar com a API da AbacatePay.</p>
|
|
1
|
+
<div align="center">
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
<a href="https://www.npmjs.com/package/@abacatepay/types"><img src="https://img.shields.io/npm/v/@abacatepay/types" /></a>
|
|
6
|
-
<a href="https://www.npmjs.com/package/@abacatepay/types"><img src="https://img.shields.io/npm/dm/@abacatepay/types" /></a>
|
|
7
|
-
<img src="https://img.shields.io/badge/built%20for-bun%20%26%20node-0b7" />
|
|
8
|
-
<img src="https://img.shields.io/badge/types-TypeScript-3178c6" />
|
|
9
|
-
<img src="https://img.shields.io/badge/license-MIT-lightgray" />
|
|
10
|
-
</p>
|
|
3
|
+
## AbacatePay API Types
|
|
11
4
|
|
|
12
|
-
|
|
5
|
+
Tipagens oficiais e helpers modernos para integrar com a API da AbacatePay.
|
|
6
|
+
|
|
7
|
+
<img src="https://res.cloudinary.com/dkok1obj5/image/upload/v1767631413/avo_clhmaf.png" width="100%" alt="AbacatePay Open Source"/>
|
|
8
|
+
|
|
9
|
+
## Instalação
|
|
10
|
+
|
|
11
|
+
Use com o seu *package manager* favorito
|
|
12
|
+
|
|
13
|
+
</div>
|
|
13
14
|
|
|
14
15
|
```bash
|
|
16
|
+
bun add @abacatepay/types
|
|
17
|
+
pnpm add @abacatepay/types
|
|
15
18
|
npm install @abacatepay/types
|
|
16
19
|
```
|
|
17
20
|
|
|
18
|
-
<
|
|
21
|
+
<div align="center">
|
|
22
|
+
|
|
23
|
+
## Como a AbacatePay API Types documenta
|
|
19
24
|
|
|
20
25
|
Antes de tudo, você deve específicar a versão da API que você deseja importar os tipos. Coloque `/v*` no final da importação, sendo `*` a versão que deseja usar:
|
|
21
26
|
|
|
27
|
+
</div>
|
|
28
|
+
|
|
22
29
|
```ts
|
|
23
30
|
import { APICustomer } from '@abacatepay/types/v1'
|
|
24
31
|
```
|
|
25
32
|
|
|
26
|
-
|
|
33
|
+
|
|
34
|
+
<p align="center">Para tipos globais como <code>API_BASE_URL</code>, <code>API_VERSION</code>, <code>version</code> e <code>Routes</code>, apenas import normalmente sem a versão.</p>
|
|
27
35
|
|
|
28
36
|
```ts
|
|
29
37
|
import { version } from '@abacatepay/types'
|
|
@@ -69,7 +77,7 @@ import {
|
|
|
69
77
|
} from '@abacatepay/types/v1';
|
|
70
78
|
|
|
71
79
|
async function createCoupon(body: RESTPostCreateCouponBody) {
|
|
72
|
-
const path = `${API_BASE_URL}/${API_VERSION}/${Routes.
|
|
80
|
+
const path = `${API_BASE_URL}/${API_VERSION}/${Routes.coupon.create}`;
|
|
73
81
|
|
|
74
82
|
const response = await fetch(path, {
|
|
75
83
|
method: 'POST',
|
|
@@ -110,3 +118,6 @@ Bun.serve({
|
|
|
110
118
|
},
|
|
111
119
|
});
|
|
112
120
|
```
|
|
121
|
+
|
|
122
|
+
<p align="center">Feito com 🥑 pela equipe AbacatePay</br>
|
|
123
|
+
Open source, de verdade.</p>
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
export { API_BASE_URL, Routes } from './routes';
|
|
2
1
|
export { API_VERSION, version } from './version';
|
|
2
|
+
/**
|
|
3
|
+
* Base URL for the AbacatePay API (Version not included).
|
|
4
|
+
*
|
|
5
|
+
* @see {@link https://docs.abacatepay.com/}
|
|
6
|
+
*/
|
|
7
|
+
export declare const API_BASE_URL = "https://api.abacatepay.com/";
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
export { API_BASE_URL, Routes } from './routes';
|
|
2
1
|
export { API_VERSION, version } from './version';
|
|
2
|
+
/**
|
|
3
|
+
* Base URL for the AbacatePay API (Version not included).
|
|
4
|
+
*
|
|
5
|
+
* @see {@link https://docs.abacatepay.com/}
|
|
6
|
+
*/
|
|
7
|
+
export const API_BASE_URL = 'https://api.abacatepay.com/';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { RESTGetCheckQRCodePixStatusQueryParams, RESTGetSearchWithdrawQueryParams, RESTPostSimulatePaymentQueryParams } from './
|
|
2
|
-
export declare const API_BASE_URL = "https://api.abacatepay.com/";
|
|
1
|
+
import type { RESTGetCheckQRCodePixStatusQueryParams, RESTGetSearchWithdrawQueryParams, RESTPostSimulatePaymentQueryParams } from './rest';
|
|
3
2
|
export declare const Routes: {
|
|
4
3
|
readonly customer: {
|
|
5
4
|
/**
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* https://docs.abacatepay.com/pages/checkouts/reference#estrutura
|
|
3
|
+
*/
|
|
4
|
+
export interface APICheckout {
|
|
5
|
+
/**
|
|
6
|
+
* Unique billing identifier.
|
|
7
|
+
*/
|
|
8
|
+
id: string;
|
|
9
|
+
/**
|
|
10
|
+
* Total amount to be paid in cents.
|
|
11
|
+
*/
|
|
12
|
+
amount: number;
|
|
13
|
+
/**
|
|
14
|
+
* Amount already paid in cents.`null` if it has not yet been paid.
|
|
15
|
+
*/
|
|
16
|
+
paidAmount: number | null;
|
|
17
|
+
/**
|
|
18
|
+
* Bill ID in your system.
|
|
19
|
+
*/
|
|
20
|
+
externalId: string | null;
|
|
21
|
+
/**
|
|
22
|
+
* URL where the user can complete the payment.
|
|
23
|
+
*/
|
|
24
|
+
url: string;
|
|
25
|
+
/**
|
|
26
|
+
* List of items in billing.
|
|
27
|
+
*/
|
|
28
|
+
items: {
|
|
29
|
+
/**
|
|
30
|
+
* Product ID.
|
|
31
|
+
*/
|
|
32
|
+
id: string;
|
|
33
|
+
/**
|
|
34
|
+
* Item quantity.
|
|
35
|
+
*/
|
|
36
|
+
quantity: number;
|
|
37
|
+
}[];
|
|
38
|
+
/**
|
|
39
|
+
* Billing status. Can be `PENDING`, `EXPIRED`, `CANCELLED`, `PAID`, `REFUNDED`.
|
|
40
|
+
*
|
|
41
|
+
* @see {@link PaymentStatus}
|
|
42
|
+
*/
|
|
43
|
+
status: PaymentStatus;
|
|
44
|
+
/**
|
|
45
|
+
* Indicates whether the charge was created in a development (true) or production (false) environment.
|
|
46
|
+
*/
|
|
47
|
+
devMode: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Additial metadata for the charge.
|
|
50
|
+
*/
|
|
51
|
+
metadata?: Record<string, object>;
|
|
52
|
+
/**
|
|
53
|
+
* URL that the customer will be redirected to when clicking the “back” button.
|
|
54
|
+
*/
|
|
55
|
+
returnUrl: string;
|
|
56
|
+
/**
|
|
57
|
+
* URL that the customer will be redirected to when making payment.
|
|
58
|
+
*/
|
|
59
|
+
completionUrl: string;
|
|
60
|
+
/**
|
|
61
|
+
* Payment receipt URL.
|
|
62
|
+
*/
|
|
63
|
+
receiptUrl: string | null;
|
|
64
|
+
/**
|
|
65
|
+
* Coupons allowed in billing.
|
|
66
|
+
*/
|
|
67
|
+
coupons: string[];
|
|
68
|
+
/**
|
|
69
|
+
* Customer ID associated with the charge.
|
|
70
|
+
*/
|
|
71
|
+
customerId: string | null;
|
|
72
|
+
/**
|
|
73
|
+
* Charge creation date and time.
|
|
74
|
+
*/
|
|
75
|
+
createdAt: string;
|
|
76
|
+
/**
|
|
77
|
+
* Charge last updated date and time.
|
|
78
|
+
*/
|
|
79
|
+
updatedAt: string;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* https://docs.abacatepay.com/pages/payment/reference#atributos
|
|
83
|
+
*/
|
|
84
|
+
export declare enum PaymentStatus {
|
|
85
|
+
Pending = "PENDING",
|
|
86
|
+
Expired = "EXPIRED",
|
|
87
|
+
Cancelled = "CANCELLED",
|
|
88
|
+
Paid = "PAID",
|
|
89
|
+
Refunded = "REFUNDED"
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* https://docs.abacatepay.com/pages/payment/create#body-methods
|
|
93
|
+
*/
|
|
94
|
+
export declare enum PaymentMethod {
|
|
95
|
+
Pix = "PIX",
|
|
96
|
+
Card = "CARD"
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* https://docs.abacatepay.com/pages/payment/create#body-frequency
|
|
100
|
+
*
|
|
101
|
+
* @deprecated
|
|
102
|
+
*/
|
|
103
|
+
export declare enum PaymentFrequency {
|
|
104
|
+
OneTime = "ONE_TIME",
|
|
105
|
+
Multiple = "MULTIPLE_PAYMENTS"
|
|
106
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* https://docs.abacatepay.com/pages/payment/reference#atributos
|
|
3
|
+
*/
|
|
4
|
+
export var PaymentStatus;
|
|
5
|
+
(function (PaymentStatus) {
|
|
6
|
+
PaymentStatus["Pending"] = "PENDING";
|
|
7
|
+
PaymentStatus["Expired"] = "EXPIRED";
|
|
8
|
+
PaymentStatus["Cancelled"] = "CANCELLED";
|
|
9
|
+
PaymentStatus["Paid"] = "PAID";
|
|
10
|
+
PaymentStatus["Refunded"] = "REFUNDED";
|
|
11
|
+
})(PaymentStatus || (PaymentStatus = {}));
|
|
12
|
+
/**
|
|
13
|
+
* https://docs.abacatepay.com/pages/payment/create#body-methods
|
|
14
|
+
*/
|
|
15
|
+
export var PaymentMethod;
|
|
16
|
+
(function (PaymentMethod) {
|
|
17
|
+
PaymentMethod["Pix"] = "PIX";
|
|
18
|
+
PaymentMethod["Card"] = "CARD";
|
|
19
|
+
})(PaymentMethod || (PaymentMethod = {}));
|
|
20
|
+
/**
|
|
21
|
+
* https://docs.abacatepay.com/pages/payment/create#body-frequency
|
|
22
|
+
*
|
|
23
|
+
* @deprecated
|
|
24
|
+
*/
|
|
25
|
+
export var PaymentFrequency;
|
|
26
|
+
(function (PaymentFrequency) {
|
|
27
|
+
PaymentFrequency["OneTime"] = "ONE_TIME";
|
|
28
|
+
PaymentFrequency["Multiple"] = "MULTIPLE_PAYMENTS";
|
|
29
|
+
})(PaymentFrequency || (PaymentFrequency = {}));
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* https://docs.abacatepay.com/pages/coupon/reference#estrutura
|
|
3
|
+
*/
|
|
4
|
+
export interface APICoupon {
|
|
5
|
+
/**
|
|
6
|
+
* Unique coupon code that your customers will use to apply the discount.
|
|
7
|
+
*/
|
|
8
|
+
id: string;
|
|
9
|
+
/**
|
|
10
|
+
* Type of discount applied by the coupon.
|
|
11
|
+
*/
|
|
12
|
+
discountKind: CouponDiscountKind;
|
|
13
|
+
/**
|
|
14
|
+
* Discount amount. For `PERCENTAGE` use numbers from 1-100 (ex: 10 = 10%). For `FIXED` use the value in cents (ex: 500 = R$5.00).
|
|
15
|
+
*/
|
|
16
|
+
discount: number;
|
|
17
|
+
/**
|
|
18
|
+
* Coupon status.
|
|
19
|
+
*/
|
|
20
|
+
status: CouponStatus;
|
|
21
|
+
/**
|
|
22
|
+
* Limit on the number of times the coupon can be used. Use `-1` for unlimited coupons or a specific number to limit usage.
|
|
23
|
+
*
|
|
24
|
+
* @default 10
|
|
25
|
+
*/
|
|
26
|
+
maxRedeems: number;
|
|
27
|
+
/**
|
|
28
|
+
* Counter of how many times the coupon has been used by customers.
|
|
29
|
+
*/
|
|
30
|
+
redeemsCount: 0;
|
|
31
|
+
/**
|
|
32
|
+
* Indicates whether the coupon was created in a development (true) or production (false) environment.
|
|
33
|
+
*/
|
|
34
|
+
devMode: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Internal description of the coupon for your organization and control.
|
|
37
|
+
*/
|
|
38
|
+
notes?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Coupon creation date and time.
|
|
41
|
+
*/
|
|
42
|
+
createdAt: string;
|
|
43
|
+
/**
|
|
44
|
+
* Coupon last updated date and time.
|
|
45
|
+
*/
|
|
46
|
+
updatedAt: string;
|
|
47
|
+
/**
|
|
48
|
+
* Object to store additional information about the coupon, such as campaign, category, or other data relevant to your organization.
|
|
49
|
+
*/
|
|
50
|
+
metadata?: Record<string, object>;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* https://docs.abacatepay.com/pages/coupon/reference#atributos
|
|
54
|
+
*/
|
|
55
|
+
export declare enum CouponDiscountKind {
|
|
56
|
+
Percentage = "PERCENTAGE",
|
|
57
|
+
Fixed = "FIXED"
|
|
58
|
+
}
|
|
59
|
+
export declare enum CouponStatus {
|
|
60
|
+
Active = "ACTIVE",
|
|
61
|
+
Inactive = "INACTIVE",
|
|
62
|
+
Expired = "EXPIRED"
|
|
63
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* https://docs.abacatepay.com/pages/coupon/reference#atributos
|
|
3
|
+
*/
|
|
4
|
+
export var CouponDiscountKind;
|
|
5
|
+
(function (CouponDiscountKind) {
|
|
6
|
+
CouponDiscountKind["Percentage"] = "PERCENTAGE";
|
|
7
|
+
CouponDiscountKind["Fixed"] = "FIXED";
|
|
8
|
+
})(CouponDiscountKind || (CouponDiscountKind = {}));
|
|
9
|
+
export var CouponStatus;
|
|
10
|
+
(function (CouponStatus) {
|
|
11
|
+
CouponStatus["Active"] = "ACTIVE";
|
|
12
|
+
CouponStatus["Inactive"] = "INACTIVE";
|
|
13
|
+
CouponStatus["Expired"] = "EXPIRED";
|
|
14
|
+
})(CouponStatus || (CouponStatus = {}));
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* https://docs.abacatepay.com/pages/client/reference#estrutura
|
|
3
|
+
*/
|
|
4
|
+
export interface APICustomer {
|
|
5
|
+
/**
|
|
6
|
+
* Unique customer identifier.
|
|
7
|
+
*/
|
|
8
|
+
id: string;
|
|
9
|
+
/**
|
|
10
|
+
* Indicates whether the client was created in a testing environment.
|
|
11
|
+
*/
|
|
12
|
+
devMode: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Customer country.
|
|
15
|
+
*/
|
|
16
|
+
country: string;
|
|
17
|
+
/**
|
|
18
|
+
* Customer's full name.
|
|
19
|
+
*/
|
|
20
|
+
name: string;
|
|
21
|
+
/**
|
|
22
|
+
* Customer's email.
|
|
23
|
+
*/
|
|
24
|
+
email: string;
|
|
25
|
+
/**
|
|
26
|
+
* Customer's CPF or CNPJ.
|
|
27
|
+
*/
|
|
28
|
+
taxId: string;
|
|
29
|
+
/**
|
|
30
|
+
* Customer's cell phone.
|
|
31
|
+
*/
|
|
32
|
+
cellphone: string;
|
|
33
|
+
/**
|
|
34
|
+
* Customer zip code.
|
|
35
|
+
*/
|
|
36
|
+
zipCode: string;
|
|
37
|
+
/**
|
|
38
|
+
* Additional customer metadata.
|
|
39
|
+
*/
|
|
40
|
+
metadata?: Record<string, object>;
|
|
41
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* https://docs.abacatepay.com/pages/payouts/reference
|
|
3
|
+
*/
|
|
4
|
+
export interface APIPayout {
|
|
5
|
+
/**
|
|
6
|
+
* Unique transaction identifier.
|
|
7
|
+
*/
|
|
8
|
+
id: string;
|
|
9
|
+
/**
|
|
10
|
+
* Current transaction status.
|
|
11
|
+
*/
|
|
12
|
+
status: PayoutStatus;
|
|
13
|
+
/**
|
|
14
|
+
* Indicates whether the transaction was created in a testing environment.
|
|
15
|
+
*/
|
|
16
|
+
devMode: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Transaction proof URL.
|
|
19
|
+
*/
|
|
20
|
+
receiptUrl: string | null;
|
|
21
|
+
/**
|
|
22
|
+
* Payout value in cents.
|
|
23
|
+
*/
|
|
24
|
+
amount: number;
|
|
25
|
+
/**
|
|
26
|
+
* Platform fee in cents.
|
|
27
|
+
*/
|
|
28
|
+
platformFee: number;
|
|
29
|
+
/**
|
|
30
|
+
* External transaction identifier.
|
|
31
|
+
*/
|
|
32
|
+
externalId: string;
|
|
33
|
+
/**
|
|
34
|
+
* Transaction creation date.
|
|
35
|
+
*/
|
|
36
|
+
createdAt: string;
|
|
37
|
+
/**
|
|
38
|
+
* Transaction update date.
|
|
39
|
+
*/
|
|
40
|
+
updatedAt: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* https://docs.abacatepay.com/pages/payouts/reference#atributos
|
|
44
|
+
*/
|
|
45
|
+
export declare enum PayoutStatus {
|
|
46
|
+
Pending = "PENDING",
|
|
47
|
+
Expired = "EXPIRED",
|
|
48
|
+
Cancelled = "CANCELLED",
|
|
49
|
+
Complete = "COMPLETE",
|
|
50
|
+
Refunded = "REFUNDED"
|
|
51
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* https://docs.abacatepay.com/pages/payouts/reference#atributos
|
|
3
|
+
*/
|
|
4
|
+
export var PayoutStatus;
|
|
5
|
+
(function (PayoutStatus) {
|
|
6
|
+
PayoutStatus["Pending"] = "PENDING";
|
|
7
|
+
PayoutStatus["Expired"] = "EXPIRED";
|
|
8
|
+
PayoutStatus["Cancelled"] = "CANCELLED";
|
|
9
|
+
PayoutStatus["Complete"] = "COMPLETE";
|
|
10
|
+
PayoutStatus["Refunded"] = "REFUNDED";
|
|
11
|
+
})(PayoutStatus || (PayoutStatus = {}));
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { PaymentStatus } from './checkout';
|
|
2
|
+
/**
|
|
3
|
+
* https://docs.abacatepay.com/pages/transparents/reference
|
|
4
|
+
*/
|
|
5
|
+
export interface APIQRCodePIX {
|
|
6
|
+
/**
|
|
7
|
+
* Unique QRCode PIX identifier.
|
|
8
|
+
*/
|
|
9
|
+
id: string;
|
|
10
|
+
/**
|
|
11
|
+
* Charge amount in cents (e.g. 4000 = R$40.00).
|
|
12
|
+
*/
|
|
13
|
+
amount: number;
|
|
14
|
+
/**
|
|
15
|
+
* PIX status. Can be `PENDING`, `EXPIRED`, `CANCELLED`, `PAID`, `REFUNDED`.
|
|
16
|
+
*
|
|
17
|
+
* @see {@link PaymentStatus}
|
|
18
|
+
*/
|
|
19
|
+
status: PaymentStatus;
|
|
20
|
+
/**
|
|
21
|
+
* Indicates whether the charge is in a testing (true) or production (false) environment.
|
|
22
|
+
*/
|
|
23
|
+
devMode: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* PIX code (copy-and-paste) for payment.
|
|
26
|
+
*/
|
|
27
|
+
brCode: string;
|
|
28
|
+
/**
|
|
29
|
+
* PIX code in Base64 format (Useful for displaying in images).
|
|
30
|
+
*/
|
|
31
|
+
brCodeBase64: string;
|
|
32
|
+
/**
|
|
33
|
+
* Platform fee in cents. Example: 80 means R$0.80.
|
|
34
|
+
*/
|
|
35
|
+
platformFee: number;
|
|
36
|
+
/**
|
|
37
|
+
* QRCode PIX creation date and time.
|
|
38
|
+
*/
|
|
39
|
+
createdAt: string;
|
|
40
|
+
/**
|
|
41
|
+
* QRCode PIX last updated date and time.
|
|
42
|
+
*/
|
|
43
|
+
updatedAt: string;
|
|
44
|
+
/**
|
|
45
|
+
* QRCode expiration date and time.
|
|
46
|
+
*/
|
|
47
|
+
expiresAt: string;
|
|
48
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* https://docs.abacatepay.com/pages/products/reference#estrutura
|
|
3
|
+
*/
|
|
4
|
+
export interface APIProduct {
|
|
5
|
+
/**
|
|
6
|
+
* The ID of your product.
|
|
7
|
+
*/
|
|
8
|
+
id: string;
|
|
9
|
+
/**
|
|
10
|
+
* Unique product identifier in your system.
|
|
11
|
+
*/
|
|
12
|
+
externalId: string;
|
|
13
|
+
/**
|
|
14
|
+
* Product name.
|
|
15
|
+
*/
|
|
16
|
+
name: string;
|
|
17
|
+
/**
|
|
18
|
+
* Product price in cents.
|
|
19
|
+
*/
|
|
20
|
+
price: number;
|
|
21
|
+
/**
|
|
22
|
+
* Product currency.
|
|
23
|
+
*/
|
|
24
|
+
currency: string;
|
|
25
|
+
/**
|
|
26
|
+
* Product status
|
|
27
|
+
*/
|
|
28
|
+
status: ProductStatus;
|
|
29
|
+
/**
|
|
30
|
+
* Indicates whether the product was created in a testing environment.
|
|
31
|
+
*/
|
|
32
|
+
devMode: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Product creation date.
|
|
35
|
+
*/
|
|
36
|
+
createdAt: string;
|
|
37
|
+
/**
|
|
38
|
+
* Product update date.
|
|
39
|
+
*/
|
|
40
|
+
updatedAt: string;
|
|
41
|
+
/**
|
|
42
|
+
* Product description.
|
|
43
|
+
*/
|
|
44
|
+
description: string | null;
|
|
45
|
+
}
|
|
46
|
+
export declare enum ProductStatus {
|
|
47
|
+
Active = "ACTIVE",
|
|
48
|
+
Inactive = "INACTIVE"
|
|
49
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* https://docs.abacatepay.com/pages/store/reference#estrutura
|
|
3
|
+
*/
|
|
4
|
+
export interface APIStore {
|
|
5
|
+
/**
|
|
6
|
+
* Unique identifier for your store on AbacatePay.
|
|
7
|
+
*/
|
|
8
|
+
id: string;
|
|
9
|
+
/**
|
|
10
|
+
* Name of your store/company.
|
|
11
|
+
*
|
|
12
|
+
* @example "Minha Loja Online"
|
|
13
|
+
*/
|
|
14
|
+
name: string;
|
|
15
|
+
/**
|
|
16
|
+
* Object containing information about your account balances.
|
|
17
|
+
*
|
|
18
|
+
* @remarks All balance values are returned in cents. To convert to Reais, divide by 100. For example: 15000 cents = R$150.00.
|
|
19
|
+
*/
|
|
20
|
+
balance: {
|
|
21
|
+
/**
|
|
22
|
+
* Balance available for withdrawal in cents.
|
|
23
|
+
*/
|
|
24
|
+
available: number;
|
|
25
|
+
/**
|
|
26
|
+
* Balance pending confirmation in cents.
|
|
27
|
+
*/
|
|
28
|
+
pending: number;
|
|
29
|
+
/**
|
|
30
|
+
* Balance blocked in disputes in cents.
|
|
31
|
+
*
|
|
32
|
+
* @remarks The blocked balance represents amounts that are in dispute or under review. These amounts are not available for withdrawal until the situation is resolved.
|
|
33
|
+
*/
|
|
34
|
+
blocked: number;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import type { PaymentMethod } from './checkout';
|
|
2
|
+
/**
|
|
3
|
+
* https://docs.abacatepay.com/pages/subscriptions/reference#estrutura
|
|
4
|
+
*/
|
|
5
|
+
export interface APISubscription {
|
|
6
|
+
/**
|
|
7
|
+
* The ID of the subscription.
|
|
8
|
+
*/
|
|
9
|
+
id: string;
|
|
10
|
+
/**
|
|
11
|
+
* The subscription value in cents.
|
|
12
|
+
*/
|
|
13
|
+
amount: number;
|
|
14
|
+
/**
|
|
15
|
+
* Subscription currenty.
|
|
16
|
+
*/
|
|
17
|
+
currency: string;
|
|
18
|
+
/**
|
|
19
|
+
* Subscription name.
|
|
20
|
+
*/
|
|
21
|
+
name: string;
|
|
22
|
+
/**
|
|
23
|
+
* Subscription description.
|
|
24
|
+
*/
|
|
25
|
+
description: string;
|
|
26
|
+
/**
|
|
27
|
+
* Unique identifier of the subscription on your system.
|
|
28
|
+
*/
|
|
29
|
+
externalId: string;
|
|
30
|
+
/**
|
|
31
|
+
* Indicates whether the signature was created in a testing environment.
|
|
32
|
+
*/
|
|
33
|
+
devMode: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Subscription creation date.
|
|
36
|
+
*/
|
|
37
|
+
createdAt: string;
|
|
38
|
+
/**
|
|
39
|
+
* Subscription update date.
|
|
40
|
+
*/
|
|
41
|
+
updatedAt: string;
|
|
42
|
+
/**
|
|
43
|
+
* Payment method for the subscription.
|
|
44
|
+
*/
|
|
45
|
+
method: PaymentMethod;
|
|
46
|
+
/**
|
|
47
|
+
* Status of the subscription.
|
|
48
|
+
*/
|
|
49
|
+
status: SubscriptionStatus;
|
|
50
|
+
/**
|
|
51
|
+
* Billing frequency configuration.
|
|
52
|
+
*/
|
|
53
|
+
frequency: {
|
|
54
|
+
/**
|
|
55
|
+
* Subscription billing cycle.
|
|
56
|
+
*/
|
|
57
|
+
cycle: 'MONTHLY' | 'YEARLY' | 'WEEKLY' | 'DAILY';
|
|
58
|
+
/**
|
|
59
|
+
* Day of the month the charge will be processed (1-31).
|
|
60
|
+
*/
|
|
61
|
+
dayOfProcessing: number;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Identifier of the customer who will have the signature.
|
|
65
|
+
*/
|
|
66
|
+
customerId: string;
|
|
67
|
+
/**
|
|
68
|
+
* Retry policy in case of payment failure.
|
|
69
|
+
*/
|
|
70
|
+
retryPolicy: {
|
|
71
|
+
/**
|
|
72
|
+
* Maximum number of billing attempts.
|
|
73
|
+
*/
|
|
74
|
+
maxRetry: number;
|
|
75
|
+
/**
|
|
76
|
+
* Interval in days between charging attempts.
|
|
77
|
+
*/
|
|
78
|
+
retryEvery: number;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Array of events related to the subscription.
|
|
82
|
+
*/
|
|
83
|
+
events: APISubscriptionEvent[];
|
|
84
|
+
}
|
|
85
|
+
export declare enum SubscriptionStatus {
|
|
86
|
+
Pending = "PENDING",
|
|
87
|
+
Active = "ACTIVE",
|
|
88
|
+
Cancelled = "CANCELLED",
|
|
89
|
+
Expired = "EXPIRED",
|
|
90
|
+
Failed = "FAILED"
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* https://docs.abacatepay.com/pages/subscriptions/reference#estrutura
|
|
94
|
+
*/
|
|
95
|
+
export interface APISubscriptionEvent {
|
|
96
|
+
/**
|
|
97
|
+
* Event type.
|
|
98
|
+
*
|
|
99
|
+
* @remarks We need to use `(string & {})` because we don't know exactly all possible values.
|
|
100
|
+
*/
|
|
101
|
+
event: 'CREATED' | (string & {});
|
|
102
|
+
/**
|
|
103
|
+
* Event description.
|
|
104
|
+
*/
|
|
105
|
+
description: string;
|
|
106
|
+
/**
|
|
107
|
+
* Event creation date.
|
|
108
|
+
*/
|
|
109
|
+
createdAt: string;
|
|
110
|
+
}
|