@getopenpay/openpay-js 0.3.10 → 0.3.14-alpha.7c935e9

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.
@@ -1,7 +1,7 @@
1
- import { R as l } from "./Resource-BwnYhNnF.js";
2
- import { d as ee } from "./Resource-BwnYhNnF.js";
3
- import { d as v } from "./diag-api-CiDu2N_T.js";
4
- import { e as A, f as m, g as b, h as w, S as D } from "./sdk-info-BT4XAByS.js";
1
+ import { R as l } from "./Resource-BRYzUqve.js";
2
+ import { d as ee } from "./Resource-BRYzUqve.js";
3
+ import { d as v } from "./diag-api-_xbEFcQo.js";
4
+ import { e as A, f as m, g as b, h as w, S as D } from "./sdk-info-BKkfy_B_.js";
5
5
  var T = (
6
6
  /** @class */
7
7
  function() {
@@ -1,7 +1,7 @@
1
- import { R as u } from "./index-CsHbuY7s.js";
2
- import { B as c } from "./SimpleSpanProcessor-CNeg-HkI.js";
3
- import { A as g, b as x, a as S, C as b, F as w, I as P, N as C, P as T, R as O, d as M, S as A, e as E, c as R, T as N } from "./SimpleSpanProcessor-CNeg-HkI.js";
4
- import { P as F, a as j, b as k, g as I, c as W, h as U, n as X, p as z, s as D, d as G } from "./utils-CylBTH09.js";
1
+ import { R as u } from "./index-DfP3YYx1.js";
2
+ import { B as c } from "./SimpleSpanProcessor-CdfYCCJi.js";
3
+ import { A as g, b as x, a as S, C as b, F as w, I as P, N as C, P as T, R as O, d as M, S as A, e as E, c as R, T as N } from "./SimpleSpanProcessor-CdfYCCJi.js";
4
+ import { P as F, a as j, b as k, g as I, c as W, h as U, n as X, p as z, s as D, d as G } from "./utils-CJptw95A.js";
5
5
  var l = function(n, r) {
6
6
  var e = typeof Symbol == "function" && n[Symbol.iterator];
7
7
  if (!e) return n;
@@ -1,4 +1,4 @@
1
- import { b as I, t as l, i as D, T as o, d as T, e as b } from "./index-CsHbuY7s.js";
1
+ import { b as I, t as l, i as D, T as o, d as T, e as b } from "./index-DfP3YYx1.js";
2
2
  var C = I("OpenTelemetry SDK Context Key SUPPRESS_TRACING");
3
3
  function A(r) {
4
4
  return r.getValue(C) === !0;
@@ -1,8 +1,8 @@
1
- import { z as de, p as T, r as _e, w as ye, j as ve, n as he, y as me, dJ as ge, h as Se, dK as Ae, l as Ee, q as Te, i as Pe, m as Re, o as Oe, t as be, u as Ce } from "./url-BQFdlass.js";
2
- import { b as k, t as O, i as Y, T as b, d as Ie, c as B } from "./index-CsHbuY7s.js";
3
- import { d as _ } from "./diag-api-CiDu2N_T.js";
1
+ import { z as de, p as T, r as _e, w as ye, j as ve, n as he, y as me, dJ as ge, h as Se, dK as Ae, l as Ee, q as Te, i as Pe, m as Re, o as Oe, t as be, u as Ce } from "./url-DMJTnK7v.js";
2
+ import { b as k, t as O, i as Y, T as b, d as Ie, c as B } from "./index-DfP3YYx1.js";
3
+ import { d as _ } from "./diag-api-_xbEFcQo.js";
4
4
  import { h as X, E as je } from "./ExportResult-Bo1QOwfo.js";
5
- import { D as Me, j as Ne, br as we, bs as De, bt as Le, b as xe, T as Ge, bu as Be, h as Ve, i as Ue, bv as He } from "./sdk-info-BT4XAByS.js";
5
+ import { D as Me, j as Ne, br as we, bs as De, bt as Le, b as xe, T as Ge, bu as Be, h as Ve, i as Ue, bv as He } from "./sdk-info-BKkfy_B_.js";
6
6
  import { _ as Ke } from "./utils-BGeftTvk.js";
7
7
  var p;
8
8
  (function(e) {
package/dist/index.d.ts CHANGED
@@ -524,6 +524,12 @@ declare type LoopCryptoFlowCustomParams =
524
524
  | {
525
525
  customer: Omit<CustomerResponse, 'paymentMethods' | 'merchants' | 'dateCreated'>;
526
526
  payin: PayInCompleteEvent;
527
+ mode: 'checkout';
528
+ success: true;
529
+ }
530
+ | {
531
+ customer: Omit<CustomerResponse, 'paymentMethods' | 'merchants' | 'dateCreated'>;
532
+ mode: 'setup';
527
533
  success: true;
528
534
  }
529
535
  | {
@@ -537,6 +543,7 @@ declare type LoopCryptoFlowCustomParams =
537
543
  declare type LoopCryptoWidgetProps = {
538
544
  paymentUsdAmount: number;
539
545
  suggestedAuthorizationUsdAmount: number;
546
+ minAuthorizationUsdAmount: number;
540
547
  subscriptionRefId?: string;
541
548
  customerRefId?: string;
542
549
  invoiceRefId?: string;
@@ -684,6 +691,17 @@ declare const OjsFlows = {
684
691
  init: initAuthnetGooglePayFlow,
685
692
  run: runAuthnetGooglePayFlow,
686
693
  },
694
+
695
+ adyenGooglePay: {
696
+ init: initAdyenGooglePayFlow,
697
+ run: runAdyenGooglePayFlow,
698
+ },
699
+
700
+ adyenApplePay: {
701
+ init: initAdyenApplePayFlow,
702
+ run: runAdyenApplePayFlow,
703
+ },
704
+
687
705
  // 👉 Add more flows here
688
706
 
689
707
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -761,6 +779,14 @@ export declare class OpenPayForm {
761
779
  publisher: LoadedOncePublisher<InitApplePayFlowResult>;
762
780
  initialize: (initParams: InitOjsFlowParams) => Promise<void>;
763
781
  };
782
+ readonly adyenGooglePay: {
783
+ publisher: LoadedOncePublisher<InitGooglePayFlowResult>;
784
+ initialize: (initParams: InitOjsFlowParams) => Promise<void>;
785
+ };
786
+ readonly adyenApplePay: {
787
+ publisher: LoadedOncePublisher<InitApplePayFlowResult>;
788
+ initialize: (initParams: InitOjsFlowParams) => Promise<void>;
789
+ };
764
790
  };
765
791
  private deviceToken;
766
792
  private isSubmitting;
@@ -797,18 +823,6 @@ export declare class OpenPayForm {
797
823
  private checkValidFormInstance;
798
824
  getAvailablePaymentMethods: () => Promise<({
799
825
  name: string;
800
- } | {
801
- processor: PaymentProcessor;
802
- isAvailable: boolean;
803
- isLoading: boolean;
804
- startFlow: (customParams?: ApplePayFlowCustomParams) => Promise<void>;
805
- name: string;
806
- } | {
807
- processor: PaymentProcessor;
808
- isAvailable: boolean;
809
- isLoading: boolean;
810
- startFlow: (customParams?: GooglePayFlowCustomParams) => Promise<void>;
811
- name: string;
812
826
  } | {
813
827
  isAvailable: true;
814
828
  widgetProps: LoopCryptoWidgetProps;
@@ -817,6 +831,12 @@ export declare class OpenPayForm {
817
831
  } | {
818
832
  isAvailable: false;
819
833
  name: string;
834
+ } | {
835
+ processor: PaymentProcessor;
836
+ isAvailable: boolean;
837
+ isLoading: boolean;
838
+ startFlow: (customParams?: ApplePayFlowCustomParams) => Promise<void>;
839
+ name: string;
820
840
  } | {
821
841
  processor: "stripe";
822
842
  isAvailable: true;
@@ -836,6 +856,12 @@ export declare class OpenPayForm {
836
856
  isAvailable: boolean;
837
857
  startFlow: () => Promise<void>;
838
858
  name: string;
859
+ } | {
860
+ processor: PaymentProcessor;
861
+ isAvailable: boolean;
862
+ isLoading: boolean;
863
+ startFlow: (customParams?: GooglePayFlowCustomParams) => Promise<void>;
864
+ name: string;
839
865
  })[]>;
840
866
  generalSubmit: <T extends SubmitMethod>(method: T, settings?: SubmitSettings<T>) => Promise<void>;
841
867
  /**
@@ -855,10 +881,13 @@ export declare class OpenPayForm {
855
881
  declare interface PayInCompleteEvent extends PayinResponse {}
856
882
 
857
883
  declare enum PayInFailed {
884
+ // Create payment method
885
+ METHOD_CREATION_FAILED = 'methodCreationFailed',
858
886
  INSUFFICIENT_BALANCE = 'insufficientBalance',
859
887
  INSUFFICIENT_AUTHORIZATION = 'insufficientAuthorization',
860
888
  SIGNED_MESSAGE_REQUIRED = 'signedMessageRequired',
861
889
  CUSTOMER_CREATION_FAILED = 'customerCreationFailed',
890
+ // Create pay-in
862
891
  PAYMENT_FAILED = 'paymentFailed',
863
892
  TRANSACTION_FAILED = 'transactionFailed',
864
893
  }
@@ -1067,7 +1096,7 @@ declare interface PaymentMethodTokenExchangeRate {
1067
1096
  timestamp: number;
1068
1097
  }
1069
1098
 
1070
- declare const PaymentProcessor = z.enum(['stripe', 'airwallex', 'authorize_net']);
1099
+ declare const PaymentProcessor = z.enum(['stripe', 'airwallex', 'authorize_net', 'adyen']);
1071
1100
 
1072
1101
  declare type PaymentProcessor = z.infer<typeof PaymentProcessor>;
1073
1102
 
@@ -1134,6 +1163,8 @@ declare type ProcessorSpecificSubmitSettings<T extends SubmitMethod = SubmitMeth
1134
1163
  'airwallex-apple-pay': ApplePayFlowCustomParams;
1135
1164
  'authorizenet-google-pay': GooglePayFlowCustomParams;
1136
1165
  'authorizenet-apple-pay': ApplePayFlowCustomParams;
1166
+ 'adyen-google-pay': GooglePayFlowCustomParams;
1167
+ 'adyen-apple-pay': ApplePayFlowCustomParams;
1137
1168
  'loop-crypto': LoopCryptoFlowCustomParams;
1138
1169
  paypal: PaypalFlowCustomParams;
1139
1170
  }[T];
@@ -1166,6 +1197,8 @@ export declare enum SubmitMethods {
1166
1197
  airwallexApplePay = 'airwallex-apple-pay',
1167
1198
  authorizenetGooglePay = 'authorizenet-google-pay',
1168
1199
  authorizenetApplePay = 'authorizenet-apple-pay',
1200
+ adyenGooglePay = 'adyen-google-pay',
1201
+ adyenApplePay = 'adyen-apple-pay',
1169
1202
  loopCrypto = 'loop-crypto',
1170
1203
  paypal = 'paypal',
1171
1204
  }
package/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { F as e, O as i, l as r, m as s } from "./index-CsHbuY7s.js";
1
+ import { F as e, O as i, l as r, m as s } from "./index-DfP3YYx1.js";
2
2
  import "penpal";
3
3
  import "uuid";
4
4
  export {