framepayments 2.0.0 → 2.1.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.
Files changed (89) hide show
  1. package/README.md +55 -10
  2. package/dist/api/accounts-api.d.ts +3 -2
  3. package/dist/api/accounts-api.d.ts.map +1 -1
  4. package/dist/api/accounts-api.js +5 -1
  5. package/dist/api/accounts-api.js.map +1 -1
  6. package/dist/api/configuration-api.d.ts +10 -0
  7. package/dist/api/configuration-api.d.ts.map +1 -0
  8. package/dist/api/configuration-api.js +15 -0
  9. package/dist/api/configuration-api.js.map +1 -0
  10. package/dist/api/customer_identity-api.d.ts +8 -4
  11. package/dist/api/customer_identity-api.d.ts.map +1 -1
  12. package/dist/api/customer_identity-api.js +74 -6
  13. package/dist/api/customer_identity-api.js.map +1 -1
  14. package/dist/api/device_attestation-api.d.ts +10 -0
  15. package/dist/api/device_attestation-api.d.ts.map +1 -0
  16. package/dist/api/device_attestation-api.js +15 -0
  17. package/dist/api/device_attestation-api.js.map +1 -0
  18. package/dist/api/geo_compliance-api.d.ts +2 -1
  19. package/dist/api/geo_compliance-api.d.ts.map +1 -1
  20. package/dist/api/geo_compliance-api.js +3 -2
  21. package/dist/api/geo_compliance-api.js.map +1 -1
  22. package/dist/api/payment_methods-api.d.ts +9 -4
  23. package/dist/api/payment_methods-api.d.ts.map +1 -1
  24. package/dist/api/payment_methods-api.js +21 -14
  25. package/dist/api/payment_methods-api.js.map +1 -1
  26. package/dist/api/phone_verifications-api.d.ts +3 -2
  27. package/dist/api/phone_verifications-api.d.ts.map +1 -1
  28. package/dist/api/phone_verifications-api.js +5 -4
  29. package/dist/api/phone_verifications-api.js.map +1 -1
  30. package/dist/api/refunds-api.d.ts +0 -1
  31. package/dist/api/refunds-api.d.ts.map +1 -1
  32. package/dist/api/refunds-api.js +0 -4
  33. package/dist/api/refunds-api.js.map +1 -1
  34. package/dist/api/wallet-api.d.ts +9 -0
  35. package/dist/api/wallet-api.d.ts.map +1 -0
  36. package/dist/api/wallet-api.js +11 -0
  37. package/dist/api/wallet-api.js.map +1 -0
  38. package/dist/client.d.ts +9 -3
  39. package/dist/client.d.ts.map +1 -1
  40. package/dist/client.js +82 -10
  41. package/dist/client.js.map +1 -1
  42. package/dist/index.d.ts +16 -0
  43. package/dist/index.d.ts.map +1 -1
  44. package/dist/index.js +9 -0
  45. package/dist/index.js.map +1 -1
  46. package/dist/types/accounts.d.ts +16 -0
  47. package/dist/types/accounts.d.ts.map +1 -1
  48. package/dist/types/charge_intents.d.ts +18 -2
  49. package/dist/types/charge_intents.d.ts.map +1 -1
  50. package/dist/types/charges.d.ts +6 -0
  51. package/dist/types/charges.d.ts.map +1 -1
  52. package/dist/types/configuration.d.ts +9 -0
  53. package/dist/types/configuration.d.ts.map +1 -0
  54. package/dist/types/configuration.js +2 -0
  55. package/dist/types/configuration.js.map +1 -0
  56. package/dist/types/customer_identity.d.ts +14 -0
  57. package/dist/types/customer_identity.d.ts.map +1 -1
  58. package/dist/types/device_attestation.d.ts +13 -0
  59. package/dist/types/device_attestation.d.ts.map +1 -0
  60. package/dist/types/device_attestation.js +2 -0
  61. package/dist/types/device_attestation.js.map +1 -0
  62. package/dist/types/disputes.d.ts +11 -22
  63. package/dist/types/disputes.d.ts.map +1 -1
  64. package/dist/types/disputes.js +0 -17
  65. package/dist/types/disputes.js.map +1 -1
  66. package/dist/types/invoice_line_items.d.ts +0 -7
  67. package/dist/types/invoice_line_items.d.ts.map +1 -1
  68. package/dist/types/invoices.d.ts +5 -0
  69. package/dist/types/invoices.d.ts.map +1 -1
  70. package/dist/types/onboarding.d.ts +3 -0
  71. package/dist/types/onboarding.d.ts.map +1 -1
  72. package/dist/types/onboarding_sessions.d.ts +1 -0
  73. package/dist/types/onboarding_sessions.d.ts.map +1 -1
  74. package/dist/types/payment_methods.d.ts +82 -1
  75. package/dist/types/payment_methods.d.ts.map +1 -1
  76. package/dist/types/phone_verifications.d.ts +1 -0
  77. package/dist/types/phone_verifications.d.ts.map +1 -1
  78. package/dist/types/products.d.ts +5 -0
  79. package/dist/types/products.d.ts.map +1 -1
  80. package/dist/types/products.js.map +1 -1
  81. package/dist/types/subscription_phases.d.ts +3 -3
  82. package/dist/types/subscription_phases.d.ts.map +1 -1
  83. package/dist/types/subscriptions.d.ts +14 -1
  84. package/dist/types/subscriptions.d.ts.map +1 -1
  85. package/dist/types/wallet.d.ts +7 -0
  86. package/dist/types/wallet.d.ts.map +1 -0
  87. package/dist/types/wallet.js +2 -0
  88. package/dist/types/wallet.js.map +1 -0
  89. package/package.json +6 -3
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # Frame-Node.js Library
2
- The Frame Node.js Library simplifies the process of creating a seamless payment experience within your web app. It provides direct access to the underlying APIs that drive these components, allowing you to design fully customized payment workflows tailored to your app's needs.
2
+ The Frame Node.js Library simplifies the process of creating a seamless payment experience within your web app or mobile client. It provides direct access to the underlying APIs that drive these components, allowing you to design fully customized payment workflows tailored to your app's needs.
3
3
 
