@moovio/sdk 0.21.0 → 0.21.2
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/bin/mcp-server.js +79 -61
- package/bin/mcp-server.js.map +11 -10
- package/examples/package-lock.json +1 -1
- package/hooks/hooks.d.ts +3 -2
- package/hooks/hooks.d.ts.map +1 -1
- package/hooks/hooks.js.map +1 -1
- package/hooks/moov-version-hook.d.ts +6 -0
- package/hooks/moov-version-hook.d.ts.map +1 -0
- package/hooks/moov-version-hook.js +12 -0
- package/hooks/moov-version-hook.js.map +1 -0
- package/hooks/registration.d.ts.map +1 -1
- package/hooks/registration.js +3 -1
- package/hooks/registration.js.map +1 -1
- package/hooks/types.d.ts +2 -6
- package/hooks/types.d.ts.map +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/lib/sdks.d.ts.map +1 -1
- package/lib/sdks.js +5 -6
- package/lib/sdks.js.map +1 -1
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/server.js +1 -1
- package/package.json +1 -1
- package/src/hooks/hooks.ts +2 -2
- package/src/hooks/moov-version-hook.ts +9 -0
- package/src/hooks/registration.ts +4 -1
- package/src/hooks/types.ts +2 -7
- package/src/lib/config.ts +3 -3
- package/src/lib/sdks.ts +6 -7
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/docs/sdks/accounts/README.md +0 -1038
- package/docs/sdks/accountterminalapplications/README.md +0 -371
- package/docs/sdks/adjustments/README.md +0 -185
- package/docs/sdks/applepay/README.md +0 -572
- package/docs/sdks/authentication/README.md +0 -191
- package/docs/sdks/avatars/README.md +0 -95
- package/docs/sdks/bankaccounts/README.md +0 -951
- package/docs/sdks/branding/README.md +0 -407
- package/docs/sdks/capabilities/README.md +0 -380
- package/docs/sdks/cardissuing/README.md +0 -533
- package/docs/sdks/cards/README.md +0 -544
- package/docs/sdks/disputes/README.md +0 -1085
- package/docs/sdks/endtoendencryption/README.md +0 -174
- package/docs/sdks/enrichedaddress/README.md +0 -95
- package/docs/sdks/enrichedprofile/README.md +0 -95
- package/docs/sdks/feeplans/README.md +0 -921
- package/docs/sdks/files/README.md +0 -293
- package/docs/sdks/images/README.md +0 -616
- package/docs/sdks/industries/README.md +0 -91
- package/docs/sdks/institutions/README.md +0 -184
- package/docs/sdks/issuingtransactions/README.md +0 -465
- package/docs/sdks/onboarding/README.md +0 -389
- package/docs/sdks/paymentlinks/README.md +0 -615
- package/docs/sdks/paymentmethods/README.md +0 -187
- package/docs/sdks/ping/README.md +0 -91
- package/docs/sdks/products/README.md +0 -616
- package/docs/sdks/receipts/README.md +0 -180
- package/docs/sdks/representatives/README.md +0 -603
- package/docs/sdks/scheduling/README.md +0 -1018
- package/docs/sdks/statements/README.md +0 -194
- package/docs/sdks/support/README.md +0 -505
- package/docs/sdks/sweeps/README.md +0 -571
- package/docs/sdks/terminalapplications/README.md +0 -460
- package/docs/sdks/transfers/README.md +0 -1136
- package/docs/sdks/underwriting/README.md +0 -331
- package/docs/sdks/wallets/README.md +0 -416
- package/docs/sdks/wallettransactions/README.md +0 -202
- package/examples/README.md +0 -31
- package/test/README.md +0 -14
|
@@ -1,572 +0,0 @@
|
|
|
1
|
-
# ApplePay
|
|
2
|
-
(*applePay*)
|
|
3
|
-
|
|
4
|
-
## Overview
|
|
5
|
-
|
|
6
|
-
### Available Operations
|
|
7
|
-
|
|
8
|
-
* [registerMerchantDomains](#registermerchantdomains) - Add domains to be registered with Apple Pay.
|
|
9
|
-
|
|
10
|
-
Any domains that will be used to accept payments must first be [verified](https://docs.moov.io/guides/sources/cards/apple-pay/#register-your-domains)
|
|
11
|
-
with Apple.
|
|
12
|
-
|
|
13
|
-
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
|
14
|
-
you'll need to specify the `/accounts/{accountID}/apple-pay.write` scope.
|
|
15
|
-
* [updateMerchantDomains](#updatemerchantdomains) - Add or remove domains to be registered with Apple Pay.
|
|
16
|
-
|
|
17
|
-
Any domains that will be used to accept payments must first be [verified](https://docs.moov.io/guides/sources/cards/apple-pay/#register-your-domains)
|
|
18
|
-
with Apple.
|
|
19
|
-
|
|
20
|
-
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
|
21
|
-
you'll need to specify the `/accounts/{accountID}/apple-pay.write` scope.
|
|
22
|
-
* [getMerchantDomains](#getmerchantdomains) - Get domains registered with Apple Pay.
|
|
23
|
-
|
|
24
|
-
Read our [Apple Pay tutorial](https://docs.moov.io/guides/sources/cards/apple-pay/#register-your-domains) to learn more.
|
|
25
|
-
|
|
26
|
-
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
|
27
|
-
you'll need to specify the `/accounts/{accountID}/apple-pay.read` scope.
|
|
28
|
-
* [createSession](#createsession) - Create a session with Apple Pay to facilitate a payment.
|
|
29
|
-
|
|
30
|
-
Read our [Apple Pay tutorial](https://docs.moov.io/guides/sources/cards/apple-pay/#register-your-domains) to learn more.
|
|
31
|
-
A successful response from this endpoint should be passed through to Apple Pay unchanged.
|
|
32
|
-
|
|
33
|
-
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
|
34
|
-
you'll need to specify the `/accounts/{accountID}/apple-pay.write` scope.
|
|
35
|
-
* [linkToken](#linktoken) - Connect an Apple Pay token to the specified account.
|
|
36
|
-
|
|
37
|
-
Read our [Apple Pay tutorial](https://docs.moov.io/guides/sources/cards/apple-pay/#register-your-domains) to learn more.
|
|
38
|
-
The `token` data is defined by Apple Pay and should be passed through from Apple Pay's response unmodified.
|
|
39
|
-
|
|
40
|
-
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
|
41
|
-
you'll need to specify the `/accounts/{accountID}/cards.write` scope.
|
|
42
|
-
|
|
43
|
-
## registerMerchantDomains
|
|
44
|
-
|
|
45
|
-
Add domains to be registered with Apple Pay.
|
|
46
|
-
|
|
47
|
-
Any domains that will be used to accept payments must first be [verified](https://docs.moov.io/guides/sources/cards/apple-pay/#register-your-domains)
|
|
48
|
-
with Apple.
|
|
49
|
-
|
|
50
|
-
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
|
51
|
-
you'll need to specify the `/accounts/{accountID}/apple-pay.write` scope.
|
|
52
|
-
|
|
53
|
-
### Example Usage
|
|
54
|
-
|
|
55
|
-
<!-- UsageSnippet language="typescript" operationID="registerApplePayMerchantDomains" method="post" path="/accounts/{accountID}/apple-pay/domains" -->
|
|
56
|
-
```typescript
|
|
57
|
-
import { Moov } from "@moovio/sdk";
|
|
58
|
-
|
|
59
|
-
const moov = new Moov({
|
|
60
|
-
xMoovVersion: "v2024.01.00",
|
|
61
|
-
security: {
|
|
62
|
-
username: "",
|
|
63
|
-
password: "",
|
|
64
|
-
},
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
async function run() {
|
|
68
|
-
const result = await moov.applePay.registerMerchantDomains({
|
|
69
|
-
accountID: "60825531-8c7e-421c-8014-019c6603250c",
|
|
70
|
-
registerApplePayMerchantDomains: {
|
|
71
|
-
domains: [
|
|
72
|
-
"checkout.classbooker.dev",
|
|
73
|
-
],
|
|
74
|
-
},
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
console.log(result);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
run();
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
### Standalone function
|
|
84
|
-
|
|
85
|
-
The standalone function version of this method:
|
|
86
|
-
|
|
87
|
-
```typescript
|
|
88
|
-
import { MoovCore } from "@moovio/sdk/core.js";
|
|
89
|
-
import { applePayRegisterMerchantDomains } from "@moovio/sdk/funcs/applePayRegisterMerchantDomains.js";
|
|
90
|
-
|
|
91
|
-
// Use `MoovCore` for best tree-shaking performance.
|
|
92
|
-
// You can create one instance of it to use across an application.
|
|
93
|
-
const moov = new MoovCore({
|
|
94
|
-
xMoovVersion: "v2024.01.00",
|
|
95
|
-
security: {
|
|
96
|
-
username: "",
|
|
97
|
-
password: "",
|
|
98
|
-
},
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
async function run() {
|
|
102
|
-
const res = await applePayRegisterMerchantDomains(moov, {
|
|
103
|
-
accountID: "60825531-8c7e-421c-8014-019c6603250c",
|
|
104
|
-
registerApplePayMerchantDomains: {
|
|
105
|
-
domains: [
|
|
106
|
-
"checkout.classbooker.dev",
|
|
107
|
-
],
|
|
108
|
-
},
|
|
109
|
-
});
|
|
110
|
-
if (res.ok) {
|
|
111
|
-
const { value: result } = res;
|
|
112
|
-
console.log(result);
|
|
113
|
-
} else {
|
|
114
|
-
console.log("applePayRegisterMerchantDomains failed:", res.error);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
run();
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
### Parameters
|
|
122
|
-
|
|
123
|
-
| Parameter | Type | Required | Description |
|
|
124
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
125
|
-
| `request` | [operations.RegisterApplePayMerchantDomainsRequest](../../models/operations/registerapplepaymerchantdomainsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
126
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
127
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
128
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
129
|
-
|
|
130
|
-
### Response
|
|
131
|
-
|
|
132
|
-
**Promise\<[operations.RegisterApplePayMerchantDomainsResponse](../../models/operations/registerapplepaymerchantdomainsresponse.md)\>**
|
|
133
|
-
|
|
134
|
-
### Errors
|
|
135
|
-
|
|
136
|
-
| Error Type | Status Code | Content Type |
|
|
137
|
-
| ------------------- | ------------------- | ------------------- |
|
|
138
|
-
| errors.GenericError | 400 | application/json |
|
|
139
|
-
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
140
|
-
|
|
141
|
-
## updateMerchantDomains
|
|
142
|
-
|
|
143
|
-
Add or remove domains to be registered with Apple Pay.
|
|
144
|
-
|
|
145
|
-
Any domains that will be used to accept payments must first be [verified](https://docs.moov.io/guides/sources/cards/apple-pay/#register-your-domains)
|
|
146
|
-
with Apple.
|
|
147
|
-
|
|
148
|
-
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
|
149
|
-
you'll need to specify the `/accounts/{accountID}/apple-pay.write` scope.
|
|
150
|
-
|
|
151
|
-
### Example Usage
|
|
152
|
-
|
|
153
|
-
<!-- UsageSnippet language="typescript" operationID="updateApplePayMerchantDomains" method="patch" path="/accounts/{accountID}/apple-pay/domains" -->
|
|
154
|
-
```typescript
|
|
155
|
-
import { Moov } from "@moovio/sdk";
|
|
156
|
-
|
|
157
|
-
const moov = new Moov({
|
|
158
|
-
xMoovVersion: "v2024.01.00",
|
|
159
|
-
security: {
|
|
160
|
-
username: "",
|
|
161
|
-
password: "",
|
|
162
|
-
},
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
async function run() {
|
|
166
|
-
const result = await moov.applePay.updateMerchantDomains({
|
|
167
|
-
accountID: "34b1c132-91d4-4676-9864-87e1d961d56d",
|
|
168
|
-
updateApplePayMerchantDomains: {
|
|
169
|
-
addDomains: [
|
|
170
|
-
"pay.classbooker.dev",
|
|
171
|
-
],
|
|
172
|
-
removeDomains: [
|
|
173
|
-
"checkout.classbooker.dev",
|
|
174
|
-
],
|
|
175
|
-
},
|
|
176
|
-
});
|
|
177
|
-
|
|
178
|
-
console.log(result);
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
run();
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
### Standalone function
|
|
185
|
-
|
|
186
|
-
The standalone function version of this method:
|
|
187
|
-
|
|
188
|
-
```typescript
|
|
189
|
-
import { MoovCore } from "@moovio/sdk/core.js";
|
|
190
|
-
import { applePayUpdateMerchantDomains } from "@moovio/sdk/funcs/applePayUpdateMerchantDomains.js";
|
|
191
|
-
|
|
192
|
-
// Use `MoovCore` for best tree-shaking performance.
|
|
193
|
-
// You can create one instance of it to use across an application.
|
|
194
|
-
const moov = new MoovCore({
|
|
195
|
-
xMoovVersion: "v2024.01.00",
|
|
196
|
-
security: {
|
|
197
|
-
username: "",
|
|
198
|
-
password: "",
|
|
199
|
-
},
|
|
200
|
-
});
|
|
201
|
-
|
|
202
|
-
async function run() {
|
|
203
|
-
const res = await applePayUpdateMerchantDomains(moov, {
|
|
204
|
-
accountID: "34b1c132-91d4-4676-9864-87e1d961d56d",
|
|
205
|
-
updateApplePayMerchantDomains: {
|
|
206
|
-
addDomains: [
|
|
207
|
-
"pay.classbooker.dev",
|
|
208
|
-
],
|
|
209
|
-
removeDomains: [
|
|
210
|
-
"checkout.classbooker.dev",
|
|
211
|
-
],
|
|
212
|
-
},
|
|
213
|
-
});
|
|
214
|
-
if (res.ok) {
|
|
215
|
-
const { value: result } = res;
|
|
216
|
-
console.log(result);
|
|
217
|
-
} else {
|
|
218
|
-
console.log("applePayUpdateMerchantDomains failed:", res.error);
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
run();
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
### Parameters
|
|
226
|
-
|
|
227
|
-
| Parameter | Type | Required | Description |
|
|
228
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
229
|
-
| `request` | [operations.UpdateApplePayMerchantDomainsRequest](../../models/operations/updateapplepaymerchantdomainsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
230
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
231
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
232
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
233
|
-
|
|
234
|
-
### Response
|
|
235
|
-
|
|
236
|
-
**Promise\<[operations.UpdateApplePayMerchantDomainsResponse](../../models/operations/updateapplepaymerchantdomainsresponse.md)\>**
|
|
237
|
-
|
|
238
|
-
### Errors
|
|
239
|
-
|
|
240
|
-
| Error Type | Status Code | Content Type |
|
|
241
|
-
| ------------------- | ------------------- | ------------------- |
|
|
242
|
-
| errors.GenericError | 400 | application/json |
|
|
243
|
-
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
244
|
-
|
|
245
|
-
## getMerchantDomains
|
|
246
|
-
|
|
247
|
-
Get domains registered with Apple Pay.
|
|
248
|
-
|
|
249
|
-
Read our [Apple Pay tutorial](https://docs.moov.io/guides/sources/cards/apple-pay/#register-your-domains) to learn more.
|
|
250
|
-
|
|
251
|
-
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
|
252
|
-
you'll need to specify the `/accounts/{accountID}/apple-pay.read` scope.
|
|
253
|
-
|
|
254
|
-
### Example Usage
|
|
255
|
-
|
|
256
|
-
<!-- UsageSnippet language="typescript" operationID="getApplePayMerchantDomains" method="get" path="/accounts/{accountID}/apple-pay/domains" -->
|
|
257
|
-
```typescript
|
|
258
|
-
import { Moov } from "@moovio/sdk";
|
|
259
|
-
|
|
260
|
-
const moov = new Moov({
|
|
261
|
-
xMoovVersion: "v2024.01.00",
|
|
262
|
-
security: {
|
|
263
|
-
username: "",
|
|
264
|
-
password: "",
|
|
265
|
-
},
|
|
266
|
-
});
|
|
267
|
-
|
|
268
|
-
async function run() {
|
|
269
|
-
const result = await moov.applePay.getMerchantDomains({
|
|
270
|
-
accountID: "28704d00-d07b-47db-9e54-016a9713d697",
|
|
271
|
-
});
|
|
272
|
-
|
|
273
|
-
console.log(result);
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
run();
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
### Standalone function
|
|
280
|
-
|
|
281
|
-
The standalone function version of this method:
|
|
282
|
-
|
|
283
|
-
```typescript
|
|
284
|
-
import { MoovCore } from "@moovio/sdk/core.js";
|
|
285
|
-
import { applePayGetMerchantDomains } from "@moovio/sdk/funcs/applePayGetMerchantDomains.js";
|
|
286
|
-
|
|
287
|
-
// Use `MoovCore` for best tree-shaking performance.
|
|
288
|
-
// You can create one instance of it to use across an application.
|
|
289
|
-
const moov = new MoovCore({
|
|
290
|
-
xMoovVersion: "v2024.01.00",
|
|
291
|
-
security: {
|
|
292
|
-
username: "",
|
|
293
|
-
password: "",
|
|
294
|
-
},
|
|
295
|
-
});
|
|
296
|
-
|
|
297
|
-
async function run() {
|
|
298
|
-
const res = await applePayGetMerchantDomains(moov, {
|
|
299
|
-
accountID: "28704d00-d07b-47db-9e54-016a9713d697",
|
|
300
|
-
});
|
|
301
|
-
if (res.ok) {
|
|
302
|
-
const { value: result } = res;
|
|
303
|
-
console.log(result);
|
|
304
|
-
} else {
|
|
305
|
-
console.log("applePayGetMerchantDomains failed:", res.error);
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
run();
|
|
310
|
-
```
|
|
311
|
-
|
|
312
|
-
### Parameters
|
|
313
|
-
|
|
314
|
-
| Parameter | Type | Required | Description |
|
|
315
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
316
|
-
| `request` | [operations.GetApplePayMerchantDomainsRequest](../../models/operations/getapplepaymerchantdomainsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
317
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
318
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
319
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
320
|
-
|
|
321
|
-
### Response
|
|
322
|
-
|
|
323
|
-
**Promise\<[operations.GetApplePayMerchantDomainsResponse](../../models/operations/getapplepaymerchantdomainsresponse.md)\>**
|
|
324
|
-
|
|
325
|
-
### Errors
|
|
326
|
-
|
|
327
|
-
| Error Type | Status Code | Content Type |
|
|
328
|
-
| --------------- | --------------- | --------------- |
|
|
329
|
-
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
330
|
-
|
|
331
|
-
## createSession
|
|
332
|
-
|
|
333
|
-
Create a session with Apple Pay to facilitate a payment.
|
|
334
|
-
|
|
335
|
-
Read our [Apple Pay tutorial](https://docs.moov.io/guides/sources/cards/apple-pay/#register-your-domains) to learn more.
|
|
336
|
-
A successful response from this endpoint should be passed through to Apple Pay unchanged.
|
|
337
|
-
|
|
338
|
-
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
|
339
|
-
you'll need to specify the `/accounts/{accountID}/apple-pay.write` scope.
|
|
340
|
-
|
|
341
|
-
### Example Usage
|
|
342
|
-
|
|
343
|
-
<!-- UsageSnippet language="typescript" operationID="createApplePaySession" method="post" path="/accounts/{accountID}/apple-pay/sessions" -->
|
|
344
|
-
```typescript
|
|
345
|
-
import { Moov } from "@moovio/sdk";
|
|
346
|
-
|
|
347
|
-
const moov = new Moov({
|
|
348
|
-
xMoovVersion: "v2024.01.00",
|
|
349
|
-
security: {
|
|
350
|
-
username: "",
|
|
351
|
-
password: "",
|
|
352
|
-
},
|
|
353
|
-
});
|
|
354
|
-
|
|
355
|
-
async function run() {
|
|
356
|
-
const result = await moov.applePay.createSession({
|
|
357
|
-
accountID: "32ab62ca-7afd-4f49-89cb-0bb237258f23",
|
|
358
|
-
createApplePaySession: {
|
|
359
|
-
domain: "checkout.classbooker.dev",
|
|
360
|
-
displayName: "Fay11",
|
|
361
|
-
},
|
|
362
|
-
});
|
|
363
|
-
|
|
364
|
-
console.log(result);
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
run();
|
|
368
|
-
```
|
|
369
|
-
|
|
370
|
-
### Standalone function
|
|
371
|
-
|
|
372
|
-
The standalone function version of this method:
|
|
373
|
-
|
|
374
|
-
```typescript
|
|
375
|
-
import { MoovCore } from "@moovio/sdk/core.js";
|
|
376
|
-
import { applePayCreateSession } from "@moovio/sdk/funcs/applePayCreateSession.js";
|
|
377
|
-
|
|
378
|
-
// Use `MoovCore` for best tree-shaking performance.
|
|
379
|
-
// You can create one instance of it to use across an application.
|
|
380
|
-
const moov = new MoovCore({
|
|
381
|
-
xMoovVersion: "v2024.01.00",
|
|
382
|
-
security: {
|
|
383
|
-
username: "",
|
|
384
|
-
password: "",
|
|
385
|
-
},
|
|
386
|
-
});
|
|
387
|
-
|
|
388
|
-
async function run() {
|
|
389
|
-
const res = await applePayCreateSession(moov, {
|
|
390
|
-
accountID: "32ab62ca-7afd-4f49-89cb-0bb237258f23",
|
|
391
|
-
createApplePaySession: {
|
|
392
|
-
domain: "checkout.classbooker.dev",
|
|
393
|
-
displayName: "Fay11",
|
|
394
|
-
},
|
|
395
|
-
});
|
|
396
|
-
if (res.ok) {
|
|
397
|
-
const { value: result } = res;
|
|
398
|
-
console.log(result);
|
|
399
|
-
} else {
|
|
400
|
-
console.log("applePayCreateSession failed:", res.error);
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
run();
|
|
405
|
-
```
|
|
406
|
-
|
|
407
|
-
### Parameters
|
|
408
|
-
|
|
409
|
-
| Parameter | Type | Required | Description |
|
|
410
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
411
|
-
| `request` | [operations.CreateApplePaySessionRequest](../../models/operations/createapplepaysessionrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
412
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
413
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
414
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
415
|
-
|
|
416
|
-
### Response
|
|
417
|
-
|
|
418
|
-
**Promise\<[operations.CreateApplePaySessionResponse](../../models/operations/createapplepaysessionresponse.md)\>**
|
|
419
|
-
|
|
420
|
-
### Errors
|
|
421
|
-
|
|
422
|
-
| Error Type | Status Code | Content Type |
|
|
423
|
-
| ------------------- | ------------------- | ------------------- |
|
|
424
|
-
| errors.GenericError | 400, 409, 422 | application/json |
|
|
425
|
-
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
426
|
-
|
|
427
|
-
## linkToken
|
|
428
|
-
|
|
429
|
-
Connect an Apple Pay token to the specified account.
|
|
430
|
-
|
|
431
|
-
Read our [Apple Pay tutorial](https://docs.moov.io/guides/sources/cards/apple-pay/#register-your-domains) to learn more.
|
|
432
|
-
The `token` data is defined by Apple Pay and should be passed through from Apple Pay's response unmodified.
|
|
433
|
-
|
|
434
|
-
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
|
435
|
-
you'll need to specify the `/accounts/{accountID}/cards.write` scope.
|
|
436
|
-
|
|
437
|
-
### Example Usage
|
|
438
|
-
|
|
439
|
-
<!-- UsageSnippet language="typescript" operationID="linkApplePayToken" method="post" path="/accounts/{accountID}/apple-pay/tokens" -->
|
|
440
|
-
```typescript
|
|
441
|
-
import { Moov } from "@moovio/sdk";
|
|
442
|
-
|
|
443
|
-
const moov = new Moov({
|
|
444
|
-
xMoovVersion: "v2024.01.00",
|
|
445
|
-
security: {
|
|
446
|
-
username: "",
|
|
447
|
-
password: "",
|
|
448
|
-
},
|
|
449
|
-
});
|
|
450
|
-
|
|
451
|
-
async function run() {
|
|
452
|
-
const result = await moov.applePay.linkToken({
|
|
453
|
-
accountID: "bf498c07-3852-4060-b561-bf992e26a851",
|
|
454
|
-
linkApplePay: {
|
|
455
|
-
token: {
|
|
456
|
-
paymentData: {
|
|
457
|
-
version: "EC_v1",
|
|
458
|
-
data: "3+f4oOTwPa6f1UZ6tG...CE=",
|
|
459
|
-
signature: "MIAGCSqGSIb3DQ.AAAA==",
|
|
460
|
-
header: {
|
|
461
|
-
ephemeralPublicKey: "MFkwEK...Md==",
|
|
462
|
-
publicKeyHash: "l0CnXdMv...D1I=",
|
|
463
|
-
transactionId: "32b...4f3",
|
|
464
|
-
},
|
|
465
|
-
},
|
|
466
|
-
paymentMethod: {
|
|
467
|
-
displayName: "Visa 1234",
|
|
468
|
-
network: "Visa",
|
|
469
|
-
type: "debit",
|
|
470
|
-
},
|
|
471
|
-
transactionIdentifier: "32b...4f3",
|
|
472
|
-
},
|
|
473
|
-
billingContact: {
|
|
474
|
-
addressLines: [
|
|
475
|
-
"123 Sesame Street",
|
|
476
|
-
],
|
|
477
|
-
locality: "Phoenix",
|
|
478
|
-
postalCode: "30345",
|
|
479
|
-
administrativeArea: "AZ",
|
|
480
|
-
countryCode: "US",
|
|
481
|
-
},
|
|
482
|
-
},
|
|
483
|
-
});
|
|
484
|
-
|
|
485
|
-
console.log(result);
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
run();
|
|
489
|
-
```
|
|
490
|
-
|
|
491
|
-
### Standalone function
|
|
492
|
-
|
|
493
|
-
The standalone function version of this method:
|
|
494
|
-
|
|
495
|
-
```typescript
|
|
496
|
-
import { MoovCore } from "@moovio/sdk/core.js";
|
|
497
|
-
import { applePayLinkToken } from "@moovio/sdk/funcs/applePayLinkToken.js";
|
|
498
|
-
|
|
499
|
-
// Use `MoovCore` for best tree-shaking performance.
|
|
500
|
-
// You can create one instance of it to use across an application.
|
|
501
|
-
const moov = new MoovCore({
|
|
502
|
-
xMoovVersion: "v2024.01.00",
|
|
503
|
-
security: {
|
|
504
|
-
username: "",
|
|
505
|
-
password: "",
|
|
506
|
-
},
|
|
507
|
-
});
|
|
508
|
-
|
|
509
|
-
async function run() {
|
|
510
|
-
const res = await applePayLinkToken(moov, {
|
|
511
|
-
accountID: "bf498c07-3852-4060-b561-bf992e26a851",
|
|
512
|
-
linkApplePay: {
|
|
513
|
-
token: {
|
|
514
|
-
paymentData: {
|
|
515
|
-
version: "EC_v1",
|
|
516
|
-
data: "3+f4oOTwPa6f1UZ6tG...CE=",
|
|
517
|
-
signature: "MIAGCSqGSIb3DQ.AAAA==",
|
|
518
|
-
header: {
|
|
519
|
-
ephemeralPublicKey: "MFkwEK...Md==",
|
|
520
|
-
publicKeyHash: "l0CnXdMv...D1I=",
|
|
521
|
-
transactionId: "32b...4f3",
|
|
522
|
-
},
|
|
523
|
-
},
|
|
524
|
-
paymentMethod: {
|
|
525
|
-
displayName: "Visa 1234",
|
|
526
|
-
network: "Visa",
|
|
527
|
-
type: "debit",
|
|
528
|
-
},
|
|
529
|
-
transactionIdentifier: "32b...4f3",
|
|
530
|
-
},
|
|
531
|
-
billingContact: {
|
|
532
|
-
addressLines: [
|
|
533
|
-
"123 Sesame Street",
|
|
534
|
-
],
|
|
535
|
-
locality: "Phoenix",
|
|
536
|
-
postalCode: "30345",
|
|
537
|
-
administrativeArea: "AZ",
|
|
538
|
-
countryCode: "US",
|
|
539
|
-
},
|
|
540
|
-
},
|
|
541
|
-
});
|
|
542
|
-
if (res.ok) {
|
|
543
|
-
const { value: result } = res;
|
|
544
|
-
console.log(result);
|
|
545
|
-
} else {
|
|
546
|
-
console.log("applePayLinkToken failed:", res.error);
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
run();
|
|
551
|
-
```
|
|
552
|
-
|
|
553
|
-
### Parameters
|
|
554
|
-
|
|
555
|
-
| Parameter | Type | Required | Description |
|
|
556
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
557
|
-
| `request` | [operations.LinkApplePayTokenRequest](../../models/operations/linkapplepaytokenrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
558
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
559
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
560
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
561
|
-
|
|
562
|
-
### Response
|
|
563
|
-
|
|
564
|
-
**Promise\<[operations.LinkApplePayTokenResponse](../../models/operations/linkapplepaytokenresponse.md)\>**
|
|
565
|
-
|
|
566
|
-
### Errors
|
|
567
|
-
|
|
568
|
-
| Error Type | Status Code | Content Type |
|
|
569
|
-
| ------------------------ | ------------------------ | ------------------------ |
|
|
570
|
-
| errors.GenericError | 400, 409 | application/json |
|
|
571
|
-
| errors.LinkApplePayError | 422 | application/json |
|
|
572
|
-
| errors.APIError | 4XX, 5XX | \*/\* |
|