@paypay/mini-app-js-sdk 1.46.1 → 1.47.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.
@@ -85,8 +85,8 @@ function normalizeNativeResponseData(data2) {
85
85
  }
86
86
  class JsBridge {
87
87
  constructor(global2) {
88
- this.version = "1.46.1";
89
- this.revision = "81e237d";
88
+ this.version = "1.47.0";
89
+ this.revision = "24fba29";
90
90
  this.messageHandlers = new Map();
91
91
  this.responseCallbacks = new Map();
92
92
  this.global = global2;
@@ -431,9 +431,17 @@ var ChallengeMethod;
431
431
  (function(ChallengeMethod2) {
432
432
  ChallengeMethod2["S256"] = "S256";
433
433
  })(ChallengeMethod || (ChallengeMethod = {}));
434
- function isIP(str) {
434
+ function isLocalIP(hostName) {
435
+ if (hostName === "localhost")
436
+ return true;
437
+ if (!isIP(hostName))
438
+ return false;
439
+ const expression = /(^127\.)|(^192\.168\.)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)/;
440
+ return expression.test(hostName);
441
+ }
442
+ function isIP(hostName) {
435
443
  const expression = /((^\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\s*$)|(^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$))/;
436
- return expression.test(str);
444
+ return expression.test(hostName);
437
445
  }
438
446
  const secondaryList = [
439
447
  "ab.ca",
@@ -779,13 +787,14 @@ function getAccessToken() {
779
787
  return api.get(PpLocalStorageKey.accessToken);
780
788
  }
781
789
  function saveCookie(key2, value2, expires) {
790
+ var _a;
782
791
  removeCookie(key2);
783
792
  if (value2) {
784
793
  const domain = getDomain(key2 === PpLocalStorageKey.appDetail ? value2 : null);
785
794
  return api.set(key2, value2, {
786
795
  domain,
787
796
  expires,
788
- secure: true
797
+ secure: !isLocalIP((_a = window.location) == null ? void 0 : _a.hostname)
789
798
  });
790
799
  }
791
800
  }
@@ -1802,7 +1811,7 @@ const opaUrl = () => {
1802
1811
  const createHeaderMiniAppApi = (urlEndpoint, customHeaders) => {
1803
1812
  let headers = new Headers(__spreadValues({
1804
1813
  "Content-Type": "application/json",
1805
- "Client-Version": "1.46.1",
1814
+ "Client-Version": "1.47.0",
1806
1815
  "Client-OS-Type": getRuntime()
1807
1816
  }, customHeaders));
1808
1817
  if (urlEndpoint === "web-api/app/v2/payment/methods" || urlEndpoint === "web-api/app/v2/payment/consult" || urlEndpoint === "web-api/app/v1/payment/cashbackDetail" || urlEndpoint === "web-api/app/v1/confirmAgeForCashback" || urlEndpoint === "web-api/app/v1/internal/request" || urlEndpoint === "web-api/app/v1/addressbyzip" || urlEndpoint === "/web-api/app/platform/v1/balance" || urlEndpoint === "web-api/app/v1/users/autoTopupConfiguration" || urlEndpoint === "web-api/app/v1/users/preTransactionAutoTopupConfiguration") {
@@ -28488,13 +28497,13 @@ function _sfc_render$$(_ctx, _cache, $props, $setup, $data, $options) {
28488
28497
  const cssModules$R = {};
28489
28498
  cssModules$R["$style"] = style0$R;
28490
28499
  var CloseConfirmation = /* @__PURE__ */ _export_sfc(_sfc_main$$, [["render", _sfc_render$$], ["__cssModules", cssModules$R]]);
28491
- const paymentConsult = "_paymentConsult_kiiv1_2";
28492
- const headerImage = "_headerImage_kiiv1_12";
28493
- const content$6 = "_content_kiiv1_16";
28494
- const title$g = "_title_kiiv1_20";
28495
- const description$a = "_description_kiiv1_27";
28500
+ const paymentConsult = "_paymentConsult_6be9y_2";
28501
+ const headerImage = "_headerImage_6be9y_12";
28502
+ const content$6 = "_content_6be9y_16";
28503
+ const title$g = "_title_6be9y_20";
28504
+ const description$a = "_description_6be9y_27";
28496
28505
  var style0$Q = {
28497
- "ppmna-default-font": "_ppmna-default-font_kiiv1_1",
28506
+ "ppmna-default-font": "_ppmna-default-font_6be9y_1",
28498
28507
  paymentConsult,
28499
28508
  headerImage,
28500
28509
  content: content$6,
@@ -30406,7 +30415,7 @@ function _sfc_render$P(_ctx, _cache, $props, $setup, $data, $options) {
30406
30415
  const cssModules$F = {};
30407
30416
  cssModules$F["$style"] = style0$F;
30408
30417
  var ChoosePaymentMethod = /* @__PURE__ */ _export_sfc(_sfc_main$P, [["render", _sfc_render$P], ["__cssModules", cssModules$F]]);
30409
- function isAvailableTopupMethod(paymentMethod2) {
30418
+ function isActivatedMethod(paymentMethod2) {
30410
30419
  switch (paymentMethod2.paymentMethodType) {
30411
30420
  case PaymentMethodType.CREDIT_CARD: {
30412
30421
  const creditCard2 = paymentMethod2 == null ? void 0 : paymentMethod2.creditCardInfo;
@@ -30425,11 +30434,16 @@ function isAvailableTopupMethod(paymentMethod2) {
30425
30434
  const payLater2 = paymentMethod2.payLaterCcInfo;
30426
30435
  return (payLater2 == null ? void 0 : payLater2.paymentMethodStatus) === PaymentMethodStatus.ACTIVATED;
30427
30436
  }
30428
- case PaymentMethodType.WALLET:
30429
- case PaymentMethodType.PAY_LATER:
30437
+ default:
30430
30438
  return false;
30431
30439
  }
30432
30440
  }
30441
+ function isAvailableTopupMethod(paymentMethod2) {
30442
+ if (paymentMethod2.paymentMethodType === PaymentMethodType.WALLET || paymentMethod2.paymentMethodType === PaymentMethodType.PAY_LATER) {
30443
+ return false;
30444
+ }
30445
+ return isActivatedMethod(paymentMethod2);
30446
+ }
30433
30447
  function hasAvailableTopupMethod(paymentMethods) {
30434
30448
  return paymentMethods.some((paymentMethod2) => isAvailableTopupMethod(paymentMethod2));
30435
30449
  }
@@ -30444,25 +30458,15 @@ function findFirstValidMethod(paymentMethods) {
30444
30458
  } else
30445
30459
  return -1;
30446
30460
  }
30447
- function isValidPaymentMethod(savedMethod, paymentMethods) {
30448
- var _a, _b, _c, _d, _e;
30449
- if (savedMethod) {
30450
- const payMethod = paymentMethods.find((method2) => method2.paymentMethodId === savedMethod);
30451
- switch (payMethod == null ? void 0 : payMethod.paymentMethodType) {
30452
- case PaymentMethodType.CREDIT_CARD:
30453
- return ((_a = payMethod.creditCardInfo) == null ? void 0 : _a.paymentMethodStatus) === "ACTIVATED" && !((_b = payMethod.creditCardInfo) == null ? void 0 : _b.isExpired);
30454
- case PaymentMethodType.WALLET:
30455
- return true;
30456
- case PaymentMethodType.BANK:
30457
- case PaymentMethodType.YMONEY_BANK:
30458
- return ((_c = payMethod.bankInfo) == null ? void 0 : _c.paymentMethodStatus) === "ACTIVATED";
30459
- case PaymentMethodType.SBID_CARRIER_BILLING:
30460
- return ((_d = payMethod.sbidCarrierBillingInfo) == null ? void 0 : _d.paymentMethodStatus) === "ACTIVATED";
30461
- case PaymentMethodType.PAY_LATER_CC:
30462
- return ((_e = payMethod.payLaterCcInfo) == null ? void 0 : _e.paymentMethodStatus) === "ACTIVATED";
30463
- default:
30464
- return false;
30461
+ function isValidPaymentMethod(savedMethodId, paymentMethods) {
30462
+ if (savedMethodId) {
30463
+ const payMethod = paymentMethods.find((method2) => method2.paymentMethodId === savedMethodId);
30464
+ if (!payMethod)
30465
+ return false;
30466
+ if (payMethod.paymentMethodType === PaymentMethodType.WALLET) {
30467
+ return true;
30465
30468
  }
30469
+ return isActivatedMethod(payMethod);
30466
30470
  }
30467
30471
  return false;
30468
30472
  }
@@ -34926,7 +34930,7 @@ function debug(params) {
34926
34930
  function execute$5(params) {
34927
34931
  var _a;
34928
34932
  (_a = params == null ? void 0 : params.success) == null ? void 0 : _a.call(params, {
34929
- v: "1.46.1"
34933
+ v: "1.47.0"
34930
34934
  });
34931
34935
  }
34932
34936
  function useCallBack(props, ctx) {