@blindpay/node 3.10.0 → 3.11.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.
- package/dist/{api-client-BWImXDBx.d.ts → api-client-5N_7-zad.d.ts} +1 -1
- package/dist/{api-client-L9eGwH1U.d.mts → api-client-DYqrodZr.d.mts} +1 -1
- package/dist/{chunk-7PWF4J3Z.mjs → chunk-IM2L5L4B.mjs} +20 -12
- package/dist/{chunk-YIZJM2GU.mjs → chunk-NAGY6BLL.mjs} +10 -0
- package/dist/chunk-SLKVEQUY.mjs +76 -0
- package/dist/{index.d-DK8eD9f3.d.mts → index.d-CGeWvXXq.d.mts} +1 -1
- package/dist/{index.d-DK8eD9f3.d.ts → index.d-CGeWvXXq.d.ts} +1 -1
- package/dist/index.d.mts +15 -3
- package/dist/index.d.ts +15 -3
- package/dist/index.js +78 -1
- package/dist/index.mjs +16 -10
- package/dist/resources/api-keys/api-keys.test.js +76 -1
- package/dist/resources/api-keys/api-keys.test.mjs +6 -5
- package/dist/resources/api-keys/index.d.mts +2 -2
- package/dist/resources/api-keys/index.d.ts +2 -2
- package/dist/resources/available/available.test.js +76 -1
- package/dist/resources/available/available.test.mjs +6 -5
- package/dist/resources/available/index.d.mts +2 -2
- package/dist/resources/available/index.d.ts +2 -2
- package/dist/resources/bank-accounts/bank-accounts.test.js +76 -1
- package/dist/resources/bank-accounts/bank-accounts.test.mjs +6 -5
- package/dist/resources/bank-accounts/index.d.mts +2 -2
- package/dist/resources/bank-accounts/index.d.ts +2 -2
- package/dist/resources/customers/customers.test.d.mts +2 -0
- package/dist/resources/customers/customers.test.d.ts +2 -0
- package/dist/resources/customers/customers.test.js +20510 -0
- package/dist/resources/customers/customers.test.mjs +652 -0
- package/dist/resources/customers/index.d.mts +466 -0
- package/dist/resources/customers/index.d.ts +466 -0
- package/dist/resources/customers/index.js +115 -0
- package/dist/resources/customers/index.mjs +9 -0
- package/dist/resources/fees/fees.test.js +76 -1
- package/dist/resources/fees/fees.test.mjs +6 -5
- package/dist/resources/fees/index.d.mts +2 -2
- package/dist/resources/fees/index.d.ts +2 -2
- package/dist/resources/instances/index.d.mts +2 -2
- package/dist/resources/instances/index.d.ts +2 -2
- package/dist/resources/instances/instances.test.js +76 -1
- package/dist/resources/instances/instances.test.mjs +6 -5
- package/dist/resources/partner-fees/index.d.mts +2 -2
- package/dist/resources/partner-fees/index.d.ts +2 -2
- package/dist/resources/partner-fees/partner-fees.test.js +76 -1
- package/dist/resources/partner-fees/partner-fees.test.mjs +6 -5
- package/dist/resources/payins/index.d.mts +2 -2
- package/dist/resources/payins/index.d.ts +2 -2
- package/dist/resources/payins/payins-quotes.test.js +76 -1
- package/dist/resources/payins/payins-quotes.test.mjs +6 -5
- package/dist/resources/payins/payins.test.js +76 -1
- package/dist/resources/payins/payins.test.mjs +6 -5
- package/dist/resources/payins/quotes.d.mts +2 -2
- package/dist/resources/payins/quotes.d.ts +2 -2
- package/dist/resources/payouts/index.d.mts +2 -2
- package/dist/resources/payouts/index.d.ts +2 -2
- package/dist/resources/payouts/payouts.test.js +76 -1
- package/dist/resources/payouts/payouts.test.mjs +6 -5
- package/dist/resources/quotes/index.d.mts +2 -2
- package/dist/resources/quotes/index.d.ts +2 -2
- package/dist/resources/quotes/quotes.test.js +76 -1
- package/dist/resources/quotes/quotes.test.mjs +6 -5
- package/dist/resources/receivers/index.d.mts +50 -4
- package/dist/resources/receivers/index.d.ts +50 -4
- package/dist/resources/receivers/index.js +10 -0
- package/dist/resources/receivers/index.mjs +1 -1
- package/dist/resources/receivers/receivers.test.js +76 -1
- package/dist/resources/receivers/receivers.test.mjs +6 -5
- package/dist/resources/terms-of-service/index.d.mts +2 -2
- package/dist/resources/terms-of-service/index.d.ts +2 -2
- package/dist/resources/terms-of-service/terms-of-service.test.js +76 -1
- package/dist/resources/terms-of-service/terms-of-service.test.mjs +6 -5
- package/dist/resources/transfers/index.d.mts +2 -2
- package/dist/resources/transfers/index.d.ts +2 -2
- package/dist/resources/transfers/transfers.test.js +76 -1
- package/dist/resources/transfers/transfers.test.mjs +6 -5
- package/dist/resources/upload/index.d.mts +1 -1
- package/dist/resources/upload/index.d.ts +1 -1
- package/dist/resources/upload/upload.test.js +76 -1
- package/dist/resources/upload/upload.test.mjs +6 -5
- package/dist/resources/virtual-accounts/index.d.mts +2 -2
- package/dist/resources/virtual-accounts/index.d.ts +2 -2
- package/dist/resources/virtual-accounts/virtual-accounts.test.js +76 -1
- package/dist/resources/virtual-accounts/virtual-accounts.test.mjs +6 -5
- package/dist/resources/wallets/blockchain.d.mts +2 -2
- package/dist/resources/wallets/blockchain.d.ts +2 -2
- package/dist/resources/wallets/blockchain.test.js +76 -1
- package/dist/resources/wallets/blockchain.test.mjs +6 -5
- package/dist/resources/wallets/custodial.d.mts +2 -2
- package/dist/resources/wallets/custodial.d.ts +2 -2
- package/dist/resources/wallets/custodial.test.js +76 -1
- package/dist/resources/wallets/custodial.test.mjs +6 -5
- package/dist/resources/wallets/offramp.d.mts +2 -2
- package/dist/resources/wallets/offramp.d.ts +2 -2
- package/dist/resources/wallets/offramp.test.js +76 -1
- package/dist/resources/wallets/offramp.test.mjs +6 -5
- package/dist/resources/webhooks/index.d.mts +2 -2
- package/dist/resources/webhooks/index.d.ts +2 -2
- package/dist/resources/webhooks/webhooks.test.js +76 -1
- package/dist/resources/webhooks/webhooks.test.mjs +6 -5
- package/dist/strict-omit-ByJhzKNC.d.mts +3 -0
- package/dist/strict-omit-ByJhzKNC.d.ts +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,652 @@
|
|
|
1
|
+
import {
|
|
2
|
+
afterEach,
|
|
3
|
+
describe,
|
|
4
|
+
globalExpect,
|
|
5
|
+
init_dist,
|
|
6
|
+
it
|
|
7
|
+
} from "../../chunk-D6N3USMR.mjs";
|
|
8
|
+
import {
|
|
9
|
+
BlindPay,
|
|
10
|
+
init_client
|
|
11
|
+
} from "../../chunk-IM2L5L4B.mjs";
|
|
12
|
+
import "../../chunk-FG25JHDX.mjs";
|
|
13
|
+
import "../../chunk-KMU6V4LW.mjs";
|
|
14
|
+
import "../../chunk-QGNLMN6Z.mjs";
|
|
15
|
+
import "../../chunk-UC57SCKQ.mjs";
|
|
16
|
+
import "../../chunk-Z6EYX4D3.mjs";
|
|
17
|
+
import "../../chunk-ISHZTBAN.mjs";
|
|
18
|
+
import "../../chunk-UDRMLZWT.mjs";
|
|
19
|
+
import "../../chunk-LEPGLH7Q.mjs";
|
|
20
|
+
import "../../chunk-VGU72ZNI.mjs";
|
|
21
|
+
import "../../chunk-E7M4CJKR.mjs";
|
|
22
|
+
import "../../chunk-TBTA7A2P.mjs";
|
|
23
|
+
import "../../chunk-NAGY6BLL.mjs";
|
|
24
|
+
import "../../chunk-SLKVEQUY.mjs";
|
|
25
|
+
import "../../chunk-ALHMJWQN.mjs";
|
|
26
|
+
import "../../chunk-KYOUR4KX.mjs";
|
|
27
|
+
import "../../chunk-RC5NN5UF.mjs";
|
|
28
|
+
import "../../chunk-F5Z45GCA.mjs";
|
|
29
|
+
import "../../chunk-LRHWT4JU.mjs";
|
|
30
|
+
import "../../chunk-WE73MTQL.mjs";
|
|
31
|
+
import "../../chunk-N4F3FBNB.mjs";
|
|
32
|
+
import {
|
|
33
|
+
__async,
|
|
34
|
+
__commonJS
|
|
35
|
+
} from "../../chunk-OBKEW4AQ.mjs";
|
|
36
|
+
|
|
37
|
+
// src/resources/customers/customers.test.ts
|
|
38
|
+
var require_customers_test = __commonJS({
|
|
39
|
+
"src/resources/customers/customers.test.ts"(exports) {
|
|
40
|
+
init_dist();
|
|
41
|
+
init_client();
|
|
42
|
+
describe("Customers", () => {
|
|
43
|
+
afterEach(() => fetchMock.resetMocks());
|
|
44
|
+
const blindpay = new BlindPay({ apiKey: "test-key", instanceId: "in_000000000000" });
|
|
45
|
+
describe("List customers", () => {
|
|
46
|
+
it("should list customers", () => __async(null, null, function* () {
|
|
47
|
+
const mockedCustomers = {
|
|
48
|
+
data: [
|
|
49
|
+
{
|
|
50
|
+
id: "re_Euw7HN4OdxPn",
|
|
51
|
+
type: "individual",
|
|
52
|
+
kyc_type: "standard",
|
|
53
|
+
kyc_status: "verifying",
|
|
54
|
+
is_tos_accepted: true,
|
|
55
|
+
kyc_warnings: [
|
|
56
|
+
{
|
|
57
|
+
code: null,
|
|
58
|
+
message: null,
|
|
59
|
+
resolution_status: null,
|
|
60
|
+
warning_id: null
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
email: "bernardo@gmail.com",
|
|
64
|
+
tax_id: "12345678900",
|
|
65
|
+
address_line_1: "Av. Paulista, 1000",
|
|
66
|
+
address_line_2: "Apto 101",
|
|
67
|
+
city: "S\xE3o Paulo",
|
|
68
|
+
state_province_region: "SP",
|
|
69
|
+
country: "BR",
|
|
70
|
+
postal_code: "01310-100",
|
|
71
|
+
ip_address: "127.0.0.1",
|
|
72
|
+
image_url: "https://example.com/image.png",
|
|
73
|
+
phone_number: "+5511987654321",
|
|
74
|
+
proof_of_address_doc_type: "UTILITY_BILL",
|
|
75
|
+
proof_of_address_doc_file: "https://example.com/image.png",
|
|
76
|
+
first_name: "Bernardo",
|
|
77
|
+
last_name: "Simonassi",
|
|
78
|
+
date_of_birth: "1998-02-02T00:00:00.000Z",
|
|
79
|
+
id_doc_country: "BR",
|
|
80
|
+
id_doc_type: "PASSPORT",
|
|
81
|
+
id_doc_front_file: "https://example.com/image.png",
|
|
82
|
+
id_doc_back_file: "https://example.com/image.png",
|
|
83
|
+
aiprise_validation_key: "",
|
|
84
|
+
instance_id: "in_000000000000",
|
|
85
|
+
tos_id: "to_3ZZhllJkvo5Z",
|
|
86
|
+
created_at: "2021-01-01T00:00:00.000Z",
|
|
87
|
+
updated_at: "2021-01-01T00:00:00.000Z",
|
|
88
|
+
limit: {
|
|
89
|
+
per_transaction: 1e5,
|
|
90
|
+
daily: 2e5,
|
|
91
|
+
monthly: 1e6
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
id: "re_YuaMcI2B8zbQ",
|
|
96
|
+
type: "individual",
|
|
97
|
+
is_tos_accepted: true,
|
|
98
|
+
kyc_type: "enhanced",
|
|
99
|
+
kyc_status: "approved",
|
|
100
|
+
kyc_warnings: null,
|
|
101
|
+
email: "alice.johnson@example.com",
|
|
102
|
+
tax_id: "98765432100",
|
|
103
|
+
address_line_1: "123 Main St",
|
|
104
|
+
address_line_2: null,
|
|
105
|
+
city: "New York",
|
|
106
|
+
state_province_region: "NY",
|
|
107
|
+
country: "US",
|
|
108
|
+
postal_code: "10001",
|
|
109
|
+
ip_address: "192.168.1.1",
|
|
110
|
+
image_url: null,
|
|
111
|
+
phone_number: "+15555555555",
|
|
112
|
+
proof_of_address_doc_type: "BANK_STATEMENT",
|
|
113
|
+
proof_of_address_doc_file: "https://example.com/image.png",
|
|
114
|
+
first_name: "Alice",
|
|
115
|
+
last_name: "Johnson",
|
|
116
|
+
date_of_birth: "1990-05-10T00:00:00.000Z",
|
|
117
|
+
id_doc_country: "US",
|
|
118
|
+
id_doc_type: "PASSPORT",
|
|
119
|
+
id_doc_front_file: "https://example.com/image.png",
|
|
120
|
+
id_doc_back_file: null,
|
|
121
|
+
aiprise_validation_key: "enhanced-key",
|
|
122
|
+
instance_id: "in_000000000001",
|
|
123
|
+
source_of_funds_doc_type: "salary",
|
|
124
|
+
source_of_funds_doc_file: "https://example.com/image.png",
|
|
125
|
+
individual_holding_doc_front_file: "https://example.com/image.png",
|
|
126
|
+
purpose_of_transactions: "investment_purposes",
|
|
127
|
+
purpose_of_transactions_explanation: "Investing in stocks",
|
|
128
|
+
tos_id: "to_nppX66ntvtHs",
|
|
129
|
+
created_at: "2022-02-02T00:00:00.000Z",
|
|
130
|
+
updated_at: "2022-02-02T00:00:00.000Z",
|
|
131
|
+
limit: {
|
|
132
|
+
per_transaction: 5e4,
|
|
133
|
+
daily: 1e5,
|
|
134
|
+
monthly: 5e5
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
id: "re_IOxAUL24LG7P",
|
|
139
|
+
type: "business",
|
|
140
|
+
kyc_type: "standard",
|
|
141
|
+
is_tos_accepted: true,
|
|
142
|
+
is_fbo: false,
|
|
143
|
+
kyc_status: "pending_review",
|
|
144
|
+
kyc_warnings: null,
|
|
145
|
+
email: "business@example.com",
|
|
146
|
+
tax_id: "20096178000195",
|
|
147
|
+
address_line_1: "1 King St W",
|
|
148
|
+
address_line_2: "Suite 100",
|
|
149
|
+
city: "Toronto",
|
|
150
|
+
state_province_region: "ON",
|
|
151
|
+
country: "CA",
|
|
152
|
+
postal_code: "M5H 1A1",
|
|
153
|
+
ip_address: null,
|
|
154
|
+
image_url: null,
|
|
155
|
+
phone_number: "+14165555555",
|
|
156
|
+
proof_of_address_doc_type: "UTILITY_BILL",
|
|
157
|
+
proof_of_address_doc_file: "https://example.com/image.png",
|
|
158
|
+
legal_name: "Business Corp",
|
|
159
|
+
alternate_name: "BizCo",
|
|
160
|
+
formation_date: "2010-01-01T00:00:00.000Z",
|
|
161
|
+
website: "https://businesscorp.com",
|
|
162
|
+
owners: [
|
|
163
|
+
{
|
|
164
|
+
role: "beneficial_owner",
|
|
165
|
+
first_name: "Carlos",
|
|
166
|
+
last_name: "Silva",
|
|
167
|
+
date_of_birth: "1995-05-15T00:00:00.000Z",
|
|
168
|
+
tax_id: "12345678901",
|
|
169
|
+
address_line_1: "Rua Augusta, 1500",
|
|
170
|
+
address_line_2: null,
|
|
171
|
+
city: "S\xE3o Paulo",
|
|
172
|
+
state_province_region: "SP",
|
|
173
|
+
country: "BR",
|
|
174
|
+
postal_code: "01304-001",
|
|
175
|
+
id_doc_country: "BR",
|
|
176
|
+
id_doc_type: "PASSPORT",
|
|
177
|
+
id_doc_front_file: "https://example.com/image.png",
|
|
178
|
+
id_doc_back_file: "https://example.com/image.png",
|
|
179
|
+
proof_of_address_doc_type: "UTILITY_BILL",
|
|
180
|
+
proof_of_address_doc_file: "https://example.com/image.png",
|
|
181
|
+
ownership_percentage: 25,
|
|
182
|
+
title: "CEO",
|
|
183
|
+
id: "ub_000000000000"
|
|
184
|
+
}
|
|
185
|
+
],
|
|
186
|
+
incorporation_doc_file: "https://example.com/image.png",
|
|
187
|
+
proof_of_ownership_doc_file: "https://example.com/image.png",
|
|
188
|
+
external_id: null,
|
|
189
|
+
instance_id: "in_000000000002",
|
|
190
|
+
tos_id: "to_nppX66ntvtHs",
|
|
191
|
+
aiprise_validation_key: "",
|
|
192
|
+
created_at: "2015-03-15T00:00:00.000Z",
|
|
193
|
+
updated_at: "2015-03-15T00:00:00.000Z",
|
|
194
|
+
limit: {
|
|
195
|
+
per_transaction: 2e5,
|
|
196
|
+
daily: 4e5,
|
|
197
|
+
monthly: 2e6
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
],
|
|
201
|
+
pagination: {
|
|
202
|
+
has_more: false,
|
|
203
|
+
next_page: "",
|
|
204
|
+
prev_page: ""
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
fetchMock.mockResponseOnce(JSON.stringify(mockedCustomers), {
|
|
208
|
+
headers: { "Content-Type": "application/json" }
|
|
209
|
+
});
|
|
210
|
+
const { data, error } = yield blindpay.customers.list();
|
|
211
|
+
globalExpect(error).toBeNull();
|
|
212
|
+
globalExpect(data).toEqual(mockedCustomers);
|
|
213
|
+
}));
|
|
214
|
+
});
|
|
215
|
+
describe("Create customer", () => {
|
|
216
|
+
it("should create an individual customer with standard KYC", () => __async(null, null, function* () {
|
|
217
|
+
const mockedCustomer = {
|
|
218
|
+
id: "re_Euw7HN4OdxPn"
|
|
219
|
+
};
|
|
220
|
+
fetchMock.mockResponseOnce(JSON.stringify(mockedCustomer), {
|
|
221
|
+
headers: { "Content-Type": "application/json" }
|
|
222
|
+
});
|
|
223
|
+
const { data, error } = yield blindpay.customers.createIndividualWithStandardKYC({
|
|
224
|
+
email: "bernardo.simonassi@gmail.com",
|
|
225
|
+
country: "BR",
|
|
226
|
+
tax_id: "12345678900",
|
|
227
|
+
address_line_1: "Av. Paulista, 1000",
|
|
228
|
+
address_line_2: "Apto 101",
|
|
229
|
+
city: "S\xE3o Paulo",
|
|
230
|
+
state_province_region: "SP",
|
|
231
|
+
postal_code: "01310-100",
|
|
232
|
+
phone_number: "+5511987654321",
|
|
233
|
+
first_name: "Bernardo",
|
|
234
|
+
last_name: "Simonassi",
|
|
235
|
+
date_of_birth: "1998-02-02T00:00:00.000Z",
|
|
236
|
+
id_doc_country: "BR",
|
|
237
|
+
id_doc_type: "PASSPORT",
|
|
238
|
+
id_doc_front_file: "https://example.com/image.png",
|
|
239
|
+
id_doc_back_file: "https://example.com/image.png",
|
|
240
|
+
proof_of_address_doc_type: "UTILITY_BILL",
|
|
241
|
+
proof_of_address_doc_file: "https://example.com/image.png",
|
|
242
|
+
tos_id: "to_tPiz4bM2nh5K"
|
|
243
|
+
});
|
|
244
|
+
globalExpect(error).toBeNull();
|
|
245
|
+
globalExpect(data).toEqual({ id: "re_Euw7HN4OdxPn" });
|
|
246
|
+
}));
|
|
247
|
+
it("should create an individual customer with enhanced KYC", () => __async(null, null, function* () {
|
|
248
|
+
const mockedCustomer = {
|
|
249
|
+
id: "re_YuaMcI2B8zbQ"
|
|
250
|
+
};
|
|
251
|
+
fetchMock.mockResponseOnce(JSON.stringify(mockedCustomer), {
|
|
252
|
+
headers: { "Content-Type": "application/json" }
|
|
253
|
+
});
|
|
254
|
+
const { data, error } = yield blindpay.customers.createIndividualWithEnhancedKYC({
|
|
255
|
+
email: "bernardo.simonassi@gmail.com",
|
|
256
|
+
country: "BR",
|
|
257
|
+
tax_id: "12345678900",
|
|
258
|
+
address_line_1: "Av. Paulista, 1000",
|
|
259
|
+
address_line_2: "Apto 101",
|
|
260
|
+
city: "S\xE3o Paulo",
|
|
261
|
+
state_province_region: "SP",
|
|
262
|
+
postal_code: "01310-100",
|
|
263
|
+
first_name: "Bernardo",
|
|
264
|
+
last_name: "Simonassi",
|
|
265
|
+
phone_number: "+5511987654321",
|
|
266
|
+
date_of_birth: "1998-02-02T00:00:00.000Z",
|
|
267
|
+
id_doc_country: "BR",
|
|
268
|
+
id_doc_type: "PASSPORT",
|
|
269
|
+
id_doc_front_file: "https://example.com/image.png",
|
|
270
|
+
id_doc_back_file: "https://example.com/image.png",
|
|
271
|
+
proof_of_address_doc_type: "UTILITY_BILL",
|
|
272
|
+
proof_of_address_doc_file: "https://example.com/image.png",
|
|
273
|
+
purpose_of_transactions: "personal_or_living_expenses",
|
|
274
|
+
source_of_funds_doc_type: "savings",
|
|
275
|
+
purpose_of_transactions_explanation: "I am receiving salary payments from my employer",
|
|
276
|
+
source_of_funds_doc_file: "https://example.com/image.png",
|
|
277
|
+
selfie_file: "https://example.com/image.png",
|
|
278
|
+
tos_id: "to_3ZZhllJkvo5Z"
|
|
279
|
+
});
|
|
280
|
+
globalExpect(error).toBeNull();
|
|
281
|
+
globalExpect(data).toEqual({ id: "re_YuaMcI2B8zbQ" });
|
|
282
|
+
}));
|
|
283
|
+
it("should create a business customer with standard KYB", () => __async(null, null, function* () {
|
|
284
|
+
const mockedCustomer = {
|
|
285
|
+
id: "re_IOxAUL24LG7P"
|
|
286
|
+
};
|
|
287
|
+
fetchMock.mockResponseOnce(JSON.stringify(mockedCustomer), {
|
|
288
|
+
headers: { "Content-Type": "application/json" }
|
|
289
|
+
});
|
|
290
|
+
const { data, error } = yield blindpay.customers.createBusinessWithStandardKYB({
|
|
291
|
+
email: "contato@empresa.com.br",
|
|
292
|
+
country: "BR",
|
|
293
|
+
tax_id: "20096178000195",
|
|
294
|
+
address_line_1: "Av. Brigadeiro Faria Lima, 400",
|
|
295
|
+
address_line_2: "Sala 1201",
|
|
296
|
+
city: "S\xE3o Paulo",
|
|
297
|
+
state_province_region: "SP",
|
|
298
|
+
postal_code: "04538-132",
|
|
299
|
+
legal_name: "Empresa Exemplo Ltda",
|
|
300
|
+
alternate_name: "Exemplo",
|
|
301
|
+
formation_date: "2010-05-20T00:00:00.000Z",
|
|
302
|
+
incorporation_doc_file: "https://example.com/image.png",
|
|
303
|
+
proof_of_address_doc_type: "UTILITY_BILL",
|
|
304
|
+
proof_of_address_doc_file: "https://example.com/image.png",
|
|
305
|
+
proof_of_ownership_doc_file: "https://example.com/image.png",
|
|
306
|
+
tos_id: "to_nppX66ntvtHs",
|
|
307
|
+
website: "https://site.com/",
|
|
308
|
+
business_type: "llc",
|
|
309
|
+
business_description: "Software development company",
|
|
310
|
+
business_industry: "541511",
|
|
311
|
+
estimated_annual_revenue: "1000000_9999999",
|
|
312
|
+
source_of_wealth: "affiliate_or_royalty_income",
|
|
313
|
+
publicly_traded: false,
|
|
314
|
+
account_purpose: "treasury_management",
|
|
315
|
+
owners: [
|
|
316
|
+
{
|
|
317
|
+
role: "beneficial_owner",
|
|
318
|
+
first_name: "Carlos",
|
|
319
|
+
last_name: "Silva",
|
|
320
|
+
date_of_birth: "1995-05-15T00:00:00.000Z",
|
|
321
|
+
tax_id: "12345678901",
|
|
322
|
+
address_line_1: "Rua Augusta, 1500",
|
|
323
|
+
address_line_2: null,
|
|
324
|
+
city: "S\xE3o Paulo",
|
|
325
|
+
state_province_region: "SP",
|
|
326
|
+
country: "BR",
|
|
327
|
+
postal_code: "01304-001",
|
|
328
|
+
id_doc_country: "BR",
|
|
329
|
+
id_doc_type: "PASSPORT",
|
|
330
|
+
id_doc_front_file: "https://example.com/image.png",
|
|
331
|
+
id_doc_back_file: "https://example.com/image.png",
|
|
332
|
+
proof_of_address_doc_type: "UTILITY_BILL",
|
|
333
|
+
proof_of_address_doc_file: "https://example.com/image.png",
|
|
334
|
+
ownership_percentage: 25,
|
|
335
|
+
title: "CEO"
|
|
336
|
+
}
|
|
337
|
+
]
|
|
338
|
+
});
|
|
339
|
+
globalExpect(error).toBeNull();
|
|
340
|
+
globalExpect(data).toEqual({ id: "re_IOxAUL24LG7P" });
|
|
341
|
+
}));
|
|
342
|
+
});
|
|
343
|
+
describe("Get customer", () => {
|
|
344
|
+
it("should get a customer with new fields", () => __async(null, null, function* () {
|
|
345
|
+
const mockedCustomer = {
|
|
346
|
+
id: "re_YuaMcI2B8zbQ",
|
|
347
|
+
is_tos_accepted: true,
|
|
348
|
+
type: "individual",
|
|
349
|
+
kyc_type: "standard",
|
|
350
|
+
kyc_status: "approved",
|
|
351
|
+
kyc_warnings: null,
|
|
352
|
+
email: "john@example.com",
|
|
353
|
+
tax_id: "12345678900",
|
|
354
|
+
address_line_1: "123 Main St",
|
|
355
|
+
city: "New York",
|
|
356
|
+
state_province_region: "NY",
|
|
357
|
+
country: "US",
|
|
358
|
+
postal_code: "10001",
|
|
359
|
+
ip_address: null,
|
|
360
|
+
image_url: null,
|
|
361
|
+
phone_number: "+15555555555",
|
|
362
|
+
proof_of_address_doc_type: "UTILITY_BILL",
|
|
363
|
+
proof_of_address_doc_file: "https://example.com/image.png",
|
|
364
|
+
first_name: "John",
|
|
365
|
+
last_name: "Doe",
|
|
366
|
+
date_of_birth: "1990-01-01T00:00:00.000Z",
|
|
367
|
+
id_doc_country: "US",
|
|
368
|
+
id_doc_type: "PASSPORT",
|
|
369
|
+
id_doc_front_file: "https://example.com/image.png",
|
|
370
|
+
id_doc_back_file: "https://example.com/image.png",
|
|
371
|
+
aiprise_validation_key: "",
|
|
372
|
+
instance_id: "in_000000000000",
|
|
373
|
+
tos_id: null,
|
|
374
|
+
created_at: "2021-01-01T00:00:00.000Z",
|
|
375
|
+
updated_at: "2021-01-01T00:00:00.000Z",
|
|
376
|
+
limit: {
|
|
377
|
+
per_transaction: 1e5,
|
|
378
|
+
daily: 2e5,
|
|
379
|
+
monthly: 1e6
|
|
380
|
+
},
|
|
381
|
+
fraud_warnings: [
|
|
382
|
+
{
|
|
383
|
+
id: "UC114",
|
|
384
|
+
name: "User never used a Datacenter proxy",
|
|
385
|
+
operation: "+",
|
|
386
|
+
score: 10
|
|
387
|
+
}
|
|
388
|
+
],
|
|
389
|
+
aml_status: "clear",
|
|
390
|
+
aml_hits: {
|
|
391
|
+
has_sanction_match: false,
|
|
392
|
+
has_pep_match: false,
|
|
393
|
+
has_watchlist_match: false,
|
|
394
|
+
has_crimelist_match: false,
|
|
395
|
+
has_adversemedia_match: false
|
|
396
|
+
},
|
|
397
|
+
account_purpose_other: null,
|
|
398
|
+
occupation: "Software Engineer",
|
|
399
|
+
external_id: "ext_123",
|
|
400
|
+
is_fbo: false
|
|
401
|
+
};
|
|
402
|
+
fetchMock.mockResponseOnce(JSON.stringify(mockedCustomer), {
|
|
403
|
+
headers: { "Content-Type": "application/json" }
|
|
404
|
+
});
|
|
405
|
+
const { data, error } = yield blindpay.customers.get("re_YuaMcI2B8zbQ");
|
|
406
|
+
globalExpect(error).toBeNull();
|
|
407
|
+
globalExpect(data).toEqual(mockedCustomer);
|
|
408
|
+
}));
|
|
409
|
+
it("should get a customer", () => __async(null, null, function* () {
|
|
410
|
+
const mockedCustomer = {
|
|
411
|
+
id: "re_YuaMcI2B8zbQ",
|
|
412
|
+
is_tos_accepted: true,
|
|
413
|
+
type: "individual",
|
|
414
|
+
kyc_type: "enhanced",
|
|
415
|
+
kyc_status: "verifying",
|
|
416
|
+
kyc_warnings: [
|
|
417
|
+
{
|
|
418
|
+
code: null,
|
|
419
|
+
message: null,
|
|
420
|
+
resolution_status: null,
|
|
421
|
+
warning_id: null
|
|
422
|
+
}
|
|
423
|
+
],
|
|
424
|
+
email: "bernardo.simonassi@gmail.com",
|
|
425
|
+
tax_id: "12345678900",
|
|
426
|
+
address_line_1: "Av. Paulista, 1000",
|
|
427
|
+
address_line_2: "Apto 101",
|
|
428
|
+
city: "S\xE3o Paulo",
|
|
429
|
+
state_province_region: "SP",
|
|
430
|
+
country: "BR",
|
|
431
|
+
postal_code: "01310-100",
|
|
432
|
+
ip_address: "127.0.0.1",
|
|
433
|
+
image_url: "https://example.com/image.png",
|
|
434
|
+
phone_number: "+5511987654321",
|
|
435
|
+
proof_of_address_doc_type: "UTILITY_BILL",
|
|
436
|
+
proof_of_address_doc_file: "https://example.com/image.png",
|
|
437
|
+
first_name: "Bernardo",
|
|
438
|
+
last_name: "Simonassi",
|
|
439
|
+
date_of_birth: "1998-02-02T00:00:00.000Z",
|
|
440
|
+
id_doc_country: "BR",
|
|
441
|
+
id_doc_type: "PASSPORT",
|
|
442
|
+
id_doc_front_file: "https://example.com/image.png",
|
|
443
|
+
id_doc_back_file: "https://example.com/image.png",
|
|
444
|
+
aiprise_validation_key: "",
|
|
445
|
+
source_of_funds_doc_type: "savings",
|
|
446
|
+
source_of_funds_doc_file: "https://example.com/image.png",
|
|
447
|
+
individual_holding_doc_front_file: "https://example.com/image.png",
|
|
448
|
+
purpose_of_transactions: "personal_or_living_expenses",
|
|
449
|
+
purpose_of_transactions_explanation: "I am receiving salary payments from my employer",
|
|
450
|
+
instance_id: "in_000000000000",
|
|
451
|
+
tos_id: "to_3ZZhllJkvo5Z",
|
|
452
|
+
created_at: "2021-01-01T00:00:00.000Z",
|
|
453
|
+
updated_at: "2021-01-01T00:00:00.000Z",
|
|
454
|
+
limit: {
|
|
455
|
+
per_transaction: 1e5,
|
|
456
|
+
daily: 2e5,
|
|
457
|
+
monthly: 1e6
|
|
458
|
+
}
|
|
459
|
+
};
|
|
460
|
+
fetchMock.mockResponseOnce(JSON.stringify(mockedCustomer), {
|
|
461
|
+
headers: { "Content-Type": "application/json" }
|
|
462
|
+
});
|
|
463
|
+
const { data, error } = yield blindpay.customers.get("re_YuaMcI2B8zbQ");
|
|
464
|
+
globalExpect(error).toBeNull();
|
|
465
|
+
globalExpect(data).toEqual(mockedCustomer);
|
|
466
|
+
}));
|
|
467
|
+
});
|
|
468
|
+
describe("Update customer", () => {
|
|
469
|
+
it("should update a customer", () => __async(null, null, function* () {
|
|
470
|
+
fetchMock.mockResponseOnce(JSON.stringify({ data: null }), {
|
|
471
|
+
headers: { "Content-Type": "application/json" }
|
|
472
|
+
});
|
|
473
|
+
const { data, error } = yield blindpay.customers.update({
|
|
474
|
+
customer_id: "re_YuaMcI2B8zbQ",
|
|
475
|
+
email: "bernardo.simonassi@gmail.com",
|
|
476
|
+
tax_id: "12345678900",
|
|
477
|
+
address_line_1: "Av. Paulista, 1000",
|
|
478
|
+
address_line_2: "Apto 101",
|
|
479
|
+
city: "S\xE3o Paulo",
|
|
480
|
+
state_province_region: "SP",
|
|
481
|
+
country: "BR",
|
|
482
|
+
postal_code: "01310-100",
|
|
483
|
+
ip_address: "127.0.0.1",
|
|
484
|
+
image_url: "https://example.com/image.png",
|
|
485
|
+
phone_number: "+5511987654321",
|
|
486
|
+
proof_of_address_doc_type: "UTILITY_BILL",
|
|
487
|
+
proof_of_address_doc_file: "https://example.com/image.png",
|
|
488
|
+
first_name: "Bernardo",
|
|
489
|
+
last_name: "Simonassi",
|
|
490
|
+
date_of_birth: "1998-02-02T00:00:00.000Z",
|
|
491
|
+
id_doc_country: "BR",
|
|
492
|
+
id_doc_type: "PASSPORT",
|
|
493
|
+
id_doc_front_file: "https://example.com/image.png",
|
|
494
|
+
id_doc_back_file: "https://example.com/image.png",
|
|
495
|
+
alternate_name: "Exemplo",
|
|
496
|
+
formation_date: "2010-05-20T00:00:00.000Z",
|
|
497
|
+
website: "https://site.com",
|
|
498
|
+
owners: [
|
|
499
|
+
{
|
|
500
|
+
first_name: "Carlos",
|
|
501
|
+
last_name: "Silva",
|
|
502
|
+
role: "beneficial_owner",
|
|
503
|
+
date_of_birth: "1995-05-15T00:00:00.000Z",
|
|
504
|
+
tax_id: "12345678901",
|
|
505
|
+
address_line_1: "Rua Augusta, 1500",
|
|
506
|
+
address_line_2: null,
|
|
507
|
+
city: "S\xE3o Paulo",
|
|
508
|
+
state_province_region: "SP",
|
|
509
|
+
country: "BR",
|
|
510
|
+
postal_code: "01304-001",
|
|
511
|
+
id_doc_country: "BR",
|
|
512
|
+
id_doc_type: "PASSPORT",
|
|
513
|
+
id_doc_front_file: "https://example.com/image.png",
|
|
514
|
+
id_doc_back_file: "https://example.com/image.png",
|
|
515
|
+
proof_of_address_doc_type: "UTILITY_BILL",
|
|
516
|
+
proof_of_address_doc_file: "https://example.com/image.png",
|
|
517
|
+
ownership_percentage: 25,
|
|
518
|
+
title: "CEO"
|
|
519
|
+
}
|
|
520
|
+
],
|
|
521
|
+
incorporation_doc_file: "https://example.com/image.png",
|
|
522
|
+
proof_of_ownership_doc_file: "https://example.com/image.png",
|
|
523
|
+
source_of_funds_doc_type: "savings",
|
|
524
|
+
source_of_funds_doc_file: "https://example.com/image.png",
|
|
525
|
+
purpose_of_transactions: "personal_or_living_expenses",
|
|
526
|
+
purpose_of_transactions_explanation: "I am receiving salary payments from my employer",
|
|
527
|
+
external_id: "some-external-id",
|
|
528
|
+
tos_id: "to_3ZZhllJkvo5Z"
|
|
529
|
+
});
|
|
530
|
+
globalExpect(error).toBeNull();
|
|
531
|
+
globalExpect(data).toEqual({ data: null });
|
|
532
|
+
}));
|
|
533
|
+
});
|
|
534
|
+
describe("Delete customer", () => {
|
|
535
|
+
it("should delete a customer", () => __async(null, null, function* () {
|
|
536
|
+
fetchMock.mockResponseOnce(JSON.stringify({ data: null }), {
|
|
537
|
+
headers: { "Content-Type": "application/json" }
|
|
538
|
+
});
|
|
539
|
+
const { data, error } = yield blindpay.customers.delete("re_YuaMcI2B8zbQ");
|
|
540
|
+
globalExpect(error).toBeNull();
|
|
541
|
+
globalExpect(data).toEqual({ data: null });
|
|
542
|
+
}));
|
|
543
|
+
});
|
|
544
|
+
describe("Get customer limits", () => {
|
|
545
|
+
it("should get customer limits", () => __async(null, null, function* () {
|
|
546
|
+
const mockedCustomerLimits = {
|
|
547
|
+
limits: {
|
|
548
|
+
payin: {
|
|
549
|
+
daily: 1e4,
|
|
550
|
+
monthly: 5e4
|
|
551
|
+
},
|
|
552
|
+
payout: {
|
|
553
|
+
daily: 2e4,
|
|
554
|
+
monthly: 1e5
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
};
|
|
558
|
+
fetchMock.mockResponseOnce(JSON.stringify(mockedCustomerLimits), {
|
|
559
|
+
headers: { "Content-Type": "application/json" }
|
|
560
|
+
});
|
|
561
|
+
const { data, error } = yield blindpay.customers.getLimits("re_YuaMcI2B8zbQ");
|
|
562
|
+
globalExpect(error).toBeNull();
|
|
563
|
+
globalExpect(data).toEqual(mockedCustomerLimits);
|
|
564
|
+
}));
|
|
565
|
+
});
|
|
566
|
+
describe("Get limit increase requests", () => {
|
|
567
|
+
it("should get limit increase requests for a customer", () => __async(null, null, function* () {
|
|
568
|
+
const mockedLimitIncreaseRequests = [
|
|
569
|
+
{
|
|
570
|
+
id: "rl_000000000000",
|
|
571
|
+
customer_id: "re_YuaMcI2B8zbQ",
|
|
572
|
+
status: "in_review",
|
|
573
|
+
daily: 5e4,
|
|
574
|
+
monthly: 25e4,
|
|
575
|
+
per_transaction: 25e3,
|
|
576
|
+
supporting_document_file: "https://example.com/bank-statement.pdf",
|
|
577
|
+
supporting_document_type: "individual_bank_statement",
|
|
578
|
+
created_at: "2025-01-15T10:30:00.000Z",
|
|
579
|
+
updated_at: "2025-01-15T10:30:00.000Z"
|
|
580
|
+
},
|
|
581
|
+
{
|
|
582
|
+
id: "rl_000000000000",
|
|
583
|
+
customer_id: "re_YuaMcI2B8zbQ",
|
|
584
|
+
status: "approved",
|
|
585
|
+
daily: 3e4,
|
|
586
|
+
monthly: 15e4,
|
|
587
|
+
per_transaction: 15e3,
|
|
588
|
+
supporting_document_file: "https://example.com/proof-of-income.pdf",
|
|
589
|
+
supporting_document_type: "individual_proof_of_income",
|
|
590
|
+
created_at: "2024-12-10T14:20:00.000Z",
|
|
591
|
+
updated_at: "2024-12-12T09:45:00.000Z"
|
|
592
|
+
}
|
|
593
|
+
];
|
|
594
|
+
fetchMock.mockResponseOnce(JSON.stringify(mockedLimitIncreaseRequests), {
|
|
595
|
+
headers: { "Content-Type": "application/json" }
|
|
596
|
+
});
|
|
597
|
+
const { data, error } = yield blindpay.customers.getLimitIncreaseRequests("re_YuaMcI2B8zbQ");
|
|
598
|
+
globalExpect(error).toBeNull();
|
|
599
|
+
globalExpect(data).toEqual(mockedLimitIncreaseRequests);
|
|
600
|
+
}));
|
|
601
|
+
});
|
|
602
|
+
describe("Get limit increase requests with approved fields", () => {
|
|
603
|
+
it("should get limit increase requests with approved amounts", () => __async(null, null, function* () {
|
|
604
|
+
const mockedLimitIncreaseRequests = [
|
|
605
|
+
{
|
|
606
|
+
id: "rl_000000000000",
|
|
607
|
+
customer_id: "re_YuaMcI2B8zbQ",
|
|
608
|
+
status: "approved",
|
|
609
|
+
daily: 5e4,
|
|
610
|
+
monthly: 25e4,
|
|
611
|
+
per_transaction: 25e3,
|
|
612
|
+
supporting_document_file: "https://example.com/bank-statement.pdf",
|
|
613
|
+
supporting_document_type: "individual_bank_statement",
|
|
614
|
+
created_at: "2025-01-15T10:30:00.000Z",
|
|
615
|
+
updated_at: "2025-01-15T10:30:00.000Z",
|
|
616
|
+
approved_per_transaction: 2e4,
|
|
617
|
+
approved_daily: 4e4,
|
|
618
|
+
approved_monthly: 2e5
|
|
619
|
+
}
|
|
620
|
+
];
|
|
621
|
+
fetchMock.mockResponseOnce(JSON.stringify(mockedLimitIncreaseRequests), {
|
|
622
|
+
headers: { "Content-Type": "application/json" }
|
|
623
|
+
});
|
|
624
|
+
const { data, error } = yield blindpay.customers.getLimitIncreaseRequests("re_YuaMcI2B8zbQ");
|
|
625
|
+
globalExpect(error).toBeNull();
|
|
626
|
+
globalExpect(data).toEqual(mockedLimitIncreaseRequests);
|
|
627
|
+
}));
|
|
628
|
+
});
|
|
629
|
+
describe("Request limit increase", () => {
|
|
630
|
+
it("should request a limit increase for a customer", () => __async(null, null, function* () {
|
|
631
|
+
const mockedResponse = {
|
|
632
|
+
id: "rl_000000000000"
|
|
633
|
+
};
|
|
634
|
+
fetchMock.mockResponseOnce(JSON.stringify(mockedResponse), {
|
|
635
|
+
headers: { "Content-Type": "application/json" }
|
|
636
|
+
});
|
|
637
|
+
const { data, error } = yield blindpay.customers.requestLimitIncrease({
|
|
638
|
+
customer_id: "re_YuaMcI2B8zbQ",
|
|
639
|
+
daily: 1e5,
|
|
640
|
+
monthly: 5e5,
|
|
641
|
+
per_transaction: 5e4,
|
|
642
|
+
supporting_document_file: "https://example.com/tax-return.pdf",
|
|
643
|
+
supporting_document_type: "individual_tax_return"
|
|
644
|
+
});
|
|
645
|
+
globalExpect(error).toBeNull();
|
|
646
|
+
globalExpect(data).toEqual(mockedResponse);
|
|
647
|
+
}));
|
|
648
|
+
});
|
|
649
|
+
});
|
|
650
|
+
}
|
|
651
|
+
});
|
|
652
|
+
export default require_customers_test();
|