@getopenpay/openpay-js 0.1.21 → 0.2.1-alpha.129d519

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.d.ts CHANGED
@@ -80,6 +80,16 @@ declare type CustomInitParams = {
80
80
  */
81
81
  doNotMountOnInit?: boolean;
82
82
  };
83
+
84
+ googlePay?: {
85
+ env: 'demo' | 'prod';
86
+ doNotMountOnInit?: boolean;
87
+ };
88
+
89
+ applePay?: {
90
+ env: 'demo' | 'prod';
91
+ doNotMountOnInit?: boolean;
92
+ };
83
93
  };
84
94
 
85
95
  declare type ElementProps<PlaceholderType extends z.ZodTypeAny = z.ZodString> = {
@@ -193,6 +203,24 @@ declare class FormCallbacks {
193
203
  }
194
204
  }
195
205
 
206
+ declare type InitApplePayFlowResult =
207
+ | {
208
+ isAvailable: true;
209
+ startFlow: () => Promise<void>;
210
+ }
211
+ | {
212
+ isAvailable: false;
213
+ };
214
+
215
+ declare type InitGooglePayFlowResult =
216
+ | {
217
+ isAvailable: true;
218
+ startFlow: () => Promise<void>;
219
+ }
220
+ | {
221
+ isAvailable: false;
222
+ };
223
+
196
224
  declare type InitialStatus = {
197
225
  status: 'initial';
198
226
  isSuccess: false;
@@ -442,6 +470,17 @@ declare const OjsFlows = {
442
470
  run: runPockytPaypalFlow,
443
471
  },
444
472
 
473
+ // Airwallex
474
+ airwallexGooglePay: {
475
+ init: initAirwallexGooglePayFlow,
476
+ run: runAirwallexGooglePayFlow,
477
+ },
478
+
479
+ airwallexApplePay: {
480
+ init: initAirwallexApplePayFlow,
481
+ run: runAirwallexApplePayFlow,
482
+ },
483
+
445
484
  // 👉 Add more flows here
446
485
 
447
486
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -485,6 +524,14 @@ export declare class OpenPayForm {
485
524
  publisher: LoadedOncePublisher<InitStripeLinkFlowResult>;
486
525
  initialize: (initParams: InitOjsFlowParams) => Promise<void>;
487
526
  };
527
+ readonly airwallexGooglePay: {
528
+ publisher: LoadedOncePublisher<InitGooglePayFlowResult>;
529
+ initialize: (initParams: InitOjsFlowParams) => Promise<void>;
530
+ };
531
+ readonly airwallexApplePay: {
532
+ publisher: LoadedOncePublisher<InitApplePayFlowResult>;
533
+ initialize: (initParams: InitOjsFlowParams) => Promise<void>;
534
+ };
488
535
  };
489
536
  constructor(config: Config);
490
537
  /**
@@ -516,7 +563,7 @@ export declare class OpenPayForm {
516
563
  * Runs the common credit card flow
517
564
  */
518
565
  submitCard: () => void;
519
- generalSubmit: (method: "pockyt-paypal") => void;
566
+ generalSubmit: (method: SubmitMethod) => void | Promise<void>;
520
567
  /**
521
568
  * Alias for submitCard
522
569
  */
@@ -564,6 +611,8 @@ declare type StripeLinkController = {
564
611
  waitForButtonToMount: () => Promise<HTMLElement>;
565
612
  };
566
613
 
614
+ declare type SubmitMethod = 'pockyt-paypal' | 'airwallex-google-pay' | 'airwallex-apple-pay';
615
+
567
616
  declare type SuccessStatus<T> = {
568
617
  status: 'success';
569
618
  isSuccess: true;