4
4
  ## 📦 Installation
5
5
 
@@ -9,27 +9,27 @@ npm install framepayments
9
9
  yarn add framepayments
10
10
  ```
11
11
 
12
- ## 🤖 Usage
12
+ ## 🤖 Server-side usage
13
13
 
14
- 1. Initialize the client. You'll need your developer secret key from Frame, if you don't already have one you can sign up at https://www.framepayments.com
15
- ```bash
14
+ 1. Initialize the client with your API key. You'll need your developer secret key from Frame; if you don't already have one you can sign up at https://www.framepayments.com.
15
+
16
+ ```ts
16
17
  import { FrameSDK } from 'framepayments';
17
18
 
18
19
  const frame = new FrameSDK({
19
- apiKey: 'your_api_key_here', // replace with your secret API key
20
+ apiKey: 'sk_...', // your Frame secret API key
20
21
  });
21
22
  ```
22
23
 
23
- 2. Access API endpoints directly using available types and dot notation. For a list of all available endpoints: https://docs.framepayments.com
24
- ```bash
24
+ 2. Access API endpoints directly using available types and dot notation. For the full list see https://docs.framepayments.com.
25
+
26
+ ```ts
25
27
  const newCustomer = await frame.customers.create({
26
28
  name: 'Alice Johnson',
27
29
  email: 'alice@example.com',
28
30
  });
29
31
  console.log(newCustomer.id); // e.g. cust_abc123
