@blindpay/node 1.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.
- package/LICENSE +21 -0
- package/README.md +124 -0
- package/dist/api-client-Cw2mNJeR.d.mts +349 -0
- package/dist/api-client-Cw2mNJeR.d.ts +349 -0
- package/dist/chunk-2DAKB5XK.mjs +212 -0
- package/dist/chunk-3CZJEDS5.mjs +41 -0
- package/dist/chunk-CNNEROQ7.mjs +46 -0
- package/dist/chunk-ES7RXEM7.mjs +245 -0
- package/dist/chunk-GCCHFONX.mjs +17893 -0
- package/dist/chunk-GEDDLCJY.mjs +77 -0
- package/dist/chunk-GNDAATIJ.mjs +35 -0
- package/dist/chunk-HKFAJXJG.mjs +65 -0
- package/dist/chunk-LK3JPQ6I.mjs +49 -0
- package/dist/chunk-LLWEHHKB.mjs +47 -0
- package/dist/chunk-LUDGZPXY.mjs +51 -0
- package/dist/chunk-M6IYYMRW.mjs +35 -0
- package/dist/chunk-OBKEW4AQ.mjs +91 -0
- package/dist/chunk-QHMIK7U3.mjs +24 -0
- package/dist/chunk-QVOSGLUO.mjs +36 -0
- package/dist/chunk-UCAW3RTZ.mjs +47 -0
- package/dist/chunk-VKN2AMCW.mjs +57 -0
- package/dist/index.d.mts +81 -0
- package/dist/index.d.ts +81 -0
- package/dist/index.js +895 -0
- package/dist/index.mjs +95 -0
- package/dist/magic-string.es-6D2DRE4K.mjs +1325 -0
- package/dist/resources/api-keys/api-keys.test.d.mts +2 -0
- package/dist/resources/api-keys/api-keys.test.d.ts +2 -0
- package/dist/resources/api-keys/api-keys.test.js +19881 -0
- package/dist/resources/api-keys/api-keys.test.mjs +130 -0
- package/dist/resources/api-keys/index.d.mts +45 -0
- package/dist/resources/api-keys/index.d.ts +45 -0
- package/dist/resources/api-keys/index.js +64 -0
- package/dist/resources/api-keys/index.mjs +9 -0
- package/dist/resources/available/available.test.d.mts +2 -0
- package/dist/resources/available/available.test.d.ts +2 -0
- package/dist/resources/available/available.test.js +19877 -0
- package/dist/resources/available/available.test.mjs +122 -0
- package/dist/resources/available/index.d.mts +25 -0
- package/dist/resources/available/index.d.ts +25 -0
- package/dist/resources/available/index.js +39 -0
- package/dist/resources/available/index.mjs +9 -0
- package/dist/resources/bank-accounts/bank-accounts.test.d.mts +2 -0
- package/dist/resources/bank-accounts/bank-accounts.test.d.ts +2 -0
- package/dist/resources/bank-accounts/bank-accounts.test.js +20173 -0
- package/dist/resources/bank-accounts/bank-accounts.test.mjs +418 -0
- package/dist/resources/bank-accounts/index.d.mts +414 -0
- package/dist/resources/bank-accounts/index.d.ts +414 -0
- package/dist/resources/bank-accounts/index.js +227 -0
- package/dist/resources/bank-accounts/index.mjs +9 -0
- package/dist/resources/instances/index.d.mts +42 -0
- package/dist/resources/instances/index.d.ts +42 -0
- package/dist/resources/instances/index.js +75 -0
- package/dist/resources/instances/index.mjs +9 -0
- package/dist/resources/instances/instances.test.d.mts +2 -0
- package/dist/resources/instances/instances.test.d.ts +2 -0
- package/dist/resources/instances/instances.test.js +19873 -0
- package/dist/resources/instances/instances.test.mjs +118 -0
- package/dist/resources/partner-fees/index.d.mts +65 -0
- package/dist/resources/partner-fees/index.d.ts +65 -0
- package/dist/resources/partner-fees/index.js +69 -0
- package/dist/resources/partner-fees/index.mjs +9 -0
- package/dist/resources/partner-fees/partner-fees.test.d.mts +2 -0
- package/dist/resources/partner-fees/partner-fees.test.d.ts +2 -0
- package/dist/resources/partner-fees/partner-fees.test.js +19889 -0
- package/dist/resources/partner-fees/partner-fees.test.mjs +134 -0
- package/dist/resources/payins/index.d.mts +200 -0
- package/dist/resources/payins/index.d.ts +200 -0
- package/dist/resources/payins/index.js +75 -0
- package/dist/resources/payins/index.mjs +9 -0
- package/dist/resources/payins/payins-quotes.test.d.mts +2 -0
- package/dist/resources/payins/payins-quotes.test.d.ts +2 -0
- package/dist/resources/payins/payins-quotes.test.js +19852 -0
- package/dist/resources/payins/payins-quotes.test.mjs +97 -0
- package/dist/resources/payins/payins.test.d.mts +2 -0
- package/dist/resources/payins/payins.test.d.ts +2 -0
- package/dist/resources/payins/payins.test.js +20268 -0
- package/dist/resources/payins/payins.test.mjs +513 -0
- package/dist/resources/payins/quotes.d.mts +45 -0
- package/dist/resources/payins/quotes.d.ts +45 -0
- package/dist/resources/payins/quotes.js +63 -0
- package/dist/resources/payins/quotes.mjs +9 -0
- package/dist/resources/payouts/index.d.mts +155 -0
- package/dist/resources/payouts/index.d.ts +155 -0
- package/dist/resources/payouts/index.js +93 -0
- package/dist/resources/payouts/index.mjs +9 -0
- package/dist/resources/payouts/payouts.test.d.mts +2 -0
- package/dist/resources/payouts/payouts.test.d.ts +2 -0
- package/dist/resources/payouts/payouts.test.js +20346 -0
- package/dist/resources/payouts/payouts.test.mjs +591 -0
- package/dist/resources/quotes/index.d.mts +59 -0
- package/dist/resources/quotes/index.d.ts +59 -0
- package/dist/resources/quotes/index.js +63 -0
- package/dist/resources/quotes/index.mjs +9 -0
- package/dist/resources/quotes/quotes.test.d.mts +2 -0
- package/dist/resources/quotes/quotes.test.d.ts +2 -0
- package/dist/resources/quotes/quotes.test.js +19866 -0
- package/dist/resources/quotes/quotes.test.mjs +111 -0
- package/dist/resources/receivers/index.d.mts +205 -0
- package/dist/resources/receivers/index.d.ts +205 -0
- package/dist/resources/receivers/index.js +85 -0
- package/dist/resources/receivers/index.mjs +9 -0
- package/dist/resources/receivers/receivers.test.d.mts +2 -0
- package/dist/resources/receivers/receivers.test.d.ts +2 -0
- package/dist/resources/receivers/receivers.test.js +20145 -0
- package/dist/resources/receivers/receivers.test.mjs +390 -0
- package/dist/resources/virtual-accounts/index.d.mts +58 -0
- package/dist/resources/virtual-accounts/index.d.ts +58 -0
- package/dist/resources/virtual-accounts/index.js +79 -0
- package/dist/resources/virtual-accounts/index.mjs +9 -0
- package/dist/resources/virtual-accounts/virtual-accounts.test.d.mts +2 -0
- package/dist/resources/virtual-accounts/virtual-accounts.test.d.ts +2 -0
- package/dist/resources/virtual-accounts/virtual-accounts.test.js +19902 -0
- package/dist/resources/virtual-accounts/virtual-accounts.test.mjs +147 -0
- package/dist/resources/wallets/blockchain.d.mts +83 -0
- package/dist/resources/wallets/blockchain.d.ts +83 -0
- package/dist/resources/wallets/blockchain.js +105 -0
- package/dist/resources/wallets/blockchain.mjs +9 -0
- package/dist/resources/wallets/blockchain.test.d.mts +2 -0
- package/dist/resources/wallets/blockchain.test.d.ts +2 -0
- package/dist/resources/wallets/blockchain.test.js +19897 -0
- package/dist/resources/wallets/blockchain.test.mjs +142 -0
- package/dist/resources/wallets/offramp.d.mts +46 -0
- package/dist/resources/wallets/offramp.d.ts +46 -0
- package/dist/resources/wallets/offramp.js +77 -0
- package/dist/resources/wallets/offramp.mjs +9 -0
- package/dist/resources/wallets/offramp.test.d.mts +2 -0
- package/dist/resources/wallets/offramp.test.d.ts +2 -0
- package/dist/resources/wallets/offramp.test.js +19872 -0
- package/dist/resources/wallets/offramp.test.mjs +117 -0
- package/dist/resources/webhooks/index.d.mts +49 -0
- package/dist/resources/webhooks/index.d.ts +49 -0
- package/dist/resources/webhooks/index.js +74 -0
- package/dist/resources/webhooks/index.mjs +9 -0
- package/dist/resources/webhooks/webhooks.test.d.mts +2 -0
- package/dist/resources/webhooks/webhooks.test.d.ts +2 -0
- package/dist/resources/webhooks/webhooks.test.js +19878 -0
- package/dist/resources/webhooks/webhooks.test.mjs +123 -0
- package/package.json +65 -0
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
import {
|
|
2
|
+
afterEach,
|
|
3
|
+
describe,
|
|
4
|
+
globalExpect,
|
|
5
|
+
init_dist,
|
|
6
|
+
it
|
|
7
|
+
} from "../../chunk-GCCHFONX.mjs";
|
|
8
|
+
import {
|
|
9
|
+
Blindpay,
|
|
10
|
+
init_client
|
|
11
|
+
} from "../../chunk-ES7RXEM7.mjs";
|
|
12
|
+
import "../../chunk-GEDDLCJY.mjs";
|
|
13
|
+
import "../../chunk-LK3JPQ6I.mjs";
|
|
14
|
+
import "../../chunk-CNNEROQ7.mjs";
|
|
15
|
+
import "../../chunk-GNDAATIJ.mjs";
|
|
16
|
+
import "../../chunk-VKN2AMCW.mjs";
|
|
17
|
+
import "../../chunk-LUDGZPXY.mjs";
|
|
18
|
+
import "../../chunk-3CZJEDS5.mjs";
|
|
19
|
+
import "../../chunk-UCAW3RTZ.mjs";
|
|
20
|
+
import "../../chunk-M6IYYMRW.mjs";
|
|
21
|
+
import "../../chunk-HKFAJXJG.mjs";
|
|
22
|
+
import "../../chunk-QVOSGLUO.mjs";
|
|
23
|
+
import "../../chunk-2DAKB5XK.mjs";
|
|
24
|
+
import "../../chunk-QHMIK7U3.mjs";
|
|
25
|
+
import "../../chunk-LLWEHHKB.mjs";
|
|
26
|
+
import {
|
|
27
|
+
__async,
|
|
28
|
+
__commonJS
|
|
29
|
+
} from "../../chunk-OBKEW4AQ.mjs";
|
|
30
|
+
|
|
31
|
+
// src/resources/bank-accounts/bank-accounts.test.ts
|
|
32
|
+
var require_bank_accounts_test = __commonJS({
|
|
33
|
+
"src/resources/bank-accounts/bank-accounts.test.ts"(exports) {
|
|
34
|
+
init_dist();
|
|
35
|
+
init_client();
|
|
36
|
+
describe("Bank accounts", () => {
|
|
37
|
+
afterEach(() => fetchMock.resetMocks());
|
|
38
|
+
const blindpay = new Blindpay("test-key");
|
|
39
|
+
describe("Create pix bank account", () => {
|
|
40
|
+
it("should create a pix bank account", () => __async(null, null, function* () {
|
|
41
|
+
const mockedPixAccount = {
|
|
42
|
+
id: "ba_000000000000",
|
|
43
|
+
type: "pix",
|
|
44
|
+
name: "PIX Account",
|
|
45
|
+
pix_key: "14947677768",
|
|
46
|
+
created_at: "2021-01-01T00:00:00Z"
|
|
47
|
+
};
|
|
48
|
+
fetchMock.mockResponseOnce(JSON.stringify(mockedPixAccount), {
|
|
49
|
+
headers: { "Content-Type": "application/json" }
|
|
50
|
+
});
|
|
51
|
+
const { data, error } = yield blindpay.receivers.bankAccounts.createPix({
|
|
52
|
+
instanceId: "in_000000000000",
|
|
53
|
+
receiverId: "re_000000000000",
|
|
54
|
+
name: "PIX Account",
|
|
55
|
+
pix_key: "14947677768"
|
|
56
|
+
});
|
|
57
|
+
globalExpect(error).toBeNull();
|
|
58
|
+
globalExpect(data).toEqual(mockedPixAccount);
|
|
59
|
+
}));
|
|
60
|
+
});
|
|
61
|
+
describe("Create argentina transfers bank account", () => {
|
|
62
|
+
it("should create an argentina transfers bank account", () => __async(null, null, function* () {
|
|
63
|
+
const mockedArgentinaTransfersAccount = {
|
|
64
|
+
id: "ba_000000000000",
|
|
65
|
+
type: "transfers_bitso",
|
|
66
|
+
name: "Argentina Transfers Account",
|
|
67
|
+
beneficiary_name: "Individual full name or business name",
|
|
68
|
+
transfers_type: "CVU",
|
|
69
|
+
transfers_account: "BM123123123123",
|
|
70
|
+
created_at: "2021-01-01T00:00:00Z"
|
|
71
|
+
};
|
|
72
|
+
fetchMock.mockResponseOnce(JSON.stringify(mockedArgentinaTransfersAccount), {
|
|
73
|
+
headers: { "Content-Type": "application/json" }
|
|
74
|
+
});
|
|
75
|
+
const { data, error } = yield blindpay.receivers.bankAccounts.createArgentinaTransfers({
|
|
76
|
+
instanceId: "in_000000000000",
|
|
77
|
+
receiverId: "re_000000000000",
|
|
78
|
+
name: "Argentina Transfers Account",
|
|
79
|
+
beneficiary_name: "Individual full name or business name",
|
|
80
|
+
transfers_type: "CVU",
|
|
81
|
+
transfers_account: "BM123123123123"
|
|
82
|
+
});
|
|
83
|
+
globalExpect(error).toBeNull();
|
|
84
|
+
globalExpect(data).toEqual(mockedArgentinaTransfersAccount);
|
|
85
|
+
}));
|
|
86
|
+
});
|
|
87
|
+
describe("Create spei bank account", () => {
|
|
88
|
+
it("should create a spei bank account", () => __async(null, null, function* () {
|
|
89
|
+
const mockedSpeiAccount = {
|
|
90
|
+
id: "ba_000000000000",
|
|
91
|
+
type: "spei_bitso",
|
|
92
|
+
name: "SPEI Account",
|
|
93
|
+
beneficiary_name: "Individual full name or business name",
|
|
94
|
+
spei_protocol: "clabe",
|
|
95
|
+
spei_institution_code: "40002",
|
|
96
|
+
spei_clabe: "5482347403740546",
|
|
97
|
+
created_at: "2021-01-01T00:00:00Z"
|
|
98
|
+
};
|
|
99
|
+
fetchMock.mockResponseOnce(JSON.stringify(mockedSpeiAccount), {
|
|
100
|
+
headers: { "Content-Type": "application/json" }
|
|
101
|
+
});
|
|
102
|
+
const { data, error } = yield blindpay.receivers.bankAccounts.createSpei({
|
|
103
|
+
instanceId: "in_000000000000",
|
|
104
|
+
receiverId: "re_000000000000",
|
|
105
|
+
name: "SPEI Account",
|
|
106
|
+
beneficiary_name: "Individual full name or business name",
|
|
107
|
+
spei_protocol: "clabe",
|
|
108
|
+
spei_institution_code: "40002",
|
|
109
|
+
spei_clabe: "5482347403740546"
|
|
110
|
+
});
|
|
111
|
+
globalExpect(error).toBeNull();
|
|
112
|
+
globalExpect(data).toEqual(mockedSpeiAccount);
|
|
113
|
+
}));
|
|
114
|
+
});
|
|
115
|
+
describe("Create colombia ach bank account", () => {
|
|
116
|
+
it("should create a colombia ach bank account", () => __async(null, null, function* () {
|
|
117
|
+
const mockedColombiaAchAccount = {
|
|
118
|
+
id: "ba_000000000000",
|
|
119
|
+
type: "ach_cop_bitso",
|
|
120
|
+
name: "Colombia ACH Account",
|
|
121
|
+
account_type: "checking",
|
|
122
|
+
ach_cop_beneficiary_first_name: "Fernando",
|
|
123
|
+
ach_cop_beneficiary_last_name: "Guzman Alarc\xF3n",
|
|
124
|
+
ach_cop_document_id: "1661105408",
|
|
125
|
+
ach_cop_document_type: "CC",
|
|
126
|
+
ach_cop_email: "fernando.guzman@gmail.com",
|
|
127
|
+
ach_cop_bank_code: "051",
|
|
128
|
+
ach_cop_bank_account: "12345678",
|
|
129
|
+
created_at: "2021-01-01T00:00:00Z"
|
|
130
|
+
};
|
|
131
|
+
fetchMock.mockResponseOnce(JSON.stringify(mockedColombiaAchAccount), {
|
|
132
|
+
headers: { "Content-Type": "application/json" }
|
|
133
|
+
});
|
|
134
|
+
const { data, error } = yield blindpay.receivers.bankAccounts.createColombiaAch({
|
|
135
|
+
instanceId: "in_000000000000",
|
|
136
|
+
receiverId: "re_000000000000",
|
|
137
|
+
name: "Colombia ACH Account",
|
|
138
|
+
account_type: "checking",
|
|
139
|
+
ach_cop_beneficiary_first_name: "Fernando",
|
|
140
|
+
ach_cop_beneficiary_last_name: "Guzman Alarc\xF3n",
|
|
141
|
+
ach_cop_document_id: "1661105408",
|
|
142
|
+
ach_cop_document_type: "CC",
|
|
143
|
+
ach_cop_email: "fernando.guzman@gmail.com",
|
|
144
|
+
ach_cop_bank_code: "051",
|
|
145
|
+
ach_cop_bank_account: "12345678"
|
|
146
|
+
});
|
|
147
|
+
globalExpect(error).toBeNull();
|
|
148
|
+
globalExpect(data).toEqual(mockedColombiaAchAccount);
|
|
149
|
+
}));
|
|
150
|
+
});
|
|
151
|
+
describe("Create ach bank account", () => {
|
|
152
|
+
it("should create an ach bank account", () => __async(null, null, function* () {
|
|
153
|
+
const mockedAchAccount = {
|
|
154
|
+
id: "ba_000000000000",
|
|
155
|
+
type: "ach",
|
|
156
|
+
name: "ACH Account",
|
|
157
|
+
beneficiary_name: "Individual full name or business name",
|
|
158
|
+
routing_number: "012345678",
|
|
159
|
+
account_number: "1001001234",
|
|
160
|
+
account_type: "checking",
|
|
161
|
+
account_class: "individual",
|
|
162
|
+
address_line_1: null,
|
|
163
|
+
address_line_2: null,
|
|
164
|
+
city: null,
|
|
165
|
+
state_province_region: null,
|
|
166
|
+
country: null,
|
|
167
|
+
postal_code: null,
|
|
168
|
+
ach_cop_beneficiary_first_name: null,
|
|
169
|
+
ach_cop_beneficiary_last_name: null,
|
|
170
|
+
ach_cop_document_id: null,
|
|
171
|
+
ach_cop_document_type: null,
|
|
172
|
+
ach_cop_email: null,
|
|
173
|
+
ach_cop_bank_code: null,
|
|
174
|
+
ach_cop_bank_account: null,
|
|
175
|
+
created_at: "2021-01-01T00:00:00Z"
|
|
176
|
+
};
|
|
177
|
+
fetchMock.mockResponseOnce(JSON.stringify(mockedAchAccount), {
|
|
178
|
+
headers: { "Content-Type": "application/json" }
|
|
179
|
+
});
|
|
180
|
+
const { data, error } = yield blindpay.receivers.bankAccounts.createAch({
|
|
181
|
+
instanceId: "in_000000000000",
|
|
182
|
+
receiverId: "re_000000000000",
|
|
183
|
+
name: "ACH Account",
|
|
184
|
+
account_class: "individual",
|
|
185
|
+
account_number: "1001001234",
|
|
186
|
+
account_type: "checking",
|
|
187
|
+
beneficiary_name: "Individual full name or business name",
|
|
188
|
+
routing_number: "012345678"
|
|
189
|
+
});
|
|
190
|
+
globalExpect(error).toBeNull();
|
|
191
|
+
globalExpect(data).toEqual(mockedAchAccount);
|
|
192
|
+
}));
|
|
193
|
+
});
|
|
194
|
+
describe("Create wire bank account", () => {
|
|
195
|
+
it("should create a wire bank account", () => __async(null, null, function* () {
|
|
196
|
+
const mockedWireAccount = {
|
|
197
|
+
id: "ba_000000000000",
|
|
198
|
+
type: "wire",
|
|
199
|
+
name: "Wire Account",
|
|
200
|
+
beneficiary_name: "Individual full name or business name",
|
|
201
|
+
routing_number: "012345678",
|
|
202
|
+
account_number: "1001001234",
|
|
203
|
+
address_line_1: "Address line 1",
|
|
204
|
+
address_line_2: "Address line 2",
|
|
205
|
+
city: "City",
|
|
206
|
+
state_province_region: "State/Province/Region",
|
|
207
|
+
country: "US",
|
|
208
|
+
postal_code: "Postal code",
|
|
209
|
+
created_at: "2021-01-01T00:00:00Z"
|
|
210
|
+
};
|
|
211
|
+
fetchMock.mockResponseOnce(JSON.stringify(mockedWireAccount), {
|
|
212
|
+
headers: { "Content-Type": "application/json" }
|
|
213
|
+
});
|
|
214
|
+
const { data, error } = yield blindpay.receivers.bankAccounts.createWire({
|
|
215
|
+
instanceId: "in_000000000000",
|
|
216
|
+
receiverId: "re_000000000000",
|
|
217
|
+
name: "Wire Account",
|
|
218
|
+
account_number: "1001001234",
|
|
219
|
+
beneficiary_name: "Individual full name or business name",
|
|
220
|
+
routing_number: "012345678",
|
|
221
|
+
address_line_1: "Address line 1",
|
|
222
|
+
address_line_2: "Address line 2",
|
|
223
|
+
city: "City",
|
|
224
|
+
state_province_region: "State/Province/Region",
|
|
225
|
+
country: "US",
|
|
226
|
+
postal_code: "Postal code"
|
|
227
|
+
});
|
|
228
|
+
globalExpect(error).toBeNull();
|
|
229
|
+
globalExpect(data).toEqual(mockedWireAccount);
|
|
230
|
+
}));
|
|
231
|
+
});
|
|
232
|
+
describe("Create international swift bank account", () => {
|
|
233
|
+
it("should create an international swift bank account", () => __async(null, null, function* () {
|
|
234
|
+
const mockedInternationalSwiftAccount = {
|
|
235
|
+
id: "ba_000000000000",
|
|
236
|
+
type: "international_swift",
|
|
237
|
+
name: "International Swift Account",
|
|
238
|
+
beneficiary_name: null,
|
|
239
|
+
address_line_1: null,
|
|
240
|
+
address_line_2: null,
|
|
241
|
+
city: null,
|
|
242
|
+
state_province_region: null,
|
|
243
|
+
country: null,
|
|
244
|
+
postal_code: null,
|
|
245
|
+
swift_code_bic: "123456789",
|
|
246
|
+
swift_account_holder_name: "John Doe",
|
|
247
|
+
swift_account_number_iban: "123456789",
|
|
248
|
+
swift_beneficiary_address_line_1: "123 Main Street, Suite 100, Downtown District, City Center CP 12345",
|
|
249
|
+
swift_beneficiary_address_line_2: null,
|
|
250
|
+
swift_beneficiary_country: "MX",
|
|
251
|
+
swift_beneficiary_city: "City",
|
|
252
|
+
swift_beneficiary_state_province_region: "District",
|
|
253
|
+
swift_beneficiary_postal_code: "11530",
|
|
254
|
+
swift_bank_name: "Banco Regional SA",
|
|
255
|
+
swift_bank_address_line_1: "123 Main Street, Suite 100, Downtown District, City Center CP 12345",
|
|
256
|
+
swift_bank_address_line_2: null,
|
|
257
|
+
swift_bank_country: "MX",
|
|
258
|
+
swift_bank_city: "City",
|
|
259
|
+
swift_bank_state_province_region: "District",
|
|
260
|
+
swift_bank_postal_code: "11530",
|
|
261
|
+
swift_intermediary_bank_swift_code_bic: null,
|
|
262
|
+
swift_intermediary_bank_account_number_iban: null,
|
|
263
|
+
swift_intermediary_bank_name: null,
|
|
264
|
+
swift_intermediary_bank_country: null,
|
|
265
|
+
created_at: "2021-01-01T00:00:00Z"
|
|
266
|
+
};
|
|
267
|
+
fetchMock.mockResponseOnce(JSON.stringify(mockedInternationalSwiftAccount), {
|
|
268
|
+
headers: { "Content-Type": "application/json" }
|
|
269
|
+
});
|
|
270
|
+
const { data, error } = yield blindpay.receivers.bankAccounts.createInternationalSwift({
|
|
271
|
+
instanceId: "in_000000000000",
|
|
272
|
+
receiverId: "re_000000000000",
|
|
273
|
+
name: "International Swift Account",
|
|
274
|
+
swift_account_holder_name: "John Doe",
|
|
275
|
+
swift_account_number_iban: "123456789",
|
|
276
|
+
swift_bank_address_line_1: "123 Main Street, Suite 100, Downtown District, City Center CP 12345",
|
|
277
|
+
swift_bank_city: "City",
|
|
278
|
+
swift_bank_country: "MX",
|
|
279
|
+
swift_bank_name: "Banco Regional SA",
|
|
280
|
+
swift_bank_postal_code: "11530",
|
|
281
|
+
swift_bank_state_province_region: "District",
|
|
282
|
+
swift_beneficiary_address_line_1: "123 Main Street, Suite 100, Downtown District, City Center CP 12345",
|
|
283
|
+
swift_beneficiary_city: "City",
|
|
284
|
+
swift_beneficiary_country: "MX",
|
|
285
|
+
swift_beneficiary_postal_code: "11530",
|
|
286
|
+
swift_beneficiary_state_province_region: "District",
|
|
287
|
+
swift_code_bic: "123456789",
|
|
288
|
+
swift_intermediary_bank_account_number_iban: null,
|
|
289
|
+
swift_intermediary_bank_country: null,
|
|
290
|
+
swift_intermediary_bank_name: null,
|
|
291
|
+
swift_intermediary_bank_swift_code_bic: null
|
|
292
|
+
});
|
|
293
|
+
globalExpect(error).toBeNull();
|
|
294
|
+
globalExpect(data).toEqual(mockedInternationalSwiftAccount);
|
|
295
|
+
}));
|
|
296
|
+
});
|
|
297
|
+
describe("Get bank account", () => {
|
|
298
|
+
it("should get a bank account", () => __async(null, null, function* () {
|
|
299
|
+
const mockedBankAccount = {
|
|
300
|
+
id: "ba_000000000000",
|
|
301
|
+
receiver_id: "rcv_123",
|
|
302
|
+
account_holder_name: "Individual full name or business name",
|
|
303
|
+
account_number: "1001001234",
|
|
304
|
+
routing_number: "012345678",
|
|
305
|
+
account_type: "checking",
|
|
306
|
+
bank_name: "Bank Name",
|
|
307
|
+
swift_code: "123456789",
|
|
308
|
+
iban: null,
|
|
309
|
+
is_primary: false,
|
|
310
|
+
created_at: "2021-01-01T00:00:00Z",
|
|
311
|
+
updated_at: "2021-01-01T00:00:00Z"
|
|
312
|
+
};
|
|
313
|
+
fetchMock.mockResponseOnce(JSON.stringify(mockedBankAccount), {
|
|
314
|
+
headers: { "Content-Type": "application/json" }
|
|
315
|
+
});
|
|
316
|
+
const { data, error } = yield blindpay.receivers.bankAccounts.get({
|
|
317
|
+
instanceId: "in_000000000000",
|
|
318
|
+
receiverId: "re_000000000000",
|
|
319
|
+
id: "ba_000000000000"
|
|
320
|
+
});
|
|
321
|
+
globalExpect(error).toBeNull();
|
|
322
|
+
globalExpect(data).toEqual(mockedBankAccount);
|
|
323
|
+
}));
|
|
324
|
+
});
|
|
325
|
+
describe("List bank accounts", () => {
|
|
326
|
+
it("should list bank accounts", () => __async(null, null, function* () {
|
|
327
|
+
const mockedBankAccounts = {
|
|
328
|
+
data: [
|
|
329
|
+
{
|
|
330
|
+
id: "ba_000000000000",
|
|
331
|
+
type: "wire",
|
|
332
|
+
name: "Bank Account Name",
|
|
333
|
+
pix_key: "14947677768",
|
|
334
|
+
beneficiary_name: "Individual full name or business name",
|
|
335
|
+
routing_number: "012345678",
|
|
336
|
+
account_number: "1001001234",
|
|
337
|
+
account_type: "checking",
|
|
338
|
+
account_class: "individual",
|
|
339
|
+
address_line_1: "Address line 1",
|
|
340
|
+
address_line_2: "Address line 2",
|
|
341
|
+
city: "City",
|
|
342
|
+
state_province_region: "State/Province/Region",
|
|
343
|
+
country: "US",
|
|
344
|
+
postal_code: "Postal code",
|
|
345
|
+
spei_protocol: "clabe",
|
|
346
|
+
spei_institution_code: "40002",
|
|
347
|
+
spei_clabe: "5482347403740546",
|
|
348
|
+
transfers_type: "CVU",
|
|
349
|
+
transfers_account: "BM123123123123",
|
|
350
|
+
ach_cop_beneficiary_first_name: "Fernando",
|
|
351
|
+
ach_cop_beneficiary_last_name: "Guzman Alarc\xF3n",
|
|
352
|
+
ach_cop_document_id: "1661105408",
|
|
353
|
+
ach_cop_document_type: "CC",
|
|
354
|
+
ach_cop_email: "fernando.guzman@gmail.com",
|
|
355
|
+
ach_cop_bank_code: "051",
|
|
356
|
+
ach_cop_bank_account: "12345678",
|
|
357
|
+
swift_code_bic: "123456789",
|
|
358
|
+
swift_account_holder_name: "John Doe",
|
|
359
|
+
swift_account_number_iban: "123456789",
|
|
360
|
+
swift_beneficiary_address_line_1: "123 Main Street, Suite 100, Downtown District, City Center CP 12345",
|
|
361
|
+
swift_beneficiary_address_line_2: "456 Oak Avenue, Building 7, Financial District, Business Center CP 54321",
|
|
362
|
+
swift_beneficiary_country: "MX",
|
|
363
|
+
swift_beneficiary_city: "City",
|
|
364
|
+
swift_beneficiary_state_province_region: "District",
|
|
365
|
+
swift_beneficiary_postal_code: "11530",
|
|
366
|
+
swift_bank_name: "Banco Regional SA",
|
|
367
|
+
swift_bank_address_line_1: "123 Main Street, Suite 100, Downtown District, City Center CP 12345",
|
|
368
|
+
swift_bank_address_line_2: "456 Oak Avenue, Building 7, Financial District, Business Center CP 54321",
|
|
369
|
+
swift_bank_country: "MX",
|
|
370
|
+
swift_bank_city: "City",
|
|
371
|
+
swift_bank_state_province_region: "District",
|
|
372
|
+
swift_bank_postal_code: "11530",
|
|
373
|
+
swift_intermediary_bank_swift_code_bic: "AEIBARB1",
|
|
374
|
+
swift_intermediary_bank_account_number_iban: "123456789",
|
|
375
|
+
swift_intermediary_bank_name: "Banco Regional SA",
|
|
376
|
+
swift_intermediary_bank_country: "US",
|
|
377
|
+
tron_wallet_hash: "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
|
|
378
|
+
offramp_wallets: [
|
|
379
|
+
{
|
|
380
|
+
address: "TALJN9zTTEL9TVBb4WuTt6wLvPqJZr3hvb",
|
|
381
|
+
id: "ow_000000000000",
|
|
382
|
+
network: "tron",
|
|
383
|
+
external_id: "your_external_id"
|
|
384
|
+
}
|
|
385
|
+
],
|
|
386
|
+
created_at: "2021-01-01T00:00:00Z"
|
|
387
|
+
}
|
|
388
|
+
]
|
|
389
|
+
};
|
|
390
|
+
fetchMock.mockResponseOnce(JSON.stringify(mockedBankAccounts), {
|
|
391
|
+
headers: { "Content-Type": "application/json" }
|
|
392
|
+
});
|
|
393
|
+
const { data, error } = yield blindpay.receivers.bankAccounts.list({
|
|
394
|
+
instanceId: "in_000000000000",
|
|
395
|
+
receiverId: "re_000000000000"
|
|
396
|
+
});
|
|
397
|
+
globalExpect(error).toBeNull();
|
|
398
|
+
globalExpect(data).toEqual(mockedBankAccounts);
|
|
399
|
+
}));
|
|
400
|
+
});
|
|
401
|
+
describe("Delete bank account", () => {
|
|
402
|
+
it("should delete a bank account", () => __async(null, null, function* () {
|
|
403
|
+
fetchMock.mockResponseOnce(JSON.stringify({ data: null }), {
|
|
404
|
+
headers: { "Content-Type": "application/json" }
|
|
405
|
+
});
|
|
406
|
+
const { data, error } = yield blindpay.receivers.bankAccounts.delete({
|
|
407
|
+
instanceId: "in_000000000000",
|
|
408
|
+
receiverId: "re_000000000000",
|
|
409
|
+
id: "ba_000000000000"
|
|
410
|
+
});
|
|
411
|
+
globalExpect(error).toBeNull();
|
|
412
|
+
globalExpect(data).toEqual({ data: null });
|
|
413
|
+
}));
|
|
414
|
+
});
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
});
|
|
418
|
+
export default require_bank_accounts_test();
|