@moonpay/platform-sdk-web 1.24.3 → 1.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +119 -84
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +28 -2
- package/dist/index.d.ts +28 -2
- package/dist/index.js +119 -84
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -2,10 +2,11 @@ import { ListPaymentMethodsResponse, GetQuoteParams, Quote, ListAssetsResponse,
|
|
|
2
2
|
export { AssetStatus, GetQuoteParams, ListAssetsResponse, ListPaymentMethodsResponse, PaginationInfo, PaymentMethodConfig, PaymentMethodType, PlatformAsset, Quote, SimulateBankTransferOutcome, SimulateBankTransferParams, SimulateSenderBankAccount, StoredCardPaymentMethod, StoredPaymentMethod, Transaction, TransactionWithStages } from '@moonpay/platform-protocol/api';
|
|
3
3
|
import { Customer } from '@moonpay/platform-protocol/api/customer';
|
|
4
4
|
export { Customer } from '@moonpay/platform-protocol/api/customer';
|
|
5
|
+
export { EnterpriseQuote } from '@moonpay/platform-protocol/api/enterprise';
|
|
5
6
|
export { CardResponse } from '@moonpay/platform-protocol/frames/add-card';
|
|
6
7
|
import * as ApplePayFrameTypes from '@moonpay/platform-protocol/frames/apple-pay';
|
|
7
8
|
export { ApplePayButtonSettings } from '@moonpay/platform-protocol/frames/apple-pay';
|
|
8
|
-
export { Cancellation as ChallengeCancellation, CompleteResult as ChallengeCompleteResult } from '@moonpay/platform-protocol/frames/challenge';
|
|
9
|
+
export { Cancellation as ChallengeCancellation, CompleteResult as ChallengeCompleteResult, ErrorCode as ChallengeErrorCode } from '@moonpay/platform-protocol/frames/challenge';
|
|
9
10
|
import { Connection } from '@moonpay/platform-protocol/models/connection';
|
|
10
11
|
export { Connection, ConnectionStatus } from '@moonpay/platform-protocol/models/connection';
|
|
11
12
|
import { Result } from '@moonpay/platform-protocol/result';
|
|
@@ -119,6 +120,7 @@ interface GooglePayFrame {
|
|
|
119
120
|
setQuote(signature: string): void;
|
|
120
121
|
dispose(): void;
|
|
121
122
|
}
|
|
123
|
+
/** @deprecated Use `SetupBuyButtonOptions` with `headless: true`. */
|
|
122
124
|
interface SetupBuyOptions {
|
|
123
125
|
/** Quote signature from getQuote(). */
|
|
124
126
|
quote: string;
|
|
@@ -129,6 +131,7 @@ interface SetupBuyOptions {
|
|
|
129
131
|
/** Callback for buy frame lifecycle events. */
|
|
130
132
|
onEvent?: (event: BuySdk.Event) => void;
|
|
131
133
|
}
|
|
134
|
+
/** @deprecated Use `BuyButtonFrame` from `setupBuyButton({ headless: true })`. */
|
|
132
135
|
interface BuyFrame {
|
|
133
136
|
/** Update the quote (e.g., after expiry). */
|
|
134
137
|
setQuote(signature: string): void;
|
|
@@ -145,6 +148,11 @@ interface SetupBuyButtonOptions {
|
|
|
145
148
|
presentation?: PresentationMode;
|
|
146
149
|
/** Styling for the Apple Pay button variant. Passed through to the frame, which is authoritative. */
|
|
147
150
|
applePayButtonSettings?: ApplePayFrameTypes.ApplePayButtonSettings;
|
|
151
|
+
/**
|
|
152
|
+
* Run the frame hidden, with no button: it processes the quote on load, the
|
|
153
|
+
* way the deprecated `setupBuy` did. `container` still hosts the hidden frame.
|
|
154
|
+
*/
|
|
155
|
+
headless?: boolean;
|
|
148
156
|
/** Callback for buy-button frame lifecycle events. */
|
|
149
157
|
onEvent?: (event: BuyButtonSdk.Event) => void;
|
|
150
158
|
}
|
|
@@ -278,6 +286,7 @@ interface Client {
|
|
|
278
286
|
* can be captured before disposal since the client token is held internally).
|
|
279
287
|
*/
|
|
280
288
|
resetConnection(): Promise<Result<void, ResetConnectionError>>;
|
|
289
|
+
/** @deprecated Use `setupBuyButton({ ...options, headless: true })`. The buy frame is being removed. */
|
|
281
290
|
setupBuy(options: SetupBuyOptions): Promise<Result<BuyFrame, BuySdk.SetupError>>;
|
|
282
291
|
setupBuyButton(options: SetupBuyButtonOptions): Promise<Result<BuyButtonFrame, BuyButtonSdk.SetupError>>;
|
|
283
292
|
setupChallenge(options: SetupChallengeOptions): Promise<Result<ChallengeFrame, ChallengeSdk.SetupError>>;
|
|
@@ -334,6 +343,23 @@ interface Client {
|
|
|
334
343
|
}, SubmitIdentityFilesError>>;
|
|
335
344
|
}
|
|
336
345
|
declare function createClient(options: CreateClientOptions): Client;
|
|
346
|
+
/** The payment frame methods available on both the standard and enterprise clients. */
|
|
347
|
+
type PaymentFrameMethods = Pick<Client, 'setupBuy' | 'setupBuyButton' | 'setupChallenge' | 'setupAddCard'>;
|
|
348
|
+
interface CreateEnterpriseClientOptions {
|
|
349
|
+
/** Client token from your server. Authorizes every enterprise frame. */
|
|
350
|
+
clientToken: string;
|
|
351
|
+
/** Override the frame base URL. Defaults to production. */
|
|
352
|
+
frameBaseUrl?: string;
|
|
353
|
+
/** Theme applied to every visible MoonPay frame. */
|
|
354
|
+
theme?: ThemeOptions;
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* The enterprise client exposes only the payment frames. Quotes, customers
|
|
358
|
+
* and transactions are API-driven for enterprise — call them from your server.
|
|
359
|
+
* For a buy without a visible button, use `setupBuyButton({ headless: true })`.
|
|
360
|
+
*/
|
|
361
|
+
type EnterpriseClient = Omit<PaymentFrameMethods, 'setupBuy'>;
|
|
362
|
+
declare function createEnterpriseClient(options: CreateEnterpriseClientOptions): EnterpriseClient;
|
|
337
363
|
|
|
338
364
|
/**
|
|
339
365
|
* FrameTransport implementation for web browsers using HTMLIFrameElement
|
|
@@ -352,4 +378,4 @@ declare class IframeTransport implements FrameTransport {
|
|
|
352
378
|
private handleMessage;
|
|
353
379
|
}
|
|
354
380
|
|
|
355
|
-
export { type AddCardFrame, type ApplePayFrame, type AuthFrame, type BuyButtonFrame, type BuyFrame, type ChallengeFrame, type Client, type ConnectFrame, type ConnectOptions, type CreateClientOptions, type CustomerExportFrame, type GetConnectionOptions, type GooglePayFrame, IframeTransport, type SetupAddCardOptions, type SetupApplePayOptions, type SetupAuthOptions, type SetupBuyButtonOptions, type SetupBuyOptions, type SetupChallengeOptions, type SetupCustomerExportOptions, type SetupGooglePayOptions, type SetupWidgetOptions, type WidgetFrame, createClient };
|
|
381
|
+
export { type AddCardFrame, type ApplePayFrame, type AuthFrame, type BuyButtonFrame, type BuyFrame, type ChallengeFrame, type Client, type ConnectFrame, type ConnectOptions, type CreateClientOptions, type CreateEnterpriseClientOptions, type CustomerExportFrame, type EnterpriseClient, type GetConnectionOptions, type GooglePayFrame, IframeTransport, type SetupAddCardOptions, type SetupApplePayOptions, type SetupAuthOptions, type SetupBuyButtonOptions, type SetupBuyOptions, type SetupChallengeOptions, type SetupCustomerExportOptions, type SetupGooglePayOptions, type SetupWidgetOptions, type WidgetFrame, createClient, createEnterpriseClient };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,10 +2,11 @@ import { ListPaymentMethodsResponse, GetQuoteParams, Quote, ListAssetsResponse,
|
|
|
2
2
|
export { AssetStatus, GetQuoteParams, ListAssetsResponse, ListPaymentMethodsResponse, PaginationInfo, PaymentMethodConfig, PaymentMethodType, PlatformAsset, Quote, SimulateBankTransferOutcome, SimulateBankTransferParams, SimulateSenderBankAccount, StoredCardPaymentMethod, StoredPaymentMethod, Transaction, TransactionWithStages } from '@moonpay/platform-protocol/api';
|
|
3
3
|
import { Customer } from '@moonpay/platform-protocol/api/customer';
|
|
4
4
|
export { Customer } from '@moonpay/platform-protocol/api/customer';
|
|
5
|
+
export { EnterpriseQuote } from '@moonpay/platform-protocol/api/enterprise';
|
|
5
6
|
export { CardResponse } from '@moonpay/platform-protocol/frames/add-card';
|
|
6
7
|
import * as ApplePayFrameTypes from '@moonpay/platform-protocol/frames/apple-pay';
|
|
7
8
|
export { ApplePayButtonSettings } from '@moonpay/platform-protocol/frames/apple-pay';
|
|
8
|
-
export { Cancellation as ChallengeCancellation, CompleteResult as ChallengeCompleteResult } from '@moonpay/platform-protocol/frames/challenge';
|
|
9
|
+
export { Cancellation as ChallengeCancellation, CompleteResult as ChallengeCompleteResult, ErrorCode as ChallengeErrorCode } from '@moonpay/platform-protocol/frames/challenge';
|
|
9
10
|
import { Connection } from '@moonpay/platform-protocol/models/connection';
|
|
10
11
|
export { Connection, ConnectionStatus } from '@moonpay/platform-protocol/models/connection';
|
|
11
12
|
import { Result } from '@moonpay/platform-protocol/result';
|
|
@@ -119,6 +120,7 @@ interface GooglePayFrame {
|
|
|
119
120
|
setQuote(signature: string): void;
|
|
120
121
|
dispose(): void;
|
|
121
122
|
}
|
|
123
|
+
/** @deprecated Use `SetupBuyButtonOptions` with `headless: true`. */
|
|
122
124
|
interface SetupBuyOptions {
|
|
123
125
|
/** Quote signature from getQuote(). */
|
|
124
126
|
quote: string;
|
|
@@ -129,6 +131,7 @@ interface SetupBuyOptions {
|
|
|
129
131
|
/** Callback for buy frame lifecycle events. */
|
|
130
132
|
onEvent?: (event: BuySdk.Event) => void;
|
|
131
133
|
}
|
|
134
|
+
/** @deprecated Use `BuyButtonFrame` from `setupBuyButton({ headless: true })`. */
|
|
132
135
|
interface BuyFrame {
|
|
133
136
|
/** Update the quote (e.g., after expiry). */
|
|
134
137
|
setQuote(signature: string): void;
|
|
@@ -145,6 +148,11 @@ interface SetupBuyButtonOptions {
|
|
|
145
148
|
presentation?: PresentationMode;
|
|
146
149
|
/** Styling for the Apple Pay button variant. Passed through to the frame, which is authoritative. */
|
|
147
150
|
applePayButtonSettings?: ApplePayFrameTypes.ApplePayButtonSettings;
|
|
151
|
+
/**
|
|
152
|
+
* Run the frame hidden, with no button: it processes the quote on load, the
|
|
153
|
+
* way the deprecated `setupBuy` did. `container` still hosts the hidden frame.
|
|
154
|
+
*/
|
|
155
|
+
headless?: boolean;
|
|
148
156
|
/** Callback for buy-button frame lifecycle events. */
|
|
149
157
|
onEvent?: (event: BuyButtonSdk.Event) => void;
|
|
150
158
|
}
|
|
@@ -278,6 +286,7 @@ interface Client {
|
|
|
278
286
|
* can be captured before disposal since the client token is held internally).
|
|
279
287
|
*/
|
|
280
288
|
resetConnection(): Promise<Result<void, ResetConnectionError>>;
|
|
289
|
+
/** @deprecated Use `setupBuyButton({ ...options, headless: true })`. The buy frame is being removed. */
|
|
281
290
|
setupBuy(options: SetupBuyOptions): Promise<Result<BuyFrame, BuySdk.SetupError>>;
|
|
282
291
|
setupBuyButton(options: SetupBuyButtonOptions): Promise<Result<BuyButtonFrame, BuyButtonSdk.SetupError>>;
|
|
283
292
|
setupChallenge(options: SetupChallengeOptions): Promise<Result<ChallengeFrame, ChallengeSdk.SetupError>>;
|
|
@@ -334,6 +343,23 @@ interface Client {
|
|
|
334
343
|
}, SubmitIdentityFilesError>>;
|
|
335
344
|
}
|
|
336
345
|
declare function createClient(options: CreateClientOptions): Client;
|
|
346
|
+
/** The payment frame methods available on both the standard and enterprise clients. */
|
|
347
|
+
type PaymentFrameMethods = Pick<Client, 'setupBuy' | 'setupBuyButton' | 'setupChallenge' | 'setupAddCard'>;
|
|
348
|
+
interface CreateEnterpriseClientOptions {
|
|
349
|
+
/** Client token from your server. Authorizes every enterprise frame. */
|
|
350
|
+
clientToken: string;
|
|
351
|
+
/** Override the frame base URL. Defaults to production. */
|
|
352
|
+
frameBaseUrl?: string;
|
|
353
|
+
/** Theme applied to every visible MoonPay frame. */
|
|
354
|
+
theme?: ThemeOptions;
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* The enterprise client exposes only the payment frames. Quotes, customers
|
|
358
|
+
* and transactions are API-driven for enterprise — call them from your server.
|
|
359
|
+
* For a buy without a visible button, use `setupBuyButton({ headless: true })`.
|
|
360
|
+
*/
|
|
361
|
+
type EnterpriseClient = Omit<PaymentFrameMethods, 'setupBuy'>;
|
|
362
|
+
declare function createEnterpriseClient(options: CreateEnterpriseClientOptions): EnterpriseClient;
|
|
337
363
|
|
|
338
364
|
/**
|
|
339
365
|
* FrameTransport implementation for web browsers using HTMLIFrameElement
|
|
@@ -352,4 +378,4 @@ declare class IframeTransport implements FrameTransport {
|
|
|
352
378
|
private handleMessage;
|
|
353
379
|
}
|
|
354
380
|
|
|
355
|
-
export { type AddCardFrame, type ApplePayFrame, type AuthFrame, type BuyButtonFrame, type BuyFrame, type ChallengeFrame, type Client, type ConnectFrame, type ConnectOptions, type CreateClientOptions, type CustomerExportFrame, type GetConnectionOptions, type GooglePayFrame, IframeTransport, type SetupAddCardOptions, type SetupApplePayOptions, type SetupAuthOptions, type SetupBuyButtonOptions, type SetupBuyOptions, type SetupChallengeOptions, type SetupCustomerExportOptions, type SetupGooglePayOptions, type SetupWidgetOptions, type WidgetFrame, createClient };
|
|
381
|
+
export { type AddCardFrame, type ApplePayFrame, type AuthFrame, type BuyButtonFrame, type BuyFrame, type ChallengeFrame, type Client, type ConnectFrame, type ConnectOptions, type CreateClientOptions, type CreateEnterpriseClientOptions, type CustomerExportFrame, type EnterpriseClient, type GetConnectionOptions, type GooglePayFrame, IframeTransport, type SetupAddCardOptions, type SetupApplePayOptions, type SetupAuthOptions, type SetupBuyButtonOptions, type SetupBuyOptions, type SetupChallengeOptions, type SetupCustomerExportOptions, type SetupGooglePayOptions, type SetupWidgetOptions, type WidgetFrame, createClient, createEnterpriseClient };
|
package/dist/index.js
CHANGED
|
@@ -564,6 +564,99 @@ function createClient(options) {
|
|
|
564
564
|
return ok(void 0);
|
|
565
565
|
}
|
|
566
566
|
}
|
|
567
|
+
const { setupBuy, setupBuyButton, setupChallenge, setupAddCard } = createPaymentFrameMethods({
|
|
568
|
+
core,
|
|
569
|
+
frameBaseUrl,
|
|
570
|
+
theme
|
|
571
|
+
});
|
|
572
|
+
async function setupCustomerExport(opts) {
|
|
573
|
+
const channelId = `customer-export-${crypto.randomUUID()}`;
|
|
574
|
+
const url = buildFrameUrl(
|
|
575
|
+
FRAME_PATHS.customerExport,
|
|
576
|
+
{
|
|
577
|
+
channelId,
|
|
578
|
+
clientToken: core.context.clientToken,
|
|
579
|
+
...themeParams(theme),
|
|
580
|
+
...presentationParams(opts.presentation)
|
|
581
|
+
},
|
|
582
|
+
{ frameBaseUrl }
|
|
583
|
+
);
|
|
584
|
+
const transport = core.createTransport();
|
|
585
|
+
try {
|
|
586
|
+
const handle = await createFrameOrchestrator({
|
|
587
|
+
transport,
|
|
588
|
+
channelId,
|
|
589
|
+
url,
|
|
590
|
+
container: opts.container
|
|
591
|
+
});
|
|
592
|
+
handle.onMessage((msg) => {
|
|
593
|
+
switch (msg.kind) {
|
|
594
|
+
case "ready":
|
|
595
|
+
opts.onEvent?.({ kind: "ready" });
|
|
596
|
+
break;
|
|
597
|
+
case "complete":
|
|
598
|
+
opts.onEvent?.({
|
|
599
|
+
kind: "complete",
|
|
600
|
+
payload: msg.payload
|
|
601
|
+
});
|
|
602
|
+
break;
|
|
603
|
+
case "error":
|
|
604
|
+
opts.onEvent?.({
|
|
605
|
+
kind: "error",
|
|
606
|
+
payload: msg.payload
|
|
607
|
+
});
|
|
608
|
+
break;
|
|
609
|
+
case "close":
|
|
610
|
+
opts.onEvent?.({ kind: "close" });
|
|
611
|
+
break;
|
|
612
|
+
}
|
|
613
|
+
});
|
|
614
|
+
return ok({ dispose: () => handle.dispose() });
|
|
615
|
+
} catch (e) {
|
|
616
|
+
return err({
|
|
617
|
+
kind: "genericError",
|
|
618
|
+
message: e instanceof Error ? e.message : "Customer export setup failed"
|
|
619
|
+
});
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
return {
|
|
623
|
+
getConnection,
|
|
624
|
+
connect,
|
|
625
|
+
setupAuth,
|
|
626
|
+
getCredentials: () => core.getCredentials(),
|
|
627
|
+
getPaymentMethods: (params) => core.getPaymentMethods(params),
|
|
628
|
+
getQuote: (params) => core.getQuote(params),
|
|
629
|
+
getAssets: (params) => core.getAssets(params),
|
|
630
|
+
listTransactions: (params) => core.listTransactions(params),
|
|
631
|
+
getTransaction: (id) => core.getTransaction(id),
|
|
632
|
+
simulateBankTransfer: (id, params) => core.simulateBankTransfer(id, params),
|
|
633
|
+
deletePaymentMethod: (id) => core.deletePaymentMethod(id),
|
|
634
|
+
resetConnection,
|
|
635
|
+
setupWidget,
|
|
636
|
+
setupApplePay,
|
|
637
|
+
setupGooglePay,
|
|
638
|
+
setupBuy,
|
|
639
|
+
setupBuyButton,
|
|
640
|
+
setupChallenge,
|
|
641
|
+
setupAddCard,
|
|
642
|
+
setupCustomerExport,
|
|
643
|
+
getCustomer: (id) => core.getCustomer(id),
|
|
644
|
+
submitCustomerKyc: (id, body) => core.submitCustomerKyc(id, body),
|
|
645
|
+
getCustomerUploadUrl: (id, body) => core.getCustomerUploadUrl(id, body),
|
|
646
|
+
submitCustomerFiles: (id, body) => core.submitCustomerFiles(id, body),
|
|
647
|
+
createIdentity: (body) => core.createIdentity(body),
|
|
648
|
+
getIdentity: (id) => core.getIdentity(id),
|
|
649
|
+
updateIdentity: (id, body) => core.updateIdentity(id, body),
|
|
650
|
+
verifyIdentity: (id) => core.verifyIdentity(id),
|
|
651
|
+
getIdentityUploadUrl: (id, body) => core.getIdentityUploadUrl(id, body),
|
|
652
|
+
submitIdentityFiles: (id, body) => core.submitIdentityFiles(id, body)
|
|
653
|
+
};
|
|
654
|
+
}
|
|
655
|
+
function createPaymentFrameMethods({
|
|
656
|
+
core,
|
|
657
|
+
frameBaseUrl,
|
|
658
|
+
theme
|
|
659
|
+
}) {
|
|
567
660
|
async function setupBuy(opts) {
|
|
568
661
|
const channelId = `buy-${crypto.randomUUID()}`;
|
|
569
662
|
const url = buildFrameUrl(
|
|
@@ -636,6 +729,7 @@ function createClient(options) {
|
|
|
636
729
|
signature: opts.quote,
|
|
637
730
|
...opts.externalTransactionId && { externalTransactionId: opts.externalTransactionId },
|
|
638
731
|
...opts.applePayButtonSettings && { applePayButtonSettings: opts.applePayButtonSettings },
|
|
732
|
+
...opts.headless && { headless: true },
|
|
639
733
|
...themeParams(theme),
|
|
640
734
|
...presentationParams(opts.presentation)
|
|
641
735
|
},
|
|
@@ -647,7 +741,8 @@ function createClient(options) {
|
|
|
647
741
|
transport,
|
|
648
742
|
channelId,
|
|
649
743
|
url,
|
|
650
|
-
container: opts.container
|
|
744
|
+
container: opts.container,
|
|
745
|
+
hidden: opts.headless
|
|
651
746
|
});
|
|
652
747
|
const setQuote = (signature) => {
|
|
653
748
|
handle.sendMessage({
|
|
@@ -677,6 +772,12 @@ function createClient(options) {
|
|
|
677
772
|
payload: msg.payload
|
|
678
773
|
});
|
|
679
774
|
break;
|
|
775
|
+
case "cancelled":
|
|
776
|
+
opts.onEvent?.({
|
|
777
|
+
kind: "cancelled",
|
|
778
|
+
payload: msg.payload
|
|
779
|
+
});
|
|
780
|
+
break;
|
|
680
781
|
case "error":
|
|
681
782
|
opts.onEvent?.({
|
|
682
783
|
kind: "error",
|
|
@@ -805,92 +906,26 @@ function createClient(options) {
|
|
|
805
906
|
});
|
|
806
907
|
}
|
|
807
908
|
}
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
transport,
|
|
824
|
-
channelId,
|
|
825
|
-
url,
|
|
826
|
-
container: opts.container
|
|
827
|
-
});
|
|
828
|
-
handle.onMessage((msg) => {
|
|
829
|
-
switch (msg.kind) {
|
|
830
|
-
case "ready":
|
|
831
|
-
opts.onEvent?.({ kind: "ready" });
|
|
832
|
-
break;
|
|
833
|
-
case "complete":
|
|
834
|
-
opts.onEvent?.({
|
|
835
|
-
kind: "complete",
|
|
836
|
-
payload: msg.payload
|
|
837
|
-
});
|
|
838
|
-
break;
|
|
839
|
-
case "error":
|
|
840
|
-
opts.onEvent?.({
|
|
841
|
-
kind: "error",
|
|
842
|
-
payload: msg.payload
|
|
843
|
-
});
|
|
844
|
-
break;
|
|
845
|
-
case "close":
|
|
846
|
-
opts.onEvent?.({ kind: "close" });
|
|
847
|
-
break;
|
|
848
|
-
}
|
|
849
|
-
});
|
|
850
|
-
return ok({ dispose: () => handle.dispose() });
|
|
851
|
-
} catch (e) {
|
|
852
|
-
return err({
|
|
853
|
-
kind: "genericError",
|
|
854
|
-
message: e instanceof Error ? e.message : "Customer export setup failed"
|
|
855
|
-
});
|
|
856
|
-
}
|
|
857
|
-
}
|
|
858
|
-
return {
|
|
859
|
-
getConnection,
|
|
860
|
-
connect,
|
|
861
|
-
setupAuth,
|
|
862
|
-
getCredentials: () => core.getCredentials(),
|
|
863
|
-
getPaymentMethods: (params) => core.getPaymentMethods(params),
|
|
864
|
-
getQuote: (params) => core.getQuote(params),
|
|
865
|
-
getAssets: (params) => core.getAssets(params),
|
|
866
|
-
listTransactions: (params) => core.listTransactions(params),
|
|
867
|
-
getTransaction: (id) => core.getTransaction(id),
|
|
868
|
-
simulateBankTransfer: (id, params) => core.simulateBankTransfer(id, params),
|
|
869
|
-
deletePaymentMethod: (id) => core.deletePaymentMethod(id),
|
|
870
|
-
resetConnection,
|
|
871
|
-
setupWidget,
|
|
872
|
-
setupApplePay,
|
|
873
|
-
setupGooglePay,
|
|
874
|
-
setupBuy,
|
|
875
|
-
setupBuyButton,
|
|
876
|
-
setupChallenge,
|
|
877
|
-
setupAddCard,
|
|
878
|
-
setupCustomerExport,
|
|
879
|
-
getCustomer: (id) => core.getCustomer(id),
|
|
880
|
-
submitCustomerKyc: (id, body) => core.submitCustomerKyc(id, body),
|
|
881
|
-
getCustomerUploadUrl: (id, body) => core.getCustomerUploadUrl(id, body),
|
|
882
|
-
submitCustomerFiles: (id, body) => core.submitCustomerFiles(id, body),
|
|
883
|
-
createIdentity: (body) => core.createIdentity(body),
|
|
884
|
-
getIdentity: (id) => core.getIdentity(id),
|
|
885
|
-
updateIdentity: (id, body) => core.updateIdentity(id, body),
|
|
886
|
-
verifyIdentity: (id) => core.verifyIdentity(id),
|
|
887
|
-
getIdentityUploadUrl: (id, body) => core.getIdentityUploadUrl(id, body),
|
|
888
|
-
submitIdentityFiles: (id, body) => core.submitIdentityFiles(id, body)
|
|
889
|
-
};
|
|
909
|
+
return { setupBuy, setupBuyButton, setupChallenge, setupAddCard };
|
|
910
|
+
}
|
|
911
|
+
function createEnterpriseClient(options) {
|
|
912
|
+
const { clientToken, frameBaseUrl, theme } = options;
|
|
913
|
+
const core = createClientCore({
|
|
914
|
+
frameBaseUrl,
|
|
915
|
+
createTransport: () => new IframeTransport()
|
|
916
|
+
});
|
|
917
|
+
core.context.setClientToken(clientToken);
|
|
918
|
+
const { setupBuyButton, setupChallenge, setupAddCard } = createPaymentFrameMethods({
|
|
919
|
+
core,
|
|
920
|
+
frameBaseUrl,
|
|
921
|
+
theme
|
|
922
|
+
});
|
|
923
|
+
return { setupBuyButton, setupChallenge, setupAddCard };
|
|
890
924
|
}
|
|
891
925
|
export {
|
|
892
926
|
ConnectionStatus2 as ConnectionStatus,
|
|
893
927
|
IframeTransport,
|
|
894
|
-
createClient
|
|
928
|
+
createClient,
|
|
929
|
+
createEnterpriseClient
|
|
895
930
|
};
|
|
896
931
|
//# sourceMappingURL=index.js.map
|