@getopenpay/openpay-js 0.5.17 → 0.5.18

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,8 +1,8 @@
1
- import { d as z } from "./diag-api-BoyoSeID.js";
2
- import { b as G, c as I, d as W, e as X, p as _, i as V, f as K, g as Q, j as C, m as $, k as J, _ as T } from "./url-CWnDM543.js";
3
- import { s as Y, i as Z, I as q } from "./utils-BnYsKdhz.js";
4
- import { P as O, b as P, p as N, s as ee, g as te } from "./utils-CRswusUx.js";
5
- import { t as x, a as p, S as re } from "./index-DC5j54sB.js";
1
+ import { d as z } from "./diag-api-4fDcCqe-.js";
2
+ import { b as G, c as I, d as W, e as X, p as _, i as V, f as K, g as Q, j as C, m as $, k as J, _ as T } from "./url-Gcn3Oliy.js";
3
+ import { s as Y, i as Z, I as q } from "./utils-BKZjWoEw.js";
4
+ import { P as O, b as P, p as N, s as ee, g as te } from "./utils-BByPJY1j.js";
5
+ import { t as x, a as p, S as re } from "./index-CwJSDd4w.js";
6
6
  var y;
7
7
  (function(a) {
8
8
  a.COMPONENT = "component", a.HTTP_ERROR_NAME = "http.error_name", a.HTTP_STATUS_TEXT = "http.status_text";
@@ -1,8 +1,8 @@
1
- import { z as Ar, p as g, _ as X, s as Pr, l as Sr, j as Ir, q as vr, y as yr, dK as hr, h as gr, dL as mr, n as Cr, r as Nr, i as Mr, m as Ur, o as Br, t as br, u as Dr } from "./url-CWnDM543.js";
2
- import { i as G, s as Q, u as Xr } from "./suppress-tracing-3WarLq8k.js";
3
- import { d as c } from "./diag-api-BoyoSeID.js";
1
+ import { z as Ar, p as g, _ as X, s as Pr, l as Sr, j as Ir, q as vr, y as yr, dK as hr, h as gr, dL as mr, n as Cr, r as Nr, i as Mr, m as Ur, o as Br, t as br, u as Dr } from "./url-Gcn3Oliy.js";
2
+ import { i as G, s as Q, u as Xr } from "./suppress-tracing-ACkm1ZSM.js";
3
+ import { d as c } from "./diag-api-4fDcCqe-.js";
4
4
  import { h as q, E as Gr } from "./ExportResult-BacsqwKA.js";
5
- import { f as u, t as N, i as k, T as M, c as wr, b as Vr, a as K } from "./index-DC5j54sB.js";
5
+ import { f as u, t as N, i as k, T as M, c as wr, b as Vr, a as K } from "./index-CwJSDd4w.js";
6
6
  import { a as jr, bm as Hr } from "./sdk-info-ChuKu8zW.js";
7
7
  var l;
8
8
  (function(r) {
@@ -1,7 +1,7 @@
1
- import { R as u } from "./index-DC5j54sB.js";
2
- import { B as c } from "./SimpleSpanProcessor-iCWR2wrc.js";
3
- import { A as g, b as x, a as S, C as b, F as w, N as C, P, R as T, d as O, S as A, e as M, c as R, T as N } from "./SimpleSpanProcessor-iCWR2wrc.js";
4
- import { P as E, a as F, b as j, g as k, h as W, p as I, s as D, c as G } from "./utils-CRswusUx.js";
1
+ import { R as u } from "./index-CwJSDd4w.js";
2
+ import { B as c } from "./SimpleSpanProcessor-B_aR4wyQ.js";
3
+ import { A as g, b as x, a as S, C as b, F as w, N as C, P, R as T, d as O, S as A, e as M, c as R, T as N } from "./SimpleSpanProcessor-B_aR4wyQ.js";
4
+ import { P as E, a as F, b as j, g as k, h as W, p as I, s as D, c as G } from "./utils-BByPJY1j.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 { d as diag } from "./diag-api-BoyoSeID.js";
1
+ import { d as diag } from "./diag-api-4fDcCqe-.js";
2
2
  import { E as ExportResultCode, h as hexToBinary } from "./ExportResult-BacsqwKA.js";
3
3
  import { c as commonjsGlobal } from "./_commonjsHelpers-CdLE1o9f.js";
4
4
  var OTLPExporterBase = (
@@ -1,4 +1,4 @@
1
- import { R as qe } from "./index-DC5j54sB.js";
1
+ import { R as qe } from "./index-CwJSDd4w.js";
2
2
  function xt(j) {
3
3
  return j === void 0 && (j = {}), typeof j.addEventListener == "function" && typeof j.removeEventListener == "function";
4
4
  }
@@ -1,5 +1,5 @@
1
- import { c as M, t as p, i as P, T as o, b as D, d as b } from "./index-DC5j54sB.js";
2
- import { i as A } from "./suppress-tracing-3WarLq8k.js";
1
+ import { c as M, t as p, i as P, T as o, b as D, d as b } from "./index-CwJSDd4w.js";
2
+ import { i as A } from "./suppress-tracing-ACkm1ZSM.js";
3
3
  var l = M("OpenTelemetry Context Key B3 Debug Flag"), f = "b3", v = "x-b3-traceid", g = "x-b3-spanid", c = "x-b3-sampled", B = "x-b3-parentspanid", S = "x-b3-flags", F = /* @__PURE__ */ new Set([!0, "true", "True", "1", 1]), N = /* @__PURE__ */ new Set([!1, "false", "False", "0", 0]);
4
4
  function V(r) {
5
5
  return r === o.SAMPLED || r === o.NONE;
package/dist/index.d.ts CHANGED
@@ -265,6 +265,41 @@ declare type CustomInitParams = {
265
265
  onAuthenticationElementReady?: () => void;
266
266
  };
267
267
 
268
+ // For stripe klarna
269
+ stripeKlarna?: {
270
+ /**
271
+ * Additional payment data to be passed to stripe.confirmKlarnaPayment
272
+ * This will be merged with the billing details from the form
273
+ */
274
+ paymentData?: {
275
+ payment_method?: {
276
+ billing_details?: {
277
+ email?: string;
278
+ name?: string;
279
+ phone?: string;
280
+ address?: {
281
+ line1?: string;
282
+ line2?: string;
283
+ city?: string;
284
+ state?: string;
285
+ country?: string;
286
+ postal_code?: string;
287
+ };
288
+ };
289
+ };
290
+ return_url?: string;
291
+ setup_future_usage?: 'off_session' | 'on_session';
292
+ save_payment_method?: boolean;
293
+ };
294
+
295
+ /**
296
+ * Options to be passed to stripe.confirmKlarnaPayment
297
+ */
298
+ options?: {
299
+ handleActions?: boolean;
300
+ };
301
+ };
302
+
268
303
  googlePay?: {
269
304
  env: 'demo' | 'prod';
270
305
  doNotMountOnInit?: boolean;
@@ -509,6 +544,11 @@ declare type InitOjsFlowResult = {
509
544
  isAvailable: boolean;
510
545
  };
511
546
 
547
+ declare type InitStripeKlarnaFlowResult = {
548
+ isAvailable: boolean;
549
+ startFlow: (customParams?: KlarnaFlowCustomParams) => Promise<void>;
550
+ };
551
+
512
552
  declare type InitStripeLinkFlowResult =
513
553
  | {
514
554
  isAvailable: true;
@@ -538,6 +578,20 @@ declare type InitStripePrFlowSuccess = {
538
578
  startFlow: (provider: PaymentRequestProvider, params?: PaymentRequestStartParams) => Promise<void>;
539
579
  };
540
580
 
581
+ declare type KlarnaFlowCustomParams = {
582
+ /**
583
+ * In case of multiple processors available for Klarna, the processor setting will
584
+ * determine which processor to use.
585
+ * If `processor` is not set or is not available, the first available processor will be used
586
+ *
587
+ * **Note**: this processor choice is for the whole process of showing payment UI, verification and charging.
588
+ * It won't perform fallback processor charging when payment failed.
589
+ */
590
+ processor?: PaymentProcessor;
591
+ isAnonymous?: boolean;
592
+ useRedirectFlow?: boolean;
593
+ };
594
+
541
595
  declare const LoadedEventPayload = z.object({
542
596
  type: z.literal(EventType.enum.LOADED),
543
597
  sessionId: RequiredString,
@@ -778,6 +832,10 @@ declare const OjsFlows = {
778
832
  init: initStripeLinkFlow,
779
833
  run: runStripeLinkFlow,
780
834
  },
835
+ stripeKlarna: {
836
+ init: initStripeKlarnaFlow,
837
+ run: runStripeKlarnaFlow,
838
+ },
781
839
 
782
840
  // Pockyt
783
841
  pockytPaypal: {
@@ -791,6 +849,12 @@ declare const OjsFlows = {
791
849
  run: runPaypalFlow,
792
850
  },
793
851
 
852
+ // Klarna
853
+ airwallexKlarna: {
854
+ init: initAirwallexKlarnaFlow,
855
+ run: runAirwallexKlarnaFlow,
856
+ },
857
+
794
858
  // Airwallex
795
859
  airwallexGooglePay: {
796
860
  init: initAirwallexGooglePayFlow,
@@ -898,6 +962,10 @@ export declare class OpenPayForm {
898
962
  publisher: LoadedOncePublisher<InitStripeLinkFlowResult>;
899
963
  initialize: (initParams: InitOjsFlowParams) => Promise<void>;
900
964
  };
965
+ readonly stripeKlarna: {
966
+ publisher: LoadedOncePublisher<InitStripeKlarnaFlowResult>;
967
+ initialize: (initParams: InitOjsFlowParams) => Promise<void>;
968
+ };
901
969
  readonly airwallexGooglePay: {
902
970
  publisher: LoadedOncePublisher<InitGooglePayFlowResult>;
903
971
  initialize: (initParams: InitOjsFlowParams) => Promise<void>;
@@ -918,6 +986,14 @@ export declare class OpenPayForm {
918
986
  }>;
919
987
  initialize: (initParams: InitOjsFlowParams) => Promise<void>;
920
988
  };
989
+ readonly airwallexKlarna: {
990
+ publisher: LoadedOncePublisher<{
991
+ isLoading: boolean;
992
+ isAvailable: boolean;
993
+ startFlow: (customParams?: KlarnaFlowCustomParams) => Promise<void>;
994
+ }>;
995
+ initialize: (initParams: InitOjsFlowParams) => Promise<void>;
996
+ };
921
997
  readonly pockytPaypal: {
922
998
  publisher: LoadedOncePublisher<{
923
999
  isLoading: boolean;
@@ -1148,6 +1224,7 @@ declare type ProcessorSpecificSubmitSettings<T extends SubmitMethod = SubmitMeth
1148
1224
  [SubmitMethods.googlePay]: GooglePayFlowCustomParams;
1149
1225
  [SubmitMethods.loopCrypto]: LoopCryptoFlowCustomParams;
1150
1226
  [SubmitMethods.paypal]: PaypalFlowCustomParams;
1227
+ [SubmitMethods.klarna]: KlarnaFlowCustomParams;
1151
1228
  [SubmitMethods.stripeLink]: unknown;
1152
1229
  // TODO: The following methods are deprecated and will be removed in the future.
1153
1230
  // Use googlePay/applePay instead
@@ -1194,6 +1271,7 @@ export declare enum SubmitMethods {
1194
1271
  googlePay = 'google-pay',
1195
1272
  loopCrypto = 'loop-crypto',
1196
1273
  paypal = 'paypal',
1274
+ klarna = 'klarna',
1197
1275
  /**
1198
1276
  * This submit method only for Available payment methods.
1199
1277
  * Manual submission for StripeLink is not available
package/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { E as p, F as r, O as i, l as s } from "./index-DC5j54sB.js";
1
+ import { E as p, F as r, O as i, l as s } from "./index-CwJSDd4w.js";
2
2
  import "penpal";
3
3
  import "uuid";
4
4
  import "zod";