30
- ```
31
32
 
32
- ```bash
33
33
  const subscription = await frame.subscriptions.create({
34
34
  customer: 'cust_abc123',
35
35
  plan: 'plan_basic_monthly',
@@ -37,6 +37,51 @@ const subscription = await frame.subscriptions.create({
37
37
  console.log(subscription.status); // e.g. active
38
38
  ```
39
39
 
40
- ## 🔒 Privacy
40
+ ## 📱 Client-side (mobile) usage
41
+
42
+ For mobile clients running on Frame's React Native SDK (`framepayments-react-native@4+`), initialize with the **publishable** key only and call publishable-keyed endpoints:
43
+
44
+ ```ts
45
+ import { FrameSDK } from 'framepayments';
46
+
47
+ const frame = new FrameSDK({
48
+ publishableKey: 'pk_...', // safe to ship on-device
49
+ });
50
+
51
+ // Apple Pay / Google Pay / device attestation / wallet config / Apple Pay
52
+ // payment-method creation all accept the publishable key.
53
+ const challenge = await frame.deviceAttestation.getChallenge();
54
+ const wallet = await frame.wallet.getGooglePayConfiguration();
55
+ ```
56
+
57
+ Any call to a secret-keyed endpoint from a publishable-only client will throw a `FrameAPIError` with `code: 'missing_api_key'` before the request hits the network.
58
+
59
+ ## 🔑 Per-call key routing
60
+
61
+ Some endpoints (configuration, document upload, geo-compliance, phone verification) default to the secret key but can be invoked over the publishable key when called from a mobile client. Pass `{ usePublishableKey: true }` as the final argument:
62
+
63
+ ```ts
64
+ // Server-side: default secret-key path
65
+ await frame.configuration.getEvervaultConfiguration();
66
+
67
+ // Mobile: publishable-key path
68
+ await frame.configuration.getEvervaultConfiguration({ usePublishableKey: true });
69
+ ```
70
+
71
+ The SDK defaults match the native Frame iOS / Android SDKs exactly — endpoints that those SDKs invoke with `usePublishableKey: true` are publishable-by-default here as well (`paymentMethods.createApplePayPaymentMethod`, `paymentMethods.createGooglePayPaymentMethod`, `deviceAttestation.*`, `wallet.getGooglePayConfiguration`). Everything else defaults to secret.
72
+
73
+ ## 📚 Available APIs
74
+
75
+ | Namespace | Purpose |
76
+ | --- | --- |
77
+ | `accounts`, `capabilities`, `customers`, `customerIdentityVerifications` | Identity & onboarding |
78
+ | `paymentMethods`, `chargeIntents`, `charges`, `chargeSessions`, `transfers` | Payments |
79
+ | `applePay` (via `paymentMethods.createApplePayPaymentMethod`), `wallet`, `deviceAttestation` | Apple Pay / Google Pay / attestation flows |
80
+ | `refunds`, `disputes`, `threeDS` | Refunds, chargebacks, 3-D Secure |
81
+ | `subscriptions`, `subscriptionPhases`, `subscriptionChangeLogs`, `coupons`, `promotionCodes`, `discounts` | Recurring billing |
82
+ | `invoices`, `invoiceLineItems`, `products`, `productPhases`, `transferFeePlans`, `transferBillingAgreements`, `paymentLinkSessions`, `billing` | Invoicing & monetization |
83
+ | `geofences`, `geoCompliance`, `sonarSessions`, `phoneVerifications`, `webhookEndpoints`, `payouts`, `configuration`, `onboarding`, `onboardingSessions`, `termsOfService` | Compliance, fraud, configuration |
84
+
85
+ ## 🔒 Privacy
41
86
 
42
87
  Our privacy policy can be found at https://framepayments.com/privacy.
@@ -1,5 +1,5 @@
1
1
  import type { AxiosInstance } from 'axios';
2
- import type { Account, AccountListResponse, ListAccountsParams, CreateAccountParams, UpdateAccountParams, SearchAccountsParams } from '../types/accounts';
2
+ import type { Account, AccountListResponse, ListAccountsParams, CreateAccountParams, UpdateAccountParams, SearchAccountsParams, PlaidLinkTokenResponse } from '../types/accounts';
3
3
  import type { GeoComplianceStatus } from '../types/geo_compliance';
4
4
  import type { PaymentMethod } from '../types/payment_methods';
5
5
  export declare class AccountsAPI {
@@ -14,7 +14,8 @@ export declare class AccountsAPI {
14
14
  getPaymentMethods(id: string): Promise<PaymentMethod[]>;
15
15
  restrict(id: string): Promise<Account>;
16
16
  unrestrict(id: string): Promise<Account>;
17
+ getPlaidLinkToken(id: string): Promise<PlaidLinkTokenResponse>;
17
18
  getGeoCompliance(accountId: string): Promise<GeoComplianceStatus>;
18
- iterateAllAccounts(per_page?: number): Promise<AsyncGenerator<Account, any, any>>;
19
+ iterateAllAccounts(per_page?: number): AsyncGenerator<Account>;
19
20
  }
20
21
  //# sourceMappingURL=accounts-api.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"accounts-api.d.ts","sourceRoot":"","sources":["../../src/api/accounts-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EACV,OAAO,EACP,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAG9D,qBAAa,WAAW;IACV,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa;IAEnC,IAAI,CAAC,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAK/D,MAAM,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;IAKrD,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAKjC,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;IAKjE,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAKrC,MAAM,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAKlE,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAKvD,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAKtC,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAKxC,gBAAgB,CAAC,SAAS,EAAE,M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AE,MAAM,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAK9D,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAKvE,kBAAkB,CAAC,QAAQ,SAAK,GAAG,cAAc,CAAC,OAAO,CAAC;CAQ3D"}
@@ -39,11 +39,15 @@ export class AccountsAPI {
39
39
  const resp = await this.client.post(`/v1/accounts/${id}/unrestrict`);
40
40
  return resp.data;
41
41
  }
42
+ async getPlaidLinkToken(id) {
43
+ const resp = await this.client.get(`/v1/accounts/${id}/plaid_link_token`);
44
+ return resp.data;
45
+ }
42
46
  async getGeoCompliance(accountId) {
43
47
  const resp = await this.client.get(`/v1/accounts/${accountId}/geo_compliance`);
44
48
  return resp.data;
45
49
  }
46
- async iterateAllAccounts(per_page = 20) {
50
+ iterateAllAccounts(per_page = 20) {
47
51
  return paginate(async (page) => {
48
52
  const res = await this.client.get('/v1/accounts', {
49
53
  params: { per_page, page }
@@ -1 +1 @@
1
- {"version":3,"file":"accounts-api.js","sourceRoot":"","sources":["../../src/api/accounts-api.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,MAAM,OAAO,WAAW;IACtB,YAAoB,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;IAAG,CAAC;IAE7C,KAAK,CAAC,IAAI,CAAC,MAA2B;QACpC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,cAAc,EAAE,EAAE,MAAM,EAAE,MAAM,IAAI,EAAE,EAAE,CAAC,CAAC;QAC7E,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,MAA2B;QACtC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;QAC5D,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IA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CAAC,gBAAgB,EAAE,aAAa,CAAC,CAAC;QACrE,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,EAAU;QAChC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,CAAC;QAC1E,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,SAAiB;QACtC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,gBAAgB,SAAS,iBAAiB,CAAC,CAAC;QAC/E,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,kBAAkB,CAAC,QAAQ,GAAG,EAAE;QAC9B,OAAO,QAAQ,CAAU,KAAK,EAAE,IAAY,EAAE,EAAE;YAC9C,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,cAAc,EAAE;gBAChD,MAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;aAC3B,CAAC,CAAC;YACH,OAAO,GAAG,CAAC,IAAI,CAAC;QAClB,CAAC,EAAE,QAAQ,CAAC,CAAC;IACf,CAAC;CACF"}
@@ -0,0 +1,10 @@
1
+ import type { AxiosInstance } from 'axios';
2
+ import type { EvervaultConfiguration, SiftConfiguration } from '../types/configuration';
3
+ import { type RequestOptions } from '../client';
4
+ export declare class ConfigurationAPI {
5
+ private client;
6
+ constructor(client: AxiosInstance);
7
+ getEvervaultConfiguration(opts?: RequestOptions): Promise<EvervaultConfiguration>;
8
+ getSiftConfiguration(opts?: RequestOptions): Promise<SiftConfiguration>;
9
+ }
10
+ //# sourceMappingURL=configuration-api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configuration-api.d.ts","sourceRoot":"","sources":["../../src/api/configuration-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AACxF,OAAO,EAAuB,KAAK,cAAc,EAAE,MAAM,WAAW,CAAC;AAErE,qBAAa,gBAAgB;IACf,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa;IAEnC,yBAAyB,CAAC,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAKjF,oBAAoB,CAAC,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,iBAAiB,CAAC;CAI9E"}
@@ -0,0 +1,15 @@
1
+ import { maybePublishableKey } from '../client';
2
+ export class ConfigurationAPI {
3
+ constructor(client) {
4
+ this.client = client;
5
+ }
6
+ async getEvervaultConfiguration(opts) {
7
+ const resp = await this.client.get('/v1/config/evervault', maybePublishableKey(opts));
8
+ return resp.data;
9
+ }
10
+ async getSiftConfiguration(opts) {
11
+ const resp = await this.client.get('/v1/config/sift', maybePublishableKey(opts));
12
+ return resp.data;
13
+ }
14
+ }
15
+ //# sourceMappingURL=configuration-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configuration-api.js","sourceRoot":"","sources":["../../src/api/configuration-api.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAuB,MAAM,WAAW,CAAC;AAErE,MAAM,OAAO,gBAAgB;IAC3B,YAAoB,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;IAAG,CAAC;IAE7C,KAAK,CAAC,yBAAyB,CAAC,IAAqB;QACnD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,sBAAsB,EAAE,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC;QACtF,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,oBAAoB,CAAC,IAAqB;QAC9C,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,iBAAiB,EAAE,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC;QACjF,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;CACF"}
@@ -1,10 +1,14 @@
1
1
  import type { AxiosInstance } from 'axios';
2
- import type { CustomerIdentityVerification, CreateCustomerIdentityVerificationParams, UploadDocumentsParams } from '../types/customer_identity';
2
+ import type { CustomerIdentityVerification, CreateCustomerIdentityVerificationParams, UploadDocumentsParams, IdentityDocumentUpload } from '../types/customer_identity';
3
+ import { type RequestOptions } from '../client';
3
4
  export declare class CustomerIdentityVerificationsAPI {
4
5
  private client;
5
6
  constructor(client: AxiosInstance);
6
- create(params: CreateCustomerIdentityVerificationParams): Promise<CustomerIdentityVerification>;
7
- get(id: string): Promise<CustomerIdentityVerification>;
8
- uploadDocuments(id: string, params: UploadDocumentsParams): Promise<CustomerIdentityVerification>;
7
+ create(params: CreateCustomerIdentityVerificationParams, opts?: RequestOptions): Promise<CustomerIdentityVerification>;
8
+ createForCustomer(customerId: string, opts?: RequestOptions): Promise<CustomerIdentityVerification>;
9
+ get(id: string, opts?: RequestOptions): Promise<CustomerIdentityVerification>;
10
+ submitForVerification(id: string, opts?: RequestOptions): Promise<CustomerIdentityVerification>;
11
+ uploadDocuments(id: string, params: UploadDocumentsParams, opts?: RequestOptions): Promise<CustomerIdentityVerification>;
12
+ uploadIdentityDocuments(id: string, documents: IdentityDocumentUpload[], opts?: RequestOptions): Promise<CustomerIdentityVerification>;
9
13
  }
10
14
  //# sourceMappingURL=customer_identity-api.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"customer_identity-api.d.ts","sourceRoot":"","sources":["../../src/api/customer_identity-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EACR,4BAA4B,EAC5B,wCAAwC,EACxC,qBAAqB,EACxB,MAAM,4BAA4B,CAAC;AAEpC,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3B,EAAE,EAAE,MAAM,EACV,SAAS,EAAE,sBAAsB,EAAE,EACnC,IAAI,CAAC,EAAE,cAAc,GACpB,OAAO,CAAC,4BAA4B,CAAC;CAuBzC"}
@@ -1,18 +1,86 @@
1
+ import { maybePublishableKey } from '../client';
1
2
  export class CustomerIdentityVerificationsAPI {
2
3
  constructor(client) {
3
4
  this.client = client;
4
5
  }
5
- async create(params) {
6
- const resp = await this.client.post('/v1/customer_identity_verifications', params);
6
+ async create(params, opts) {
7
+ const resp = await this.client.post('/v1/customer_identity_verifications', params, maybePublishableKey(opts));
7
8
  return resp.data;
8
9
  }
9
- async get(id) {
10
- const resp = await this.client.get(`/v1/customer_identity_verifications/${id}`);
10
+ async createForCustomer(customerId, opts) {
11
+ const resp = await this.client.post(`/v1/customers/${customerId}/identity_verifications`, undefined, maybePublishableKey(opts));
11
12
  return resp.data;
12
13
  }
13
- async uploadDocuments(id, params) {
14
- const resp = await this.client.post(`/v1/customer_identity_verifications/${id}/upload_documents`, params);
14
+ async get(id, opts) {
15
+ const resp = await this.client.get(`/v1/customer_identity_verifications/${id}`, maybePublishableKey(opts));
15
16
  return resp.data;
16
17
  }
18
+ async submitForVerification(id, opts) {
19
+ const resp = await this.client.post(`/v1/customer_identity_verifications/${id}/submit`, undefined, maybePublishableKey(opts));
20
+ return resp.data;
21
+ }
22
+ async uploadDocuments(id, params, opts) {
23
+ const resp = await this.client.post(`/v1/customer_identity_verifications/${id}/upload_documents`, params, maybePublishableKey(opts));
24
+ return resp.data;
25
+ }
26
+ async uploadIdentityDocuments(id, documents, opts) {
27
+ if (documents.length === 0) {
28
+ throw new Error('uploadIdentityDocuments: documents array must not be empty');
29
+ }
30
+ const form = makeFormData();
31
+ for (const doc of documents) {
32
+ appendFile(form, doc);
33
+ }
34
+ const baseOpts = opts ?? {};
35
+ const callerHeaders = baseOpts.headers ?? {};
36
+ return this.client
37
+ .post(`/v1/customer_identity_verifications/${id}/upload_documents`, form, maybePublishableKey({
38
+ ...baseOpts,
39
+ headers: { ...callerHeaders, 'Content-Type': 'multipart/form-data' },
40
+ }))
41
+ .then((resp) => resp.data);
42
+ }
43
+ }
44
+ function isReactNative() {
45
+ const G = globalThis;
46
+ if (typeof G !== 'object' || G === null)
47
+ return false;
48
+ const nav = G.navigator;
49
+ return typeof nav?.product === 'string' && nav.product === 'ReactNative';
50
+ }
51
+ // Pick FormData by runtime, not by whether `require('form-data')` succeeds:
52
+ // form-data is a transitive dep of axios so the require succeeds on RN too,
53
+ // but it doesn't accept RN's { uri, type, name } file shape.
54
+ function makeFormData() {
55
+ if (isReactNative()) {
56
+ const G = globalThis;
57
+ const Ctor = G.FormData;
58
+ if (typeof Ctor !== 'function') {
59
+ throw new Error('React Native runtime detected but globalThis.FormData is missing. Polyfill required.');
60
+ }
61
+ return new Ctor();
62
+ }
63
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
64
+ const FormDataCtor = require('form-data');
65
+ return new FormDataCtor();
66
+ }
67
+ function isReactNativeFileDescriptor(file) {
68
+ return (typeof file === 'object' &&
69
+ file !== null &&
70
+ typeof file.uri === 'string');
71
+ }
72
+ function appendFile(form, doc) {
73
+ const fieldName = doc.field_name ?? doc.document_type;
74
+ const file = doc.file;
75
+ if (isReactNativeFileDescriptor(file)) {
76
+ form.append(fieldName, file);
77
+ return;
78
+ }
79
+ const fileOptions = {};
80
+ if (doc.file_name !== undefined)
81
+ fileOptions.filename = doc.file_name;
82
+ if (doc.content_type !== undefined)
83
+ fileOptions.contentType = doc.content_type;
84
+ form.append(fieldName, file, fileOptions);
17
85
  }
18
86
  //# sourceMappingURL=customer_identity-api.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"customer_identity-api.js","sourceRoot":"","sources":["../../src/api/customer_identity-api.ts"],"names":[],"mappings":"AAOA,MAAM,OAAO,gCAAgC;IAC3C,YAAoB,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;IAAG,CAAC;IAE7C,KAAK,CAAC,MAAM,CAAC,MAAgD;QAC3D,M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AG,GAAG,CAAC,UAAU,IAAI,GAAG,CAAC,aAAa,CAAC;IACtD,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;IAEtB,IAAI,2BAA2B,CAAC,IAAI,CAAC,EAAE,CAAC;QACtC,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QAC7B,OAAO;IACT,CAAC;IAED,MAAM,WAAW,GAAgD,EAAE,CAAC;IACpE,IAAI,GAAG,CAAC,SAAS,KAAK,SAAS;QAAE,WAAW,CAAC,QAAQ,GAAG,GAAG,CAAC,SAAS,CAAC;IACtE,IAAI,GAAG,CAAC,YAAY,KAAK,SAAS;QAAE,WAAW,CAAC,WAAW,GAAG,GAAG,CAAC,YAAY,CAAC;IAC/E,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC;AAC5C,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { AxiosInstance } from 'axios';
2
+ import type { AttestRequest, AttestResponse, ChallengeResponse } from '../types/device_attestation';
3
+ import { type RequestOptions } from '../client';
4
+ export declare class DeviceAttestationAPI {
5
+ private client;
6
+ constructor(client: AxiosInstance);
7
+ getChallenge(opts?: RequestOptions): Promise<ChallengeResponse>;
8
+ attest(params: AttestRequest, opts?: RequestOptions): Promise<AttestResponse>;
9
+ }
10
+ //# sourceMappingURL=device_attestation-api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"device_attestation-api.d.ts","sourceRoot":"","sources":["../../src/api/device_attestation-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,iBAAiB,EAClB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,WAAW,CAAC;AAEpE,qBAAa,oBAAoB;IACnB,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa;IAEnC,YAAY,CAAC,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAK/D,MAAM,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC;CAIpF"}
@@ -0,0 +1,15 @@
1
+ import { withPublishableKey } from '../client';
2
+ export class DeviceAttestationAPI {
3
+ constructor(client) {
4
+ this.client = client;
5
+ }
6
+ async getChallenge(opts) {
7
+ const resp = await this.client.post('/v1/client/device_attestation/challenge', undefined, withPublishableKey(opts));
8
+ return resp.data;
9
+ }
10
+ async attest(params, opts) {
11
+ const resp = await this.client.post('/v1/client/device_attestation/attest', params, withPublishableKey(opts));
12
+ return resp.data;
13
+ }
14
+ }
15
+ //# sourceMappingURL=device_attestation-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"device_attestation-api.js","sourceRoot":"","sources":["../../src/api/device_attestation-api.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,kBAAkB,EAAuB,MAAM,WAAW,CAAC;AAEpE,MAAM,OAAO,oBAAoB;IAC/B,YAAoB,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;IAAG,CAAC;IAE7C,KAAK,CAAC,YAAY,CAAC,IAAqB;QACtC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,yCAAyC,EAAE,SAAS,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC;QACpH,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,MAAqB,EAAE,IAAqB;QACvD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,sCAAsC,EAAE,MAAM,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC;QAC9G,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;CACF"}
@@ -1,8 +1,9 @@
1
1
  import type { AxiosInstance } from 'axios';
2
2
  import type { GeoComplianceStatus } from '../types/geo_compliance';
3
+ import { type RequestOptions } from '../client';
3
4
  export declare class GeoComplianceAPI {
4
5
  private client;
5
6
  constructor(client: AxiosInstance);
6
- get(accountId: string): Promise<GeoComplianceStatus>;
7
+ getAccountStatus(accountId: string, opts?: RequestOptions): Promise<GeoComplianceStatus>;
7
8
  }
8
9
  //# sourceMappingURL=geo_compliance-api.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"geo_compliance-api.d.ts","sourceRoot":"","sources":["../../src/api/geo_compliance-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,qBAAa,gBAAgB;IACf,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa;IAEnC,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAI3D"}
1
+ {"version":3,"file":"geo_compliance-api.d.ts","sourceRoot":"","sources":["../../src/api/geo_compliance-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAuB,KAAK,cAAc,EAAE,MAAM,WAAW,CAAC;AAErE,qBAAa,gBAAgB;IACf,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa;IAEnC,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAO/F"}
@@ -1,9 +1,10 @@
1
+ import { maybePublishableKey } from '../client';
1
2
  export class GeoComplianceAPI {
2
3
  constructor(client) {
3
4
  this.client = client;
4
5
  }
5
- async get(accountId) {
6
- const resp = await this.client.get(`/v1/accounts/${accountId}/geo_compliance`);
6
+ async getAccountStatus(accountId, opts) {
7
+ const resp = await this.client.get(`/v1/accounts/${accountId}/geo_compliance`, maybePublishableKey(opts));
7
8
  return resp.data;
8
9
  }
9
10
  }
@@ -1 +1 @@
1
- {"version":3,"file":"geo_compliance-api.js","sourceRoot":"","sources":["../../src/api/geo_compliance-api.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,gBAAgB;IAC3B,YAAoB,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;IAAG,CAAC;IAE7C,KAAK,CAAC,GAAG,CAAC,SAAiB;QACzB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,gBAAgB,SAAS,iBAAiB,CAAC,CAAC;QAC/E,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;CACF"}
1
+ {"version":3,"file":"geo_compliance-api.js","sourceRoot":"","sources":["../../src/api/geo_compliance-api.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAuB,MAAM,WAAW,CAAC;AAErE,MAAM,OAAO,gBAAgB;IAC3B,YAAoB,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;IAAG,CAAC;IAE7C,KAAK,CAAC,gBAAgB,CAAC,SAAiB,EAAE,IAAqB;QAC7D,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAChC,gBAAgB,SAAS,iBAAiB,EAC1C,mBAAmB,CAAC,IAAI,CAAC,CAC1B,CAAC;QACF,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;CACF"}
@@ -1,18 +1,23 @@
1
1
  import type { AxiosInstance } from 'axios';
2
- import type { PaymentMethod, PaymentMethodListResponse, CreateCardPaymentMethodParams, CreateACHPaymentMethodParams, UpdatePaymentMethodParams } from '../types/payment_methods';
2
+ import type { PaymentMethod, PaymentMethodListResponse, CreateCardPaymentMethodParams, CreateACHPaymentMethodParams, UpdatePaymentMethodParams, ConnectPlaidParams, CreateApplePayPaymentMethodParams, CreateGooglePayPaymentMethodParams } from '../types/payment_methods';
3
+ import { type RequestOptions } from '../client';
3
4
  export declare class PaymentMethodsAPI {
4
5
  private client;
5
6
  constructor(client: AxiosInstance);
6
- createCard(params: CreateCardPaymentMethodParams): Promise<PaymentMethod>;
7
- createACH(params: CreateACHPaymentMethodParams): Promise<PaymentMethod>;
7
+ createCard(params: CreateCardPaymentMethodParams, opts?: RequestOptions): Promise<PaymentMethod>;
8
+ createACH(params: CreateACHPaymentMethodParams, opts?: RequestOptions): Promise<PaymentMethod>;
9
+ createApplePayPaymentMethod(params: CreateApplePayPaymentMethodParams, opts?: RequestOptions): Promise<PaymentMethod>;
10
+ createGooglePayPaymentMethod(params: CreateGooglePayPaymentMethodParams, opts?: RequestOptions): Promise<PaymentMethod>;
8
11
  get(id: string): Promise<PaymentMethod>;
9
12
  list(per_page?: number, page?: number): Promise<PaymentMethodListResponse>;
10
- iterateAllPaymentMethods(per_page?: number): Promise<AsyncGenerator<PaymentMethod, any, any>>;
13
+ iterateAllPaymentMethods(per_page?: number): AsyncGenerator<PaymentMethod>;
11
14
  listForCustomer(customerId: string, per_page?: number, page?: number): Promise<PaymentMethodListResponse>;
12
15
  update(id: string, params: UpdatePaymentMethodParams): Promise<PaymentMethod>;
13
16
  attach(id: string, customerId: string): Promise<PaymentMethod>;
14
17
  detach(id: string): Promise<PaymentMethod>;
15
18
  block(id: string): Promise<PaymentMethod>;
16
19
  unblock(id: string): Promise<PaymentMethod>;
20
+ connectPlaid(params: ConnectPlaidParams, opts?: RequestOptions): Promise<PaymentMethod>;
21
+ connectPlaidBankAccount(params: ConnectPlaidParams, opts?: RequestOptions): Promise<PaymentMethod>;
17
22
  }
18
23
  //# sourceMappingURL=payment_methods-api.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"payment_methods-api.d.ts","sourceRoot":"","sources":["../../src/api/payment_methods-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,O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,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAK1C,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAKzC,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAK3C,YAAY,CAAC,MAAM,EAAE,kBAAkB,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;IAKvF,uBAAuB,CAAC,MAAM,EAAE,kBAAkB,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;CAGzG"}
@@ -1,28 +1,34 @@
1
1
  import { paginate } from '../utils/paginator';
2
+ import { maybePublishableKey } from '../client';
2
3
  export class PaymentMethodsAPI {
3
4
  constructor(client) {
4
5
  this.client = client;
5
6
  }
6
- // Create
7
- async createCard(params) {
8
- const resp = await this.client.post('/v1/payment_methods', params);
7
+ async createCard(params, opts) {
8
+ const resp = await this.client.post('/v1/payment_methods', params, maybePublishableKey(opts));
9
9
  return resp.data;
10
10
  }
11
- async createACH(params) {
12
- const resp = await this.client.post('/v1/payment_methods', params);
11
+ async createACH(params, opts) {
12
+ const resp = await this.client.post('/v1/payment_methods', params, maybePublishableKey(opts));
13
+ return resp.data;
14
+ }
15
+ async createApplePayPaymentMethod(params, opts) {
16
+ const resp = await this.client.post('/v1/payment_methods', params, maybePublishableKey({ usePublishableKey: true, ...opts }));
17
+ return resp.data;
18
+ }
19
+ async createGooglePayPaymentMethod(params, opts) {
20
+ const resp = await this.client.post('/v1/payment_methods', params, maybePublishableKey({ usePublishableKey: true, ...opts }));
13
21
  return resp.data;
14
22
  }
15
- // Retrieve
16
23
  async get(id) {
17
24
  const resp = await this.client.get(`/v1/payment_methods/${id}`);
18
25
  return resp.data;
19
26
  }
20
- // List
21
27
  async list(per_page, page) {
22
28
  const resp = await this.client.get('/v1/payment_methods', { params: { per_page, page } });
23
29
  return resp.data;
24
30
  }
25
- async iterateAllPaymentMethods(per_page = 20) {
31
+ iterateAllPaymentMethods(per_page = 20) {
26
32
  return paginate(async (page) => {
27
33
  const res = await this.client.get('/v1/payment_methods', {
28
34
  params: { per_page, page }
@@ -30,37 +36,38 @@ export class PaymentMethodsAPI {
30
36
  return res.data;
31
37
  }, per_page);
32
38
  }
33
- // Retrieve for customer
34
39
  async listForCustomer(customerId, per_page, page) {
35
40
  const resp = await this.client.get(`/v1/customers/${customerId}/payment_methods`, {
36
41
  params: { per_page, page }
37
42
  });
38
43
  return resp.data;
39
44
  }
40
- // Update
41
45
  async update(id, params) {
42
46
  const resp = await this.client.patch(`/v1/payment_methods/${id}`, params);
43
47
  return resp.data;
44
48
  }
45
- // Attach to customer
46
49
  async attach(id, customerId) {
47
50
  const resp = await this.client.post(`/v1/payment_methods/${id}/attach`, { customer: customerId });
48
51
  return resp.data;
49
52
  }
50
- // Detach from customer
51
53
  async detach(id) {
52
54
  const resp = await this.client.post(`/v1/payment_methods/${id}/detach`);
53
55
  return resp.data;
54
56
  }
55
- // Block
56
57
  async block(id) {
57
58
  const resp = await this.client.post(`/v1/payment_methods/${id}/block`);
58
59
  return resp.data;
59
60
  }
60
- // Unblock
61
61
  async unblock(id) {
62
62
  const resp = await this.client.post(`/v1/payment_methods/${id}/unblock`);
63
63
  return resp.data;
64
64
  }
65
+ async connectPlaid(params, opts) {
66
+ const resp = await this.client.post('/v1/payment_methods/connect_plaid', params, maybePublishableKey(opts));
67
+ return resp.data;
68
+ }
69
+ async connectPlaidBankAccount(params, opts) {
70
+ return this.connectPlaid(params, opts);
71
+ }
65
72
  }
66
73
  //# sourceMappingURL=payment_methods-api.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"payment_methods-api.js","sourceRoot":"","sources":["../../src/api/payment_methods-api.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,MAAM,OAAO,iBAAiB;IAC5B,YAAoB,MAAqB;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AC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACzC,CAAC;CACF"}
@@ -1,9 +1,10 @@
1
1
  import type { AxiosInstance } from 'axios';
2
2
  import type { PhoneVerification, CreatePhoneVerificationParams, ConfirmPhoneVerificationParams } from '../types/phone_verifications';
3
+ import { type RequestOptions } from '../client';
3
4
  export declare class PhoneVerificationsAPI {
4
5
  private client;
5
6
  constructor(client: AxiosInstance);
6
- create(accountId: string, params: CreatePhoneVerificationParams): Promise<PhoneVerification>;
7
- confirm(accountId: string, id: string, params: ConfirmPhoneVerificationParams): Promise<PhoneVerification>;
7
+ create(accountId: string, params: CreatePhoneVerificationParams, opts?: RequestOptions): Promise<PhoneVerification>;
8
+ confirm(accountId: string, id: string, params: ConfirmPhoneVerificationParams, opts?: RequestOptions): Promise<PhoneVerification>;
8
9
  }
9
10
  //# sourceMappingURL=phone_verifications-api.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"phone_verifications-api.d.ts","sourceRoot":"","sources":["../../src/api/phone_verifications-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EACV,iBAAiB,EACjB,6BAA6B,EAC7B,8BAA8B,EAC/B,MAAM,8BAA8B,CAAC;AAEtC,qBAAa,qBAAqB;IACpB,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa;IAEnC,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,6BAA6B,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAK5F,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,8BAA8B,GAAG,OAAO,CAAC,iBAAiB,CAAC;CAIjH"}
1
+ {"version":3,"file":"phone_verifications-api.d.ts","sourceRoot":"","sources":["../../src/api/phone_verifications-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EACV,iBAAiB,EACjB,6BAA6B,EAC7B,8BAA8B,EAC/B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAuB,KAAK,cAAc,EAAE,MAAM,WAAW,CAAC;AAErE,qBAAa,qBAAqB;IACpB,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa;IAEnC,MAAM,CACV,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,6BAA6B,EACrC,IAAI,CAAC,EAAE,cAAc,GACpB,OAAO,CAAC,iBAAiB,CAAC;IASvB,OAAO,CACX,SAAS,EAAE,MAAM,EACjB,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,8BAA8B,EACtC,IAAI,CAAC,EAAE,cAAc,GACpB,OAAO,CAAC,iBAAiB,CAAC;CAQ9B"}
@@ -1,13 +1,14 @@
1
+ import { maybePublishableKey } from '../client';
1
2
  export class PhoneVerificationsAPI {
2
3
  constructor(client) {
3
4
  this.client = client;
4
5
  }
5
- async create(accountId, params) {
6
- const resp = await this.client.post(`/v1/accounts/${accountId}/phone_verifications`, params);
6
+ async create(accountId, params, opts) {
7
+ const resp = await this.client.post(`/v1/accounts/${accountId}/phone_verifications`, params, maybePublishableKey(opts));
7
8
  return resp.data;
8
9
  }
9
- async confirm(accountId, id, params) {
10
- const resp = await this.client.post(`/v1/accounts/${accountId}/phone_verifications/${id}/confirm`, params);
10
+ async confirm(accountId, id, params, opts) {
11
+ const resp = await this.client.post(`/v1/accounts/${accountId}/phone_verifications/${id}/confirm`, params, maybePublishableKey(opts));
11
12
  return resp.data;
12
13
  }
13
14
  }
@@ -1 +1 @@
1
- {"version":3,"file":"phone_verifications-api.js","sourceRoot":"","sources":["../../src/api/phone_verifications-api.ts"],"names":[],"mappings":"AAOA,MAAM,OAAO,qBAAqB;IAChC,YAAoB,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;IAAG,CAAC;IAE7C,KAAK,CAAC,MAAM,CAAC,SAAiB,EAAE,MAAqC;QACnE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,SAAS,sBAAsB,EAAE,MAAM,CAAC,CAAC;QAC7F,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,SAAiB,EAAE,EAAU,EAAE,MAAsC;QACjF,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,SAAS,wBAAwB,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;QAC3G,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;CACF"}
1
+ {"version":3,"file":"phone_verifications-api.js","sourceRoot":"","sources":["../../src/api/phone_verifications-api.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,mBAAmB,EAAuB,MAAM,WAAW,CAAC;AAErE,MAAM,OAAO,qBAAqB;IAChC,YAAoB,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;IAAG,CAAC;IAE7C,KAAK,CAAC,MAAM,CACV,SAAiB,EACjB,MAAqC,EACrC,IAAqB;QAErB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CACjC,gBAAgB,SAAS,sBAAsB,EAC/C,MAAM,EACN,mBAAmB,CAAC,IAAI,CAAC,CAC1B,CAAC;QACF,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,OAAO,CACX,SAAiB,EACjB,EAAU,EACV,MAAsC,EACtC,IAAqB;QAErB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CACjC,gBAAgB,SAAS,wBAAwB,EAAE,UAAU,EAC7D,MAAM,EACN,mBAAmB,CAAC,IAAI,CAAC,CAC1B,CAAC;QACF,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;CACF"}
@@ -7,6 +7,5 @@ export declare class RefundsAPI {
7
7
  get(id: string): Promise<Refund>;
8
8
  list(per_page?: number, page?: number): Promise<RefundListResponse>;
9
9
  iterateAllRefunds(per_page?: number): Promise<AsyncGenerator<Refund, any, any>>;
10
- cancel(id: string): Promise<Refund>;
11
10
  }
12
11
  //# sourceMappingURL=refunds-api.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"refunds-api.d.ts","sourceRoot":"","sources":["../../src/api/refunds-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAGvF,qBAAa,UAAU;IACT,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa;IAEnC,MAAM,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC;IAKnD,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAKhC,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAKnE,iBAAiB,CAAC,QAAQ,SAAK;IAS/B,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAI1C"}
1
+ {"version":3,"file":"refunds-api.d.ts","sourceRoot":"","sources":["../../src/api/refunds-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAGvF,qBAAa,UAAU;IACT,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa;IAEnC,MAAM,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC;IAKnD,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAKhC,IAAI,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAKnE,iBAAiB,CAAC,QAAQ,SAAK;CAQtC"}
@@ -23,9 +23,5 @@ export class RefundsAPI {
23
23
  return res.data;
24
24
  }, per_page);
25
25
  }
26
- async cancel(id) {
27
- const resp = await this.client.post(`/v1/refunds/${id}/cancel`);
28
- return resp.data;
29
- }
30
26
  }
31
27
  //# sourceMappingURL=refunds-api.js.map