@abacatepay/types 0.0.3 → 2.0.0

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.
@@ -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,5 @@
1
+ export var ProductStatus;
2
+ (function (ProductStatus) {
3
+ ProductStatus["Active"] = "ACTIVE";
4
+ ProductStatus["Inactive"] = "INACTIVE";
5
+ })(ProductStatus || (ProductStatus = {}));
@@ -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
+ }
@@ -0,0 +1,8 @@
1
+ export var SubscriptionStatus;
2
+ (function (SubscriptionStatus) {
3
+ SubscriptionStatus["Pending"] = "PENDING";
4
+ SubscriptionStatus["Active"] = "ACTIVE";
5
+ SubscriptionStatus["Cancelled"] = "CANCELLED";
6
+ SubscriptionStatus["Expired"] = "EXPIRED";
7
+ SubscriptionStatus["Failed"] = "FAILED";
8
+ })(SubscriptionStatus || (SubscriptionStatus = {}));
@@ -0,0 +1,11 @@
1
+ export * from './entities/checkout';
2
+ export * from './entities/coupon';
3
+ export * from './entities/customer';
4
+ export * from './entities/payout';
5
+ export * from './entities/pix';
6
+ export * from './entities/products';
7
+ export * from './entities/store';
8
+ export * from './entities/subscription';
9
+ export * from './rest';
10
+ export * from './utils';
11
+ export * from './webhook';
@@ -0,0 +1,11 @@
1
+ export * from './entities/checkout';
2
+ export * from './entities/coupon';
3
+ export * from './entities/customer';
4
+ export * from './entities/payout';
5
+ export * from './entities/pix';
6
+ export * from './entities/products';
7
+ export * from './entities/store';
8
+ export * from './entities/subscription';
9
+ export * from './rest';
10
+ export * from './utils';
11
+ export * from './webhook';