@paypay/mini-app-js-sdk 2.64.2 → 2.69.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/client/supportedFunctionsList.d.ts +2 -2
- package/dist/composition-api/useKycPassport.d.ts +1 -2
- package/dist/constants/permissionName.d.ts +1 -1
- package/dist/constants/sdkFunctionNames.d.ts +1 -1
- package/dist/core/clientState.d.ts +1 -0
- package/dist/core/coreFunctions/logEvent.d.ts +1 -1
- package/dist/core/sentry.d.ts +8 -1
- package/dist/core/vueErrorHandler.d.ts +6 -0
- package/dist/mini-app-api.d.ts +3 -2
- package/dist/mini-app-js-sdk.browser.js +1 -1
- package/dist/mini-app-js-sdk.es.js +49 -34
- package/dist/model/bridge/openAuthSession.d.ts +2 -0
- package/dist/resources/locales/payment/index.d.ts +10 -0
- package/dist/resources/locales/payment/ja.d.ts +5 -0
- package/dist/resources/locales/topup/index.d.ts +8 -0
- package/dist/resources/locales/topup/ja.d.ts +4 -0
- package/dist/types/getKycInformation.d.ts +1 -0
- package/dist/types/makePayment.d.ts +4 -0
- package/dist/types/openAuthSession.d.ts +4 -0
- package/dist/types.d.ts +1 -5
- package/dist/utils/analytics.d.ts +2 -2
- package/dist/utils/api.d.ts +4 -0
- package/dist/utils/helper.d.ts +2 -2
- package/dist/utils/minimumAppVersion.d.ts +1 -0
- package/dist/utils/windowBridge.d.ts +6 -5
- package/dist/views/make-payment/store.d.ts +158 -0
- package/dist/views/make-payment/utils/paymentMethod.d.ts +1 -0
- package/package.json +2 -1
- package/dist/model/bridge/getCashbackInformation.d.ts +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const miniAppSupportedFunctions: readonly ["init", "openWebview", "openMap", "closeApp", "makePayment", "topup", "setSessionData", "getSessionData", "setStorageData", "getStorageData", "removeStorageData", "getPermissionStatus", "scanCode", "showAlert", "showErrorSheet", "getTopBarHeight", "setTitle", "showUpdateWarning", "getPlatformInformation", "openApp", "share", "getKycInformation", "getUserLocation", "checkPaymentMethod", "registerKyc", "startMultiFactorAuth", "verifyMultiFactorAuthResult", "getBankInfo", "logout", "getUserProfile", "getBalance", "getUserAddress", "getUAID", "copyToClipboard", "registerUserInfo", "setEnablePullDownRefresh", "registerEmail", "inputAddress", "getDeviceInformation", "request", "requestInternal", "registerPaymentFeatures", "initKycPassport", "getKycPassportInfo", "shortcutExists", "addShortcut", "getAllUserAddresses", "getUserPaymentFeatureSettings", "getPaymentSettings", "getTransactionInfo", "getTransactions", "getPayPayCardInfo", "getExternalLinkageInformation", "markAsReady", "renderCoupons"];
|
|
2
|
-
export declare const smartPaymentSupportedFunctions: readonly ["init", "createOrder", "makePayment", "render", "logout", "getAuthStatus", "getUserProfile", "getBalance", "getUserAddress", "getUAID", "
|
|
1
|
+
export declare const miniAppSupportedFunctions: readonly ["init", "openWebview", "openAuthSession", "openMap", "closeApp", "makePayment", "topup", "setSessionData", "getSessionData", "setStorageData", "getStorageData", "removeStorageData", "getPermissionStatus", "scanCode", "showAlert", "showErrorSheet", "getTopBarHeight", "setTitle", "showUpdateWarning", "getPlatformInformation", "openApp", "share", "getKycInformation", "getUserLocation", "checkPaymentMethod", "registerKyc", "startMultiFactorAuth", "verifyMultiFactorAuthResult", "getBankInfo", "logout", "getUserProfile", "getBalance", "getUserAddress", "getUAID", "copyToClipboard", "registerUserInfo", "setEnablePullDownRefresh", "registerEmail", "inputAddress", "getDeviceInformation", "request", "requestInternal", "registerPaymentFeatures", "initKycPassport", "getKycPassportInfo", "shortcutExists", "addShortcut", "getAllUserAddresses", "getUserPaymentFeatureSettings", "getPaymentSettings", "getTransactionInfo", "getTransactions", "getPayPayCardInfo", "getExternalLinkageInformation", "markAsReady", "renderCoupons"];
|
|
2
|
+
export declare const smartPaymentSupportedFunctions: readonly ["init", "createOrder", "makePayment", "render", "logout", "getAuthStatus", "getUserProfile", "getBalance", "getUserAddress", "getUAID", "renderCoupons", "getLoginUrl", "renderButton"];
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { InitKycPassportParams } from '../types/initKycPassport';
|
|
2
|
-
|
|
3
|
-
declare const initKycPassportError: (params: InitKycPassportParams, errorCode: ErrorCodesType, helpUrl?: string | undefined) => void;
|
|
2
|
+
declare const initKycPassportError: (params: InitKycPassportParams, errorCode: string, helpUrl?: string | undefined) => void;
|
|
4
3
|
export { initKycPassportError };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const mini_app_payment_balance = "mini_app_payment_balance", mini_app_device_info = "mini_app_device_info", mini_app_user_contacts = "mini_app_user_contacts", mini_app_device_battery = "mini_app_device_battery", mini_app_kyc = "mini_app_kyc", mini_app_user_location = "mini_app_user_location", mini_app_check_payment_method = "mini_app_check_payment_method", cashback = "cashback", bank_registration = "bank_registration", mini_app_user_email_address = "mini_app_user_email_address", mini_app_user_address = "mini_app_user_address", mini_app_user_phone_camera = "mini_app_user_phone_camera", mini_app_user_phone_album = "mini_app_user_phone_album", mini_app_bank_information = "mini_app_bank_information",
|
|
1
|
+
export declare const mini_app_payment_balance = "mini_app_payment_balance", mini_app_device_info = "mini_app_device_info", mini_app_user_contacts = "mini_app_user_contacts", mini_app_device_battery = "mini_app_device_battery", mini_app_kyc = "mini_app_kyc", mini_app_user_location = "mini_app_user_location", mini_app_check_payment_method = "mini_app_check_payment_method", cashback = "cashback", bank_registration = "bank_registration", mini_app_user_email_address = "mini_app_user_email_address", mini_app_user_address = "mini_app_user_address", mini_app_user_phone_camera = "mini_app_user_phone_camera", mini_app_user_phone_album = "mini_app_user_phone_album", mini_app_bank_information = "mini_app_bank_information", mini_app_user_phone_number = "mini_app_user_phone_number", mini_app_user_name = "mini_app_user_name", mini_app_user_nickname = "mini_app_user_nickname", mini_app_user_avatar = "mini_app_user_avatar", mini_app_user_signup_date = "mini_app_user_signup_date", mini_app_user_employer_info = "mini_app_user_employer_info", mini_app_user_gender = "mini_app_user_gender", direct_debit = "direct_debit", continuous_payments = "continuous_payments", pending_payments = "pending_payments", preauth_capture_native = "preauth_capture_native", mini_app_point_usage_setting = "mini_app_point_usage_setting", mini_app_user_payment_limit = "mini_app_user_payment_limit", mini_app_user_p2p_limit = "mini_app_user_p2p_limit", mini_app_user_topup_limit = "mini_app_user_topup_limit", merchant_topup = "merchant_topup", mini_app_notification_center = "mini_app_notification_center", push_notification = "push_notification", notification_center_tl = "notification_center_tl", user_info_softbank_user = "user_info_softbank_user", user_info_yahoo_mobile_user = "user_info_yahoo_mobile_user", user_info_yahoo_premium_user = "user_info_yahoo_premium_user", user_info_tpoint = "user_info_tpoint", mini_app_transaction = "mini_app_transaction", mini_app_device_esim_info = "mini_app_device_esim_info";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const init = "init", getBankInfo = "getBankInfo", showAlert = "showAlert", render = "render", renderButton = "renderButton", makePayment = "makePayment", getUAID = "getUAID", logout = "logout", startMultiFactorAuth = "startMultiFactorAuth", verifyMultiFactorAuthResult = "verifyMultiFactorAuthResult", getPermissionStatus = "getPermissionStatus", registerKyc = "registerKyc", getKycInformation = "getKycInformation", getUserAddress = "getUserAddress", getUserLocation = "getUserLocation", getUserProfile = "getUserProfile", registerEmail = "registerEmail", showUpdateWarning = "showUpdateWarning", showErrorSheet = "showErrorSheet", getPlatformInformation = "getPlatformInformation", share = "share", getTopBarHeight = "getTopBarHeight", openWebview = "openWebview", openMap = "openMap", closeApp = "closeApp", openApp = "openApp", checkPaymentMethod = "checkPaymentMethod", getBalance = "getBalance", topup = "topup", registerPaymentFeatures = "registerPaymentFeatures", registerUserInfo = "registerUserInfo", requestInternal = "requestInternal", scanCode = "scanCode", getAuthStatus = "getAuthStatus", inputAddress = "inputAddress",
|
|
1
|
+
export declare const init = "init", getBankInfo = "getBankInfo", showAlert = "showAlert", render = "render", renderButton = "renderButton", makePayment = "makePayment", getUAID = "getUAID", logout = "logout", startMultiFactorAuth = "startMultiFactorAuth", verifyMultiFactorAuthResult = "verifyMultiFactorAuthResult", getPermissionStatus = "getPermissionStatus", registerKyc = "registerKyc", getKycInformation = "getKycInformation", getUserAddress = "getUserAddress", getUserLocation = "getUserLocation", getUserProfile = "getUserProfile", registerEmail = "registerEmail", showUpdateWarning = "showUpdateWarning", showErrorSheet = "showErrorSheet", getPlatformInformation = "getPlatformInformation", share = "share", getTopBarHeight = "getTopBarHeight", openWebview = "openWebview", openAuthSession = "openAuthSession", openMap = "openMap", closeApp = "closeApp", openApp = "openApp", checkPaymentMethod = "checkPaymentMethod", getBalance = "getBalance", topup = "topup", registerPaymentFeatures = "registerPaymentFeatures", registerUserInfo = "registerUserInfo", requestInternal = "requestInternal", scanCode = "scanCode", getAuthStatus = "getAuthStatus", inputAddress = "inputAddress", request = "request", getDeviceInformation = "getDeviceInformation", createOrder = "createOrder", handleMessageFromNative = "handleMessageFromNative", initKycPassport = "initKycPassport", smsAuth = "smsAuth", getKycPassportInfo = "getKycPassportInfo";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ClientMessageData, SdkType } from '../types';
|
|
2
|
+
export declare function isValidClientId(clientId: unknown): boolean;
|
|
2
3
|
export declare function getCurrentClientId(): string;
|
|
3
4
|
export declare function getCurrentClientOrigin(): string;
|
|
4
5
|
export declare function getCurrentClientSdkType(): SdkType | undefined;
|
package/dist/core/sentry.d.ts
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { ErrorCodesType } from '../constants';
|
|
2
2
|
import * as Sentry from '@sentry/browser';
|
|
3
|
+
export declare type FrontendExceptionContext = {
|
|
4
|
+
source: string;
|
|
5
|
+
functionName?: string;
|
|
6
|
+
message?: string;
|
|
7
|
+
errorCode?: ErrorCodesType;
|
|
8
|
+
};
|
|
3
9
|
export declare function initSentry(): void;
|
|
4
|
-
export declare function
|
|
10
|
+
export declare function captureFrontendException(error: unknown, context: FrontendExceptionContext): void;
|
|
11
|
+
export declare function sendWindowBridgeErrorToSentry(functionName: string, message: string, errorCode: ErrorCodesType, originalError?: unknown): void;
|
|
5
12
|
export declare function addBreadcrumbToSentry(breadcrumb: Sentry.Breadcrumb): void;
|
|
6
13
|
export declare function setClientIdForSentry(clientId: string): void;
|
package/dist/mini-app-api.d.ts
CHANGED
|
@@ -15,13 +15,14 @@ import { InitKycPassportParams } from './types/initKycPassport';
|
|
|
15
15
|
import { LogoutResult } from './types/logout';
|
|
16
16
|
import { MakePaymentParams } from './types/makePayment';
|
|
17
17
|
import { OpenWebviewParams } from './types/openWebview';
|
|
18
|
+
import { OpenAuthSessionParams } from './types/openAuthSession';
|
|
18
19
|
import { RegisterKycParams } from './types/registerKycParams';
|
|
19
20
|
import { ShowUpdateWarningParams } from './types/showUpdateWarning';
|
|
20
21
|
import { StartMultiFactorAuthParams } from './types/startMultiFactorAuth';
|
|
21
22
|
import { TopupParams } from './types/topup';
|
|
22
23
|
import { VerifyMultiFactorAuthResultParams } from './types/verifyMultiFactorAuthResult';
|
|
23
24
|
import { JsBridge, NativeParams } from './jsbridge-core/jsbridge';
|
|
24
|
-
import { AddShortcutParams, CloseAppParams,
|
|
25
|
+
import { AddShortcutParams, CloseAppParams, MapParams, MiniAppResult, OpenAppParams, RegisterPaymentFeaturesParams, RegisterUserInfoParams, RequestInternalParams, RequestParams, ScanCodeParams, SetEnablePullDownRefreshParams, ShareParams, ShortcutExistsParams, ShowAlertParams, ShowErrorSheetParams, SmsAuthParams } from './types';
|
|
25
26
|
export declare class MiniAppModule {
|
|
26
27
|
private readonly jsBridge;
|
|
27
28
|
private isExecuting;
|
|
@@ -29,8 +30,8 @@ export declare class MiniAppModule {
|
|
|
29
30
|
private isExecutableService;
|
|
30
31
|
private handleModuleLoadingFailure;
|
|
31
32
|
init(params: InitParams): void;
|
|
32
|
-
getCashbackInformation(params: GetCashbackInfoParams): void;
|
|
33
33
|
openWebview(params: OpenWebviewParams): void;
|
|
34
|
+
openAuthSession(params: OpenAuthSessionParams): void;
|
|
34
35
|
openMap(params: MapParams): void;
|
|
35
36
|
closeApp(params: CloseAppParams): void;
|
|
36
37
|
request(params: RequestParams): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
!function(){"use strict";try{if("undefined"!=typeof document){var p=document.createElement("style");p.appendChild(document.createTextNode('.ppmna-reset-css{all:initial}.ppmna-reset-css *{text-align:unset;color:unset;background:initial;background-color:transparent;margin:revert;padding:revert;font-weight:revert;font-style:unset;font-size:unset;-webkit-user-select:none;user-select:none;border:unset;border-radius:revert;vertical-align:unset;word-break:unset;outline:none;box-sizing:content-box}.ppmna-reset-css * img{display:inline-block}.ppmna-reset-css * input,.ppmna-reset-css * select{-webkit-user-select:auto;user-select:auto}.ppmna-reset-css * li{list-style:none}.ppmna-reset-css * :where(*:not(svg,svg *)){all:revert}@font-face{font-family:Graphik;font-weight:400;font-display:swap;src:url(https://static.paypay.ne.jp/font/Graphik-Regular-Web.woff2) format("woff2"),url(https://static.paypay.ne.jp/font/Graphik-Regular-Web.woff) format("woff")}@font-face{font-family:Graphik;font-weight:600;font-display:swap;src:url(https://static.paypay.ne.jp/font/Graphik-Semibold-Web.woff2) format("woff2"),url(https://static.paypay.ne.jp/font/Graphik-Semibold-Web.woff) format("woff")}.pp-smartButtonWrapper .pp-smartBtn{display:flex;align-items:center;border-radius:8px;border:none;font-size:14px;font-weight:600;line-height:22px;color:#fff;padding:0;width:100%;height:44px;margin:auto;-webkit-tap-highlight-color:transparent;text-decoration:none;box-sizing:border-box}.pp-smartButtonWrapper .pp-smartBtn.pp-sm .pp-leftSection .pp-btnContent{flex-direction:column}.pp-smartButtonWrapper .pp-smartBtn.pp-light{background:#fff;color:#242323}.pp-smartButtonWrapper .pp-smartBtn.pp-dark{background:#000}.pp-smartButtonWrapper .pp-smartBtn.pp-red{background:#f03}.pp-smartButtonWrapper .pp-smartBtn.pp-login{min-width:180px}.pp-smartButtonWrapper .pp-smartBtn.pp-login.pp-sm{width:180px!important}.pp-smartButtonWrapper .pp-smartBtn.pp-login.pp-light{border:1px solid #e4e4e8}.pp-smartButtonWrapper .pp-smartBtn.pp-login.pp-light .pp-userProfile{margin-right:4px}.pp-smartButtonWrapper .pp-smartBtn.pp-login .pp-leftSection .pp-btnContent{display:grid}.pp-smartButtonWrapper .pp-smartBtn.pp-pay{min-width:160px}.pp-smartButtonWrapper .pp-smartBtn.pp-pay.pp-light{border:1px solid #dddddd}.pp-smartButtonWrapper .pp-smartBtn.pp-pay.pp-light .pp-cashbackInfo{color:#ff954c;background:#fff0e5}.pp-smartButtonWrapper .pp-smartBtn.pp-pay.pp-red .pp-cashbackInfo{color:#f03}.pp-smartButtonWrapper .pp-smartBtn.pp-pay.pp-ja .pp-cashbackInfo{padding:2px 16px}.pp-smartButtonWrapper .pp-smartBtn.pp-pay.pp-sm{width:160px!important}.pp-smartButtonWrapper .pp-smartBtn.pp-pay.pp-sm.pp-cashback{height:66px;flex-direction:column;justify-content:center}.pp-smartButtonWrapper .pp-smartBtn.pp-pay.pp-sm .pp-cashbackInfo{margin:8px 0 0}.pp-smartButtonWrapper .pp-smartBtn.pp-pay .pp-leftSection .pp-img{width:24px;height:24px}.pp-smartButtonWrapper .pp-smartBtn.pp-pay.pp-shortText{font-size:16px}.pp-smartButtonWrapper .pp-smartBtn.pp-pay.pp-sm .pp-smartButtonWrapper .pp-smartBtn.pp-pay.pp-cashback .pp-leftSection .pp-btnContent,.pp-smartButtonWrapper .pp-smartBtn.pp-pay.pp-shortText .pp-leftSection .pp-btnContent{margin-left:4px}.pp-smartButtonWrapper .pp-smartBtn .pp-leftSection{display:flex;justify-content:center;align-items:center;width:100%;box-sizing:border-box;padding:0 8px}.pp-smartButtonWrapper .pp-smartBtn .pp-leftSection .pp-img{width:20px;height:20px;display:inline-block}.pp-smartButtonWrapper .pp-smartBtn .pp-leftSection .pp-btnContent{margin-left:8px}.pp-smartButtonWrapper .pp-smartBtn .pp-leftSection .pp-btnContent .pp-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pp-smartButtonWrapper .pp-smartBtn .pp-cashbackInfo{font-size:12px;color:#242323;background:#fff;line-height:14px;padding:2px 8px;border-radius:9px;margin-left:8px}.pp-smartButtonWrapper .pp-smartBtn .pp-userProfile{width:34px;height:34px;border-radius:50%;margin-right:5px}.pp-smartButtonWrapper.pp-button{padding:0;margin:0;background:none;border:none;width:100%;border-radius:8px;-webkit-tap-highlight-color:transparent;font-family:revert!important}.pp-smartButtonWrapper.pp-button *{font-family:revert!important}')),document.head.appendChild(p)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();
|
|
2
|
-
var pp=function(){"use strict";var e=Object.defineProperty,t=Object.defineProperties,n=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,a=(t,n,o)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o,i=(e,t)=>{for(var n in t||(t={}))r.call(t,n)&&a(e,n,t[n]);if(o)for(var n of o(t))s.call(t,n)&&a(e,n,t[n]);return e},l=(e,o)=>t(e,n(o)),c=(e,t,n)=>new Promise(((o,r)=>{var s=e=>{try{i(n.next(e))}catch(t){r(t)}},a=e=>{try{i(n.throw(e))}catch(t){r(t)}},i=e=>e.done?o(e.value):Promise.resolve(e.value).then(s,a);i((n=n.apply(e,t)).next())}));function d(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)e[o]=n[o]}return e}var u=function e(t,n){function o(e,o,r){if("undefined"!=typeof document){"number"==typeof(r=d({},n,r)).expires&&(r.expires=new Date(Date.now()+864e5*r.expires)),r.expires&&(r.expires=r.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var a in r)r[a]&&(s+="; "+a,!0!==r[a]&&(s+="="+r[a].split(";")[0]));return document.cookie=e+"="+t.write(o,e)+s}}return Object.create({set:o,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],o={},r=0;r<n.length;r++){var s=n[r].split("="),a=s.slice(1).join("=");try{var i=decodeURIComponent(s[0]);if(o[i]=t.read(a,i),e===i)break}catch(l){}}return e?o[e]:o}},remove:function(e,t){o(e,"",d({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,d({},this.attributes,t))},withConverter:function(t){return e(d({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});const g="_PayPayJsBridge",f=["init","openWebview","openMap","closeApp","makePayment","topup","setSessionData","getSessionData","setStorageData","getStorageData","removeStorageData","getPermissionStatus","scanCode","showAlert","showErrorSheet","getTopBarHeight","setTitle","showUpdateWarning","getPlatformInformation","openApp","share","getKycInformation","getUserLocation","checkPaymentMethod","registerKyc","startMultiFactorAuth","verifyMultiFactorAuthResult","getBankInfo","logout","getUserProfile","getBalance","getUserAddress","getUAID","copyToClipboard","registerUserInfo","setEnablePullDownRefresh","registerEmail","inputAddress","getDeviceInformation","request","requestInternal","registerPaymentFeatures","initKycPassport","getKycPassportInfo","shortcutExists","addShortcut","getAllUserAddresses","getUserPaymentFeatureSettings","getPaymentSettings","getTransactionInfo","getTransactions","getPayPayCardInfo","getExternalLinkageInformation","markAsReady","renderCoupons"],m=["init","createOrder","makePayment","render","logout","getAuthStatus","getUserProfile","getBalance","getUserAddress","getUAID","getCashbackInformation","renderCoupons","getLoginUrl","renderButton"],p="2.64.2",v=new URL("https://mini-app-sdk-core.paypay.ne.jp/"),h=v.origin,y=new URL(`./iframe.html?v=${p}&rev=b21dd99`,v).href,w=new URL(`./coupon/iframe.html?v=${p}`,v).href;new URL(`./button/iframe.html?v=${p}`,v).href;const b="BAD_REQUEST_INSUFFICIENT_PARAMETER",S="UNKNOWN",E="SDK_NOT_INITIALIZED",I="TOKEN_NOT_FOUND",k="TOKEN_EXPIRED",C="AUTHORIZATION_NEEDED",P="ppjssdk.refreshToken";class O extends Error{constructor(e,t){super(e),this.errorCode=t}}const _=Object.freeze(Object.defineProperty({__proto__:null,getCookie:function({name:e}){return u.get(e)},getLocalStorage:function({name:e}){return localStorage.getItem(e)},getSessionStorage:function({name:e}){return sessionStorage.getItem(e)},getUrl:function(){return window.location.href},insertIframe:function(e){var{containerSelector:t,attributes:n}=e,a=n,{styles:i}=a,l=((e,t)=>{var n={};for(var a in e)r.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&o)for(var a of o(e))t.indexOf(a)<0&&s.call(e,a)&&(n[a]=e[a]);return n})(a,["styles"]);return new Promise(((e,n)=>{const o=document.querySelector(t);if(!o)return void n(new O(`Container with selector "${t}" not found.`,b));const r=document.createElement("iframe");r.onload=()=>{e(!0)},r.onerror=()=>{n(new O("Failed to load iframe.","NOT_REACHABLE"))},Object.assign(r.style,i),Object.entries(l).forEach((([e,t])=>{r.setAttribute(e,t)})),o.innerHTML="",o.appendChild(r)}))},removeCookie:function({name:e,options:t}){return u.remove(e,t)},removeElement:function({selector:e}){const t=document.querySelector(e);return!!t&&(t.remove(),!0)},removeLocalStorage:function({name:e}){return localStorage.removeItem(e)},removeQueryParametersFromUrl:function(e){const t=new URL(window.location.href);e.forEach((e=>t.searchParams.delete(e)));const n=t.toString().replace(t.origin,"");history.replaceState(history.state,"",n)},removeSessionStorage:function({name:e}){return sessionStorage.removeItem(e)},setCookie:function({name:e,value:t,options:n}){return u.set(e,t,n)},setLocalStorage:function({name:e,value:t}){return localStorage.setItem(e,t)},setSessionStorage:function({name:e,value:t}){return sessionStorage.setItem(e,t)},updateElementStyle:function({selector:e,styles:t}){const n=document.querySelector(e);return!!n&&(Object.assign(n.style,t),!0)}},Symbol.toStringTag,{value:"Module"})),A="success",R="fail",T="complete";var L=(e=>(e.MiniApp="MiniApp",e.SmartPayment="SmartPayment",e))(L||{});function N(e=6){const t=new Uint8Array(e);return crypto.getRandomValues(t),Array.from(t,(e=>(e%36).toString(36))).join("")}const U=e=>"object"!=typeof e||null===e?e:JSON.parse(JSON.stringify(e)),D=e=>{var t;const n=null==(t=e[0])?void 0:t.callbacks;return"object"==typeof n&&null!==n},x=e=>Object.keys(e).reduce(((e,t)=>(e[t]=!0,e)),{});class M{constructor(e,t,n=[],o){this.deferredPromises={},this.functions=e,this.allowedOrigins=t,this.middlewares=n,this.registeredCallbacks={},this.messageEventHandler=this.messageEventHandler.bind(this),this.errorLogger=o,this.subscribeToMessageEvent()}subscribeToMessageEvent(){window.addEventListener("message",this.messageEventHandler)}unsubscribeToMessageEvent(){window.removeEventListener("message",this.messageEventHandler)}messageEventHandler(e){var t;if(null==(t=e.data)?void 0:t.forWindowBridge)return this.allowedOrigins&&"request"===e.data.type&&!this.allowedOrigins.includes(e.origin)?this.sendErrorResponse(e,`${e.origin} is not allowed to make requests`,"ORIGIN_NOT_ALLOWED"):void("request"===e.data.type?this.handleRequest(e):"response"===e.data.type?this.handleResponse(e):"callback"===e.data.type&&this.handleCallback(e))}handleRequest(e){return c(this,null,(function*(){var t;const n=e.data.functionName,o=this.functions[n];o||this.sendErrorResponse(e,`Function '${n}' does not exists on the target window`,"FUNCTION_NOT_FOUND");const r=U(e.data.params);D(r)&&(r[0].callbacks=Object.keys(r[0].callbacks).reduce(((t,n)=>(t[n]=(...t)=>{this.invokeCallback(e,n,t)},t)),{}));try{this.sendSuccessResponse(e,yield function(e,t,n,o){let r=-1;const s=o=>c(this,null,(function*(){if(++r,r<e.length){const n=e[r];return yield n(t,o,s)}return n(...o)}));return s(o)}([...this.middlewares,...null!=(t=o.middlewares)?t:[]],e,o,r))}catch(s){let t="Some error occurred while processing the request",n=S;s instanceof O?(t=s.message,n=s.errorCode):console.error(s),this.sendErrorResponse(e,t,n)}}))}handleResponse(e){if(!this.deferredPromises[e.data.key])return void console.warn(`Promise for ${e.data.functionName} not found`);const[t,n]=this.deferredPromises[e.data.key];delete this.deferredPromises[e.data.key],"success"===e.data.status?t(e.data.result):(delete this.registeredCallbacks[e.data.key],n(new O(e.data.message,e.data.errorCode)))}handleCallback(e){var t;const{key:n,callbackName:o,args:r}=e.data,s=null==(t=this.registeredCallbacks[n])?void 0:t[o];s?s(...r):console.warn(`Callback with key ${n} and name ${o} not found.`)}sendErrorResponse(e,t,n){this.errorLogger&&this.errorLogger(e.data.functionName,t,n),this.sendResponse(e,{status:"failure",message:t,errorCode:n})}sendSuccessResponse(e,t){this.sendResponse(e,{status:"success",result:t})}sendResponse(e,t){this.sendMessage(e.source,e.origin,i({type:"response",key:e.data.key,functionName:e.data.functionName},t))}invokeCallback(e,t,n){this.sendMessage(e.source,e.origin,{type:"callback",key:e.data.key,functionName:e.data.functionName,callbackName:t,args:n})}sendMessage(e,t,n){e.postMessage(i({forWindowBridge:!0},U(n)),t)}sendRequest(e,t,n,o){return new Promise(((r,s)=>c(this,null,(function*(){const a=`${n}--${N()}`;try{const c=yield e();if(!c)throw new Error("Target window is undefined");let d=o[0];if(D(o)){const e=o[0].callbacks;this.addFunctionCallbacks(a,e),d=l(i({},o[0]),{callbacks:x(e)})}this.deferredPromises[a]=[r,s],this.sendMessage(c,t,{type:"request",key:a,functionName:n,params:[d]})}catch(c){delete this.deferredPromises[a],delete this.registeredCallbacks[a],s(new O(c.message,"MESSAGE_SENDING_FAILED"))}}))))}addFunctionCallbacks(e,t){Object.keys(t).forEach((e=>{if("function"!=typeof t[e])throw new Error(`Callback ${e} is not a function`)})),this.registeredCallbacks[e]=i({},t)}static init(e,t,n=[],o){if(this._instance)throw new Error("WindowBridge already initialized, you can't call WindowBridge.init more than once");return this._instance=new this(e,t,n,o),this._instance}static destroy(){this._instance&&(this._instance.unsubscribeToMessageEvent(),this._instance=void 0)}static getBridge(){if(!this._instance)throw new Error("WindowBridge not initialized, please call WindowBridge.init before calling WindowBridge.getBridge");return this._instance}static getTargetWindowFunctionProxy(e,t){return M.getBridge().getTargetWindowFunctionProxy(e,t)}getTargetWindowFunctionProxy(e,t){return new Proxy(this,{get:(n,o)=>(...r)=>n.sendRequest(e,t,o.toString(),r)})}}const F="ppmna-iframe",B="ppsdk-container";let $;function j(){return $||($=function(){if(document.getElementById(F))return;const e=document.createElement("div");return document.createElement("div"),e.setAttribute("id",B),e.setAttribute("class",B),e.style.all="initial",e.style.display="none",e.style.position="fixed",e.style.width="100%",e.style.height="100%",e.style.top="0",e.style.left="0",e.style.zIndex="2147483637",document.body.appendChild(e),e}()),$}let W,q=!1,K=null;function H(e){const t=j();t&&(t.style.display=e?"initial":"none",e?null!==K||q||(K=document.body.style.overflow,document.body.style.overflow="hidden"):null!==K&&(document.body.style.overflow=K,K=null))}function J(){return W||(W=new Promise(((e,t)=>{function n(){const n=document.createElement("iframe");n.setAttribute("src",y),n.setAttribute("name",F),n.setAttribute("id",F),n.setAttribute("class",F),n.setAttribute("allow","geolocation"),n.onload=()=>{e(n),n.onerror=null},n.onerror=t,n.style.all="initial",n.style.width="100%",n.style.height="100%",n.style.border="none";const o=j();o&&(o.innerHTML="",o.append(n))}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",(()=>{n()})):n()}))),W}M.init(_,[h]);const z=M.getTargetWindowFunctionProxy((function(){return J().then((e=>null==e?void 0:e.contentWindow)).catch((()=>null))}),h);function G(e,t,n){const o=N(),r=n=>{V(n.origin)&&n.data.name===e&&n.data.messageId===o&&function(e,t,n){var o,r,s;e.result===R&&(null==(o=null==t?void 0:t.fail)||o.call(t,e.data)),e.result===A&&(null==(r=null==t?void 0:t.success)||r.call(t,null==e?void 0:e.data)),e.result===T&&(null==(s=null==t?void 0:t.complete)||s.call(t),removeEventListener("message",n))}(n.data,t,r)};addEventListener("message",r),function(e){c(this,null,(function*(){var t;const n=yield J().catch((()=>{}));null==(t=null==n?void 0:n.contentWindow)||t.postMessage(JSON.parse(JSON.stringify(e)),h)}))}({name:e,params:n,messageId:o})}function V(e){return e===h}function Z(e){return f.includes(e)}function Q(e){return m.includes(e)}function X(e,t,n){return function(o={}){const r=null==n?void 0:n(o);z.logEvent(i({event_action:`pp_${e}_called`,event_category_suffix:e},r));const s=t(o);return s.then((t=>{var n;z.logEvent(i({event_action:`pp_${e}_success`,event_category_suffix:e},r)),null==(n=o.success)||n.call(o,t)})).catch((t=>{var n;console.error(t.message),z.logEvent(i({event_action:`pp_${e}_fail`,event_category_suffix:e,error_value:t.errorCode},r)),null==(n=o.fail)||n.call(o,{errorCode:t.errorCode})})).finally((()=>{var e;null==(e=o.complete)||e.call(o)})),s}}const Y={[E]:C,[I]:C,[k]:k};let ee,te;J(),te=Promise.resolve(!1);function ne(e){const t=function(e,t){if(t){const t=localStorage.getItem(`${P}.${e}`);if(t)return t}return u.get(`${P}.${e}`)||u.get(P)||""}(e.clientId,e.useLocalStorage),n=l(i({},e),{refreshToken:t,clientVersion:"2.64.2",clientSdkType:ee,clientUrl:window.location.href});var o;let r;null!=e.disableBackgroundScrollLock&&(o=!!e.disableBackgroundScrollLock,q=o);const s=new Promise((e=>r=e)),a=()=>{var t;r(!0),null==(t=e.complete)||t.call(e)};te.then((()=>J())).then((()=>{G("init",l(i({},e),{complete:a}),n)})).catch((()=>{var t;null==(t=e.fail)||t.call(e,{errorCode:E}),a()})),te=s}addEventListener("message",(e=>{var t;if(!(null==(t=e.data)?void 0:t.forWindowBridge)&&V(e.origin))if("reload"===e.data.name&&window.location.reload(),"makeVisible"!==e.data.name)if("showIframe"!==e.data.name)if("hideIframe"!==e.data.name){if("link"===e.data.name){const t=e.data.data;"_blank"===t.target?window.open(t.url,"_blank"):window.location.href=t.url}if("consoleDebugInfo"===e.data.name){const{params:t}=e.data.data;!function(e){console.debug(...e)}(t)}}else H(!1);else H(!0);else H(!0)})),addEventListener("popstate",(()=>{J().then((e=>{var t;const n={name:"clientPopState"};null==(t=null==e?void 0:e.contentWindow)||t.postMessage(n,h)})).catch((e=>console.warn(e)))}));var oe;oe={_handleMessageFromNative:e=>{J().then((t=>{var n;null==(n=null==t?void 0:t.contentWindow)||n.postMessage(JSON.parse(JSON.stringify({name:"handleMessageFromNative",params:{json:e}})),h)}))}},(!window.hasOwnProperty(g)||window[g]!==oe)&&(window[g]=oe);const re=["init","setTitle","copyToClipboard","getSessionData","setSessionData","getStorageData","setStorageData","removeStorageData","getLoginUrl"],se=["renderCoupons"];const ae={version:"2.64.2",revision:"b21dd99"};X("getLoginUrl",z.getLoginUrl);const ie=X("getPaymentSettings",z.getPaymentSettings),le=X("markAsReady",z.markAsReady);X("renderButton",z.renderButton);var ce=(e=>(e.validToken="TOKEN_VALID",e.initialized="INITIALIZED",e.emailRegistered="EMAIL_REGISTERED",e.emailNotVerified="EMAIL_NOT_VERIFIED",e.success="SUCCESS",e.loggedOut="LOGGED_OUT",e.connected="CONNECTED",e))(ce||{});const de=X("logout",(()=>c(this,null,(function*(){return yield z.logout(),{statusCode:ce.loggedOut}}))));const ue={verifyMultiFactorAuthResult:function(e){const t=new URL(window.location.href);G("verifyMultiFactorAuthResult",e,l(i({},e),{sessionId:t.searchParams.get("ppSessionId")}))},share:function(e){if(!(null==navigator?void 0:navigator.share))return void G("share",e,e);const t={text:null==e?void 0:e.text};navigator.share(t).then((()=>{var t,n;null==(t=null==e?void 0:e.success)||t.call(e),null==(n=null==e?void 0:e.complete)||n.call(e)})).catch((()=>{var t,n;null==(t=null==e?void 0:e.fail)||t.call(e,{errorCode:S}),null==(n=null==e?void 0:e.complete)||n.call(e)}))},setTitle:function(e){var t,n,o;document.title=null!=(t=null==e?void 0:e.title)?t:"",null==(n=null==e?void 0:e.success)||n.call(e),null==(o=null==e?void 0:e.complete)||o.call(e)},renderCoupons:X("renderCoupons",(e=>c(this,null,(function*(){const{merchant:t,couponId:n,containerId:o,postLoginRedirectUrl:r=window.location.href,postLoginRedirectType:s,locale:a}=e,i=document.getElementById(o);if(!i)throw new O("Invalid coupon container Id",b);const l=yield z.fetchCoupons({merchantId:t,couponId:n,postLoginRedirectUrl:r,postLoginRedirectType:s});try{const e=document.createElement("iframe");e.src=w,e.style.cssText="width:100%;height: 0;border: none;transition: height 300ms ease-in;display: block;",yield new Promise(((t,n)=>{e.onload=()=>t(!0),e.onerror=()=>n(new Error("Failed to load coupon iframe")),i.innerHTML="",i.append(e)})),e.onload=null,e.onerror=null,window.addEventListener("message",(({data:t,source:n})=>{"update-iframe-height"===(null==t?void 0:t.eventName)&&e.contentWindow===n&&(e.style.height=`${t.height}px`)}));const n=M.getTargetWindowFunctionProxy((()=>e.contentWindow),h);yield n.renderCoupons({coupons:l,merchantId:t,locale:a,postLoginRedirectUrl:r,postLoginRedirectType:s})}catch(c){throw new O(`An error occurred while displaying coupons, merchantId=${t}, couponId=${n}, error=${c}`,S)}}))),(e=>({event_label2:e.couponId,merchant_id:e.merchant}))),scanCode:function(e){var t;G("scanCode",e,l(i({},e),{redirectUrlOnCancel:null!=(t=null==e?void 0:e.redirectUrlOnCancel)?t:window.location.href}))},copyToClipboard:function(e){var t,n,o;const r=document.createElement("textarea");r.setAttribute("readonly","true"),r.setAttribute("contenteditable","true"),r.value=e.value,document.body.appendChild(r),r.select(),r.setSelectionRange(0,r.value.length);const s=document.execCommand("copy");document.body.removeChild(r),s?null==(t=null==e?void 0:e.success)||t.call(e):null==(n=null==e?void 0:e.fail)||n.call(e,{errorCode:"other"}),null==(o=e.complete)||o.call(e)},getSessionData:function(e){var t,n;const o=sessionStorage.getItem(null==e?void 0:e.key);null==(t=null==e?void 0:e.success)||t.call(e,{[null==e?void 0:e.key]:null!=o?o:""}),null==(n=null==e?void 0:e.complete)||n.call(e)},setSessionData:function(e){var t,n,o;sessionStorage.setItem(null==e?void 0:e.key,null!=(t=null==e?void 0:e.value)?t:""),null==(n=null==e?void 0:e.success)||n.call(e),null==(o=null==e?void 0:e.complete)||o.call(e)},getStorageData:function(e){var t,n;const o=localStorage.getItem(null==e?void 0:e.key);null==(t=null==e?void 0:e.success)||t.call(e,{[null==e?void 0:e.key]:null!=o?o:""}),null==(n=null==e?void 0:e.complete)||n.call(e)},setStorageData:function(e){var t,n,o;localStorage.setItem(null==e?void 0:e.key,null!=(t=null==e?void 0:e.value)?t:""),null==(n=null==e?void 0:e.success)||n.call(e),null==(o=null==e?void 0:e.complete)||o.call(e)},removeStorageData:function(e){var t,n;localStorage.removeItem(null==e?void 0:e.key),null==(t=null==e?void 0:e.success)||t.call(e),null==(n=null==e?void 0:e.complete)||n.call(e)},getKycPassportInfo:function(e){const t=window.location.href;G("getKycPassportInfo",e,l(i({},e),{url:t}))},logout:de,getPaymentSettings:ie,markAsReady:le};return function({sdkType:e,clientFunctions:t}){ee=e;const n=e===L.MiniApp?Z:Q,o=new Proxy(l(i({},t),{init:ne}),{get(t,o){if(o in ae)return ae[o];const r=o;if(!n(r))throw new Error(`${r} is not supported by ${e} JS SDK`);return function(e,t){return(n={})=>{const o=new Promise(((o,r)=>{let s,a;e(l(i({},n),{success:e=>{var t;a=e,null==(t=n.success)||t.call(n,e)},fail:e=>{var o;"init"===t&&Y[e.errorCode]?a={statusCode:Y[e.errorCode]}:s=e,null==(o=n.fail)||o.call(n,e)},complete:()=>{var e;s?r(s):o(a),null==(e=n.complete)||e.call(n)}}))}));return n.fail&&o.catch((()=>{})),o}}((function(e){return c(this,null,(function*(){var n,s;if(!re.includes(r)&&!(yield te)){if(!se.includes(r)||!function(e){return void 0!==e.clientId}(e))return null==(n=e.fail)||n.call(e,{errorCode:E}),void(null==(s=e.complete)||s.call(e));ne({clientId:e.clientId,env:e.env}),yield te}const a=t[r];if(a&&"function"==typeof a)return a(e);G(o,e,e)}))}),r)}});return window._pp=o,function(e){const t=window._ppcs;if(t){window._ppcs=void 0;for(const[n,o,r]of t){const t=e[n](o);r&&r(t)}}}(o),o}({sdkType:L.MiniApp,clientFunctions:ue})}();
|
|
2
|
+
var pp=function(){"use strict";var e=Object.defineProperty,t=Object.defineProperties,n=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,i=(t,n,o)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o,a=(e,t)=>{for(var n in t||(t={}))r.call(t,n)&&i(e,n,t[n]);if(o)for(var n of o(t))s.call(t,n)&&i(e,n,t[n]);return e},l=(e,o)=>t(e,n(o)),c=(e,t,n)=>new Promise(((o,r)=>{var s=e=>{try{a(n.next(e))}catch(t){r(t)}},i=e=>{try{a(n.throw(e))}catch(t){r(t)}},a=e=>e.done?o(e.value):Promise.resolve(e.value).then(s,i);a((n=n.apply(e,t)).next())}));function u(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)e[o]=n[o]}return e}var d=function e(t,n){function o(e,o,r){if("undefined"!=typeof document){"number"==typeof(r=u({},n,r)).expires&&(r.expires=new Date(Date.now()+864e5*r.expires)),r.expires&&(r.expires=r.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var i in r)r[i]&&(s+="; "+i,!0!==r[i]&&(s+="="+r[i].split(";")[0]));return document.cookie=e+"="+t.write(o,e)+s}}return Object.create({set:o,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],o={},r=0;r<n.length;r++){var s=n[r].split("="),i=s.slice(1).join("=");try{var a=decodeURIComponent(s[0]);if(o[a]=t.read(i,a),e===a)break}catch(l){}}return e?o[e]:o}},remove:function(e,t){o(e,"",u({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,u({},this.attributes,t))},withConverter:function(t){return e(u({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});const g="_PayPayJsBridge",f=["init","openWebview","openAuthSession","openMap","closeApp","makePayment","topup","setSessionData","getSessionData","setStorageData","getStorageData","removeStorageData","getPermissionStatus","scanCode","showAlert","showErrorSheet","getTopBarHeight","setTitle","showUpdateWarning","getPlatformInformation","openApp","share","getKycInformation","getUserLocation","checkPaymentMethod","registerKyc","startMultiFactorAuth","verifyMultiFactorAuthResult","getBankInfo","logout","getUserProfile","getBalance","getUserAddress","getUAID","copyToClipboard","registerUserInfo","setEnablePullDownRefresh","registerEmail","inputAddress","getDeviceInformation","request","requestInternal","registerPaymentFeatures","initKycPassport","getKycPassportInfo","shortcutExists","addShortcut","getAllUserAddresses","getUserPaymentFeatureSettings","getPaymentSettings","getTransactionInfo","getTransactions","getPayPayCardInfo","getExternalLinkageInformation","markAsReady","renderCoupons"],m=["init","createOrder","makePayment","render","logout","getAuthStatus","getUserProfile","getBalance","getUserAddress","getUAID","renderCoupons","getLoginUrl","renderButton"],p="2.69.0",v=new URL("https://mini-app-sdk-core.paypay.ne.jp/"),h=v.origin,y=new URL(`./iframe.html?v=${p}&rev=5bf6512`,v).href,w=new URL(`./coupon/iframe.html?v=${p}`,v).href;new URL(`./button/iframe.html?v=${p}`,v).href;const b="BAD_REQUEST_INSUFFICIENT_PARAMETER",S="UNKNOWN",E="SDK_NOT_INITIALIZED",I="TOKEN_NOT_FOUND",k="TOKEN_EXPIRED",C="AUTHORIZATION_NEEDED",P="ppjssdk.refreshToken";class O extends Error{constructor(e,t){super(e),this.errorCode=t}}const _=Object.freeze(Object.defineProperty({__proto__:null,getCookie:function({name:e}){return d.get(e)},getLocalStorage:function({name:e}){return localStorage.getItem(e)},getSessionStorage:function({name:e}){return sessionStorage.getItem(e)},getUrl:function(){return window.location.href},insertIframe:function(e){var{containerSelector:t,attributes:n}=e,i=n,{styles:a}=i,l=((e,t)=>{var n={};for(var i in e)r.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&o)for(var i of o(e))t.indexOf(i)<0&&s.call(e,i)&&(n[i]=e[i]);return n})(i,["styles"]);return new Promise(((e,n)=>{const o=document.querySelector(t);if(!o)return void n(new O(`Container with selector "${t}" not found.`,b));const r=document.createElement("iframe");r.onload=()=>{e(!0)},r.onerror=()=>{n(new O("Failed to load iframe.","NOT_REACHABLE"))},Object.assign(r.style,a),Object.entries(l).forEach((([e,t])=>{r.setAttribute(e,t)})),o.innerHTML="",o.appendChild(r)}))},removeCookie:function({name:e,options:t}){return d.remove(e,t)},removeElement:function({selector:e}){const t=document.querySelector(e);return!!t&&(t.remove(),!0)},removeLocalStorage:function({name:e}){return localStorage.removeItem(e)},removeQueryParametersFromUrl:function(e){const t=new URL(window.location.href);e.forEach((e=>t.searchParams.delete(e)));const n=t.toString().replace(t.origin,"");history.replaceState(history.state,"",n)},removeSessionStorage:function({name:e}){return sessionStorage.removeItem(e)},setCookie:function({name:e,value:t,options:n}){return d.set(e,t,n)},setLocalStorage:function({name:e,value:t}){return localStorage.setItem(e,t)},setSessionStorage:function({name:e,value:t}){return sessionStorage.setItem(e,t)},updateElementStyle:function({selector:e,styles:t}){const n=document.querySelector(e);return!!n&&(Object.assign(n.style,t),!0)}},Symbol.toStringTag,{value:"Module"})),R="success",A="fail",T="complete";var L=(e=>(e.MiniApp="MiniApp",e.SmartPayment="SmartPayment",e))(L||{});function N(e=6){const t=new Uint8Array(e);return crypto.getRandomValues(t),Array.from(t,(e=>(e%36).toString(36))).join("")}const U=e=>"object"!=typeof e||null===e?e:JSON.parse(JSON.stringify(e)),D=e=>{var t;const n=null==(t=e[0])?void 0:t.callbacks;return"object"==typeof n&&null!==n},x=e=>Object.keys(e).reduce(((e,t)=>(e[t]=!0,e)),{});class M{constructor(e,t,n=[],o){this.deferredPromises={},this.functions=e,this.allowedOrigins=t,this.middlewares=n,this.registeredCallbacks={},this.messageEventHandler=this.messageEventHandler.bind(this),this.errorLogger=o,this.subscribeToMessageEvent()}subscribeToMessageEvent(){window.addEventListener("message",this.messageEventHandler)}unsubscribeToMessageEvent(){window.removeEventListener("message",this.messageEventHandler)}messageEventHandler(e){var t;if(null==(t=e.data)?void 0:t.forWindowBridge)return this.allowedOrigins&&"request"===e.data.type&&!this.allowedOrigins.includes(e.origin)?this.sendErrorResponse(e,`${e.origin} is not allowed to make requests`,"ORIGIN_NOT_ALLOWED"):void("request"===e.data.type?this.handleRequest(e):"response"===e.data.type?this.handleResponse(e):"callback"===e.data.type&&this.handleCallback(e))}handleRequest(e){return c(this,null,(function*(){var t;const n=e.data.functionName,o=this.functions[n];if(!o)return void this.sendErrorResponse(e,`Function '${n}' does not exists on the target window`,"FUNCTION_NOT_FOUND");const r=U(e.data.params);D(r)&&(r[0].callbacks=Object.keys(r[0].callbacks).reduce(((t,n)=>(t[n]=(...t)=>{this.invokeCallback(e,n,t)},t)),{}));try{this.sendSuccessResponse(e,yield function(e,t,n,o){let r=-1;const s=o=>c(this,null,(function*(){if(++r,r<e.length){const n=e[r];return yield n(t,o,s)}return n(...o)}));return s(o)}([...this.middlewares,...null!=(t=o.middlewares)?t:[]],e,o,r))}catch(s){let t="Some error occurred while processing the request",n=S;s instanceof O?(t=s.message,n=s.errorCode):console.error(s),this.sendErrorResponse(e,t,n,s instanceof O?void 0:s)}}))}handleResponse(e){if(!this.deferredPromises[e.data.key])return void console.warn(`Promise for ${e.data.functionName} not found`);const[t,n]=this.deferredPromises[e.data.key];delete this.deferredPromises[e.data.key],"success"===e.data.status?t(e.data.result):(delete this.registeredCallbacks[e.data.key],n(new O(e.data.message,e.data.errorCode)))}handleCallback(e){var t;const{key:n,callbackName:o,args:r}=e.data,s=null==(t=this.registeredCallbacks[n])?void 0:t[o];s?s(...r):console.warn(`Callback with key ${n} and name ${o} not found.`)}sendErrorResponse(e,t,n,o){this.errorLogger&&this.errorLogger(e.data.functionName,t,n,o),this.sendResponse(e,{status:"failure",message:t,errorCode:n})}sendSuccessResponse(e,t){this.sendResponse(e,{status:"success",result:t})}sendResponse(e,t){this.sendMessage(e.source,e.origin,a({type:"response",key:e.data.key,functionName:e.data.functionName},t))}invokeCallback(e,t,n){this.sendMessage(e.source,e.origin,{type:"callback",key:e.data.key,functionName:e.data.functionName,callbackName:t,args:n})}sendMessage(e,t,n){e.postMessage(a({forWindowBridge:!0},U(n)),t)}sendRequest(e,t,n,o){const r=`${n}--${N()}`;return new Promise(((s,i)=>{this.deferredPromises[r]=[s,i],this.setupRequest(e,t,n,o,r).catch((e=>{delete this.deferredPromises[r],delete this.registeredCallbacks[r],i(new O(e.message,"MESSAGE_SENDING_FAILED"))}))}))}setupRequest(e,t,n,o,r){return c(this,null,(function*(){const s=yield e();if(!s)throw new Error("Target window is undefined");let i=o[0];if(D(o)){const e=o[0].callbacks;this.addFunctionCallbacks(r,e),i=l(a({},o[0]),{callbacks:x(e)})}this.sendMessage(s,t,{type:"request",key:r,functionName:n,params:[i]})}))}addFunctionCallbacks(e,t){Object.keys(t).forEach((e=>{if("function"!=typeof t[e])throw new Error(`Callback ${e} is not a function`)})),this.registeredCallbacks[e]=a({},t)}static init(e,t,n=[],o){if(this._instance)throw new Error("WindowBridge already initialized, you can't call WindowBridge.init more than once");return this._instance=new this(e,t,n,o),this._instance}static destroy(){this._instance&&(this._instance.unsubscribeToMessageEvent(),this._instance=void 0)}static getBridge(){if(!this._instance)throw new Error("WindowBridge not initialized, please call WindowBridge.init before calling WindowBridge.getBridge");return this._instance}static getTargetWindowFunctionProxy(e,t){return M.getBridge().getTargetWindowFunctionProxy(e,t)}getTargetWindowFunctionProxy(e,t){return new Proxy(this,{get:(n,o)=>(...r)=>n.sendRequest(e,t,o.toString(),r)})}}const F="ppmna-iframe",B="ppsdk-container";let $;function j(){return $||($=function(){if(document.getElementById(F))return;const e=document.createElement("div");return document.createElement("div"),e.setAttribute("id",B),e.setAttribute("class",B),e.style.all="initial",e.style.display="none",e.style.position="fixed",e.style.width="100%",e.style.height="100%",e.style.top="0",e.style.left="0",e.style.zIndex="2147483637",document.body.appendChild(e),e}()),$}let W,q=!1,K=null;function H(e){const t=j();t&&(t.style.display=e?"initial":"none",e?null!==K||q||(K=document.body.style.overflow,document.body.style.overflow="hidden"):null!==K&&(document.body.style.overflow=K,K=null))}function J(){return W||(W=new Promise(((e,t)=>{function n(){const n=document.createElement("iframe");n.setAttribute("src",y),n.setAttribute("name",F),n.setAttribute("id",F),n.setAttribute("class",F),n.setAttribute("allow","geolocation"),n.onload=()=>{e(n),n.onerror=null},n.onerror=t,n.style.all="initial",n.style.width="100%",n.style.height="100%",n.style.border="none";const o=j();o&&(o.innerHTML="",o.append(n))}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",(()=>{n()})):n()}))),W}M.init(_,[h]);const z=M.getTargetWindowFunctionProxy((function(){return J().then((e=>null==e?void 0:e.contentWindow)).catch((()=>null))}),h);function G(e,t,n){const o=N(),r=n=>{V(n.origin)&&n.data.name===e&&n.data.messageId===o&&function(e,t,n){var o,r,s;e.result===A&&(null==(o=null==t?void 0:t.fail)||o.call(t,e.data)),e.result===R&&(null==(r=null==t?void 0:t.success)||r.call(t,null==e?void 0:e.data)),e.result===T&&(null==(s=null==t?void 0:t.complete)||s.call(t),removeEventListener("message",n))}(n.data,t,r)};addEventListener("message",r),function(e){c(this,null,(function*(){var t;const n=yield J().catch((()=>{}));null==(t=null==n?void 0:n.contentWindow)||t.postMessage(JSON.parse(JSON.stringify(e)),h)}))}({name:e,params:n,messageId:o})}function V(e){return e===h}function Z(e){return f.includes(e)}function Q(e){return m.includes(e)}function X(e,t,n){return function(o={}){const r=null==n?void 0:n(o);z.logEvent(a({event_action:`pp_${e}_called`,event_category_suffix:e},r));const s=t(o);return s.then((t=>{var n;z.logEvent(a({event_action:`pp_${e}_success`,event_category_suffix:e},r)),null==(n=o.success)||n.call(o,t)})).catch((t=>{var n;console.error(t.message),z.logEvent(a({event_action:`pp_${e}_fail`,event_category_suffix:e,error_value:t.errorCode},r)),null==(n=o.fail)||n.call(o,{errorCode:t.errorCode})})).finally((()=>{var e;null==(e=o.complete)||e.call(o)})),s}}const Y={[E]:C,[I]:C,[k]:k};let ee,te;J(),te=Promise.resolve(!1);function ne(e){const t=function(e,t){if(t){const t=localStorage.getItem(`${P}.${e}`);if(t)return t}return d.get(`${P}.${e}`)||d.get(P)||""}(e.clientId,e.useLocalStorage),n=l(a({},e),{refreshToken:t,clientVersion:"2.69.0",clientSdkType:ee,clientUrl:window.location.href});var o;let r;null!=e.disableBackgroundScrollLock&&(o=!!e.disableBackgroundScrollLock,q=o);const s=new Promise((e=>r=e)),i=()=>{var t;r(!0),null==(t=e.complete)||t.call(e)};te.then((()=>J())).then((()=>{G("init",l(a({},e),{complete:i}),n)})).catch((()=>{var t;null==(t=e.fail)||t.call(e,{errorCode:E}),i()})),te=s}addEventListener("message",(e=>{var t;if(!(null==(t=e.data)?void 0:t.forWindowBridge)&&V(e.origin))if("reload"===e.data.name&&window.location.reload(),"makeVisible"!==e.data.name)if("showIframe"!==e.data.name)if("hideIframe"!==e.data.name){if("link"===e.data.name){const t=e.data.data;"_blank"===t.target?window.open(t.url,"_blank"):window.location.href=t.url}if("consoleDebugInfo"===e.data.name){const{params:t}=e.data.data;!function(e){console.debug(...e)}(t)}}else H(!1);else H(!0);else H(!0)})),addEventListener("popstate",(()=>{J().then((e=>{var t;const n={name:"clientPopState"};null==(t=null==e?void 0:e.contentWindow)||t.postMessage(n,h)})).catch((e=>console.warn(e)))}));var oe;oe={_handleMessageFromNative:e=>{J().then((t=>{var n;null==(n=null==t?void 0:t.contentWindow)||n.postMessage(JSON.parse(JSON.stringify({name:"handleMessageFromNative",params:{json:e}})),h)}))}},(!window.hasOwnProperty(g)||window[g]!==oe)&&(window[g]=oe);const re=["init","setTitle","copyToClipboard","getSessionData","setSessionData","getStorageData","setStorageData","removeStorageData","getLoginUrl"],se=["renderCoupons"];const ie={version:"2.69.0",revision:"5bf6512"};X("getLoginUrl",z.getLoginUrl);const ae=X("getPaymentSettings",z.getPaymentSettings),le=X("markAsReady",z.markAsReady);X("renderButton",z.renderButton);var ce=(e=>(e.validToken="TOKEN_VALID",e.initialized="INITIALIZED",e.emailRegistered="EMAIL_REGISTERED",e.emailNotVerified="EMAIL_NOT_VERIFIED",e.success="SUCCESS",e.loggedOut="LOGGED_OUT",e.connected="CONNECTED",e))(ce||{});const ue=X("logout",(()=>c(this,null,(function*(){return yield z.logout(),{statusCode:ce.loggedOut}}))));const de={verifyMultiFactorAuthResult:function(e){const t=new URL(window.location.href);G("verifyMultiFactorAuthResult",e,l(a({},e),{sessionId:t.searchParams.get("ppSessionId")}))},share:function(e){if(!(null==navigator?void 0:navigator.share))return void G("share",e,e);const t={text:null==e?void 0:e.text};navigator.share(t).then((()=>{var t,n;null==(t=null==e?void 0:e.success)||t.call(e),null==(n=null==e?void 0:e.complete)||n.call(e)})).catch((()=>{var t,n;null==(t=null==e?void 0:e.fail)||t.call(e,{errorCode:S}),null==(n=null==e?void 0:e.complete)||n.call(e)}))},setTitle:function(e){var t,n,o;document.title=null!=(t=null==e?void 0:e.title)?t:"",null==(n=null==e?void 0:e.success)||n.call(e),null==(o=null==e?void 0:e.complete)||o.call(e)},renderCoupons:X("renderCoupons",(e=>c(this,null,(function*(){const{merchant:t,couponId:n,containerId:o,postLoginRedirectUrl:r=window.location.href,postLoginRedirectType:s,locale:i}=e,a=document.getElementById(o);if(!a)throw new O("Invalid coupon container Id",b);const l=yield z.fetchCoupons({merchantId:t,couponId:n,postLoginRedirectUrl:r,postLoginRedirectType:s});try{const e=document.createElement("iframe");e.src=w,e.style.cssText="width:100%;height: 0;border: none;transition: height 300ms ease-in;display: block;",yield new Promise(((t,n)=>{e.onload=()=>t(!0),e.onerror=()=>n(new Error("Failed to load coupon iframe")),a.innerHTML="",a.append(e)})),e.onload=null,e.onerror=null,window.addEventListener("message",(({data:t,source:n})=>{"update-iframe-height"===(null==t?void 0:t.eventName)&&e.contentWindow===n&&(e.style.height=`${t.height}px`)}));const n=M.getTargetWindowFunctionProxy((()=>e.contentWindow),h);yield n.renderCoupons({coupons:l,merchantId:t,locale:i,postLoginRedirectUrl:r,postLoginRedirectType:s})}catch(c){throw new O(`An error occurred while displaying coupons, merchantId=${t}, couponId=${n}, error=${c}`,S)}}))),(e=>({event_label2:e.couponId,merchant_id:e.merchant}))),scanCode:function(e){var t;G("scanCode",e,l(a({},e),{redirectUrlOnCancel:null!=(t=null==e?void 0:e.redirectUrlOnCancel)?t:window.location.href}))},copyToClipboard:function(e){var t,n,o;const r=document.createElement("textarea");r.setAttribute("readonly","true"),r.setAttribute("contenteditable","true"),r.value=e.value,document.body.appendChild(r),r.select(),r.setSelectionRange(0,r.value.length);const s=document.execCommand("copy");document.body.removeChild(r),s?null==(t=null==e?void 0:e.success)||t.call(e):null==(n=null==e?void 0:e.fail)||n.call(e,{errorCode:"other"}),null==(o=e.complete)||o.call(e)},getSessionData:function(e){var t,n;const o=sessionStorage.getItem(null==e?void 0:e.key);null==(t=null==e?void 0:e.success)||t.call(e,{[null==e?void 0:e.key]:null!=o?o:""}),null==(n=null==e?void 0:e.complete)||n.call(e)},setSessionData:function(e){var t,n,o;sessionStorage.setItem(null==e?void 0:e.key,null!=(t=null==e?void 0:e.value)?t:""),null==(n=null==e?void 0:e.success)||n.call(e),null==(o=null==e?void 0:e.complete)||o.call(e)},getStorageData:function(e){var t,n;const o=localStorage.getItem(null==e?void 0:e.key);null==(t=null==e?void 0:e.success)||t.call(e,{[null==e?void 0:e.key]:null!=o?o:""}),null==(n=null==e?void 0:e.complete)||n.call(e)},setStorageData:function(e){var t,n,o;localStorage.setItem(null==e?void 0:e.key,null!=(t=null==e?void 0:e.value)?t:""),null==(n=null==e?void 0:e.success)||n.call(e),null==(o=null==e?void 0:e.complete)||o.call(e)},removeStorageData:function(e){var t,n;localStorage.removeItem(null==e?void 0:e.key),null==(t=null==e?void 0:e.success)||t.call(e),null==(n=null==e?void 0:e.complete)||n.call(e)},getKycPassportInfo:function(e){const t=window.location.href;G("getKycPassportInfo",e,l(a({},e),{url:t}))},logout:ue,getPaymentSettings:ae,markAsReady:le};return function({sdkType:e,clientFunctions:t}){ee=e;const n=e===L.MiniApp?Z:Q,o=new Proxy(l(a({},t),{init:ne}),{get(t,o){if(o in ie)return ie[o];const r=o;if(!n(r))throw new Error(`${r} is not supported by ${e} JS SDK`);return function(e,t){return(n={})=>{const o=new Promise(((o,r)=>{let s,i;e(l(a({},n),{success:e=>{var t;i=e,null==(t=n.success)||t.call(n,e)},fail:e=>{var o;"init"===t&&Y[e.errorCode]?i={statusCode:Y[e.errorCode]}:s=e,null==(o=n.fail)||o.call(n,e)},complete:()=>{var e;s?r(s):o(i),null==(e=n.complete)||e.call(n)}}))}));return n.fail&&o.catch((()=>{})),o}}((function(e){return c(this,null,(function*(){var n,s;if(!re.includes(r)&&!(yield te)){if(!se.includes(r)||!function(e){return void 0!==e.clientId}(e))return null==(n=e.fail)||n.call(e,{errorCode:E}),void(null==(s=e.complete)||s.call(e));ne({clientId:e.clientId,env:e.env}),yield te}const i=t[r];if(i&&"function"==typeof i)return i(e);G(o,e,e)}))}),r)}});return window._pp=o,function(e){const t=window._ppcs;if(t){window._ppcs=void 0;for(const[n,o,r]of t){const t=e[n](o);r&&r(t)}}}(o),o}({sdkType:L.MiniApp,clientFunctions:de})}();
|
|
@@ -151,6 +151,7 @@ const jsBridgeNamespace = "_PayPayJsBridge";
|
|
|
151
151
|
const miniAppSupportedFunctions = [
|
|
152
152
|
"init",
|
|
153
153
|
"openWebview",
|
|
154
|
+
"openAuthSession",
|
|
154
155
|
"openMap",
|
|
155
156
|
"closeApp",
|
|
156
157
|
"makePayment",
|
|
@@ -216,13 +217,12 @@ const smartPaymentSupportedFunctions = [
|
|
|
216
217
|
"getBalance",
|
|
217
218
|
"getUserAddress",
|
|
218
219
|
"getUAID",
|
|
219
|
-
"getCashbackInformation",
|
|
220
220
|
"renderCoupons",
|
|
221
221
|
"getLoginUrl",
|
|
222
222
|
"renderButton"
|
|
223
223
|
];
|
|
224
|
-
const JS_SDK_VERSION = "2.
|
|
225
|
-
const REVISION = "
|
|
224
|
+
const JS_SDK_VERSION = "2.69.0";
|
|
225
|
+
const REVISION = "5bf6512";
|
|
226
226
|
const coreBaseUrl = new URL("https://mini-app-sdk-core.paypay.ne.jp/");
|
|
227
227
|
const CORE_IFRAME_ORIGIN = coreBaseUrl.origin;
|
|
228
228
|
const CORE_IFRAME_URL = new URL(
|
|
@@ -469,6 +469,7 @@ class WindowBridge {
|
|
|
469
469
|
`Function '${functionName}' does not exists on the target window`,
|
|
470
470
|
functionNotFound
|
|
471
471
|
);
|
|
472
|
+
return;
|
|
472
473
|
}
|
|
473
474
|
const params = deepClone(receivedMessageEvent.data.params);
|
|
474
475
|
if (hasCallbacks(params)) {
|
|
@@ -501,7 +502,12 @@ class WindowBridge {
|
|
|
501
502
|
} else {
|
|
502
503
|
console.error(error);
|
|
503
504
|
}
|
|
504
|
-
this.sendErrorResponse(
|
|
505
|
+
this.sendErrorResponse(
|
|
506
|
+
receivedMessageEvent,
|
|
507
|
+
message,
|
|
508
|
+
errorCode,
|
|
509
|
+
error instanceof PPError ? void 0 : error
|
|
510
|
+
);
|
|
505
511
|
}
|
|
506
512
|
});
|
|
507
513
|
}
|
|
@@ -538,12 +544,13 @@ class WindowBridge {
|
|
|
538
544
|
}
|
|
539
545
|
callback(...args);
|
|
540
546
|
}
|
|
541
|
-
sendErrorResponse(receivedMessageEvent, message, errorCode) {
|
|
547
|
+
sendErrorResponse(receivedMessageEvent, message, errorCode, originalError) {
|
|
542
548
|
if (this.errorLogger) {
|
|
543
549
|
this.errorLogger(
|
|
544
550
|
receivedMessageEvent.data.functionName,
|
|
545
551
|
message,
|
|
546
|
-
errorCode
|
|
552
|
+
errorCode,
|
|
553
|
+
originalError
|
|
547
554
|
);
|
|
548
555
|
}
|
|
549
556
|
this.sendResponse(receivedMessageEvent, {
|
|
@@ -591,37 +598,45 @@ class WindowBridge {
|
|
|
591
598
|
);
|
|
592
599
|
}
|
|
593
600
|
sendRequest(getTargetWindow, targetWindowOrigin, functionName, params) {
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
this.addFunctionCallbacks(key, callbacks);
|
|
605
|
-
messageParams = __spreadProps(__spreadValues({}, params[0]), {
|
|
606
|
-
// Convert callbacks to a format that can be sent over postMessage
|
|
607
|
-
callbacks: getCallbacksPlaceholder(callbacks)
|
|
608
|
-
});
|
|
609
|
-
}
|
|
610
|
-
this.deferredPromises[key] = [resolve, reject];
|
|
611
|
-
this.sendMessage(targetWindow, targetWindowOrigin, {
|
|
612
|
-
type: "request",
|
|
613
|
-
key,
|
|
614
|
-
functionName,
|
|
615
|
-
params: [messageParams]
|
|
616
|
-
});
|
|
617
|
-
} catch (error) {
|
|
601
|
+
const key = `${functionName}--${getRandomString()}`;
|
|
602
|
+
return new Promise((resolve, reject) => {
|
|
603
|
+
this.deferredPromises[key] = [resolve, reject];
|
|
604
|
+
this.setupRequest(
|
|
605
|
+
getTargetWindow,
|
|
606
|
+
targetWindowOrigin,
|
|
607
|
+
functionName,
|
|
608
|
+
params,
|
|
609
|
+
key
|
|
610
|
+
).catch((error) => {
|
|
618
611
|
delete this.deferredPromises[key];
|
|
619
612
|
delete this.registeredCallbacks[key];
|
|
620
613
|
reject(
|
|
621
614
|
new PPError(error.message, messageSendingFailed)
|
|
622
615
|
);
|
|
616
|
+
});
|
|
617
|
+
});
|
|
618
|
+
}
|
|
619
|
+
setupRequest(getTargetWindow, targetWindowOrigin, functionName, params, key) {
|
|
620
|
+
return __async(this, null, function* () {
|
|
621
|
+
const targetWindow = yield getTargetWindow();
|
|
622
|
+
if (!targetWindow) {
|
|
623
|
+
throw new Error("Target window is undefined");
|
|
623
624
|
}
|
|
624
|
-
|
|
625
|
+
let messageParams = params[0];
|
|
626
|
+
if (hasCallbacks(params)) {
|
|
627
|
+
const callbacks = params[0].callbacks;
|
|
628
|
+
this.addFunctionCallbacks(key, callbacks);
|
|
629
|
+
messageParams = __spreadProps(__spreadValues({}, params[0]), {
|
|
630
|
+
callbacks: getCallbacksPlaceholder(callbacks)
|
|
631
|
+
});
|
|
632
|
+
}
|
|
633
|
+
this.sendMessage(targetWindow, targetWindowOrigin, {
|
|
634
|
+
type: "request",
|
|
635
|
+
key,
|
|
636
|
+
functionName,
|
|
637
|
+
params: [messageParams]
|
|
638
|
+
});
|
|
639
|
+
});
|
|
625
640
|
}
|
|
626
641
|
addFunctionCallbacks(key, callbacks) {
|
|
627
642
|
Object.keys(callbacks).forEach((callbackName) => {
|
|
@@ -1013,7 +1028,7 @@ addEventListener("popstate", () => {
|
|
|
1013
1028
|
});
|
|
1014
1029
|
function init(params) {
|
|
1015
1030
|
const refreshToken2 = getRefreshToken(params.clientId, params.useLocalStorage);
|
|
1016
|
-
const clientVersion = "2.
|
|
1031
|
+
const clientVersion = "2.69.0";
|
|
1017
1032
|
const initParams = __spreadProps(__spreadValues({}, params), {
|
|
1018
1033
|
refreshToken: refreshToken2,
|
|
1019
1034
|
clientVersion,
|
|
@@ -1090,8 +1105,8 @@ function executePendingFunctionCalls(client2) {
|
|
|
1090
1105
|
}
|
|
1091
1106
|
}
|
|
1092
1107
|
const clientProperties = {
|
|
1093
|
-
version: "2.
|
|
1094
|
-
revision: "
|
|
1108
|
+
version: "2.69.0",
|
|
1109
|
+
revision: "5bf6512"
|
|
1095
1110
|
};
|
|
1096
1111
|
function isInitClientParams(params) {
|
|
1097
1112
|
return params.clientId !== void 0;
|
|
@@ -74,6 +74,11 @@ declare const _default: {
|
|
|
74
74
|
bodyAddTopup: string;
|
|
75
75
|
close: string;
|
|
76
76
|
};
|
|
77
|
+
bankSync: {
|
|
78
|
+
topupInfoBox: {
|
|
79
|
+
description: string;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
77
82
|
giftVoucher: {
|
|
78
83
|
applicableGVInfo: string;
|
|
79
84
|
pmpSettingInfoBox: {
|
|
@@ -334,6 +339,11 @@ declare const _default: {
|
|
|
334
339
|
bodyAddTopup: string;
|
|
335
340
|
close: string;
|
|
336
341
|
};
|
|
342
|
+
bankSync: {
|
|
343
|
+
topupInfoBox: {
|
|
344
|
+
description: string;
|
|
345
|
+
};
|
|
346
|
+
};
|
|
337
347
|
giftVoucher: {
|
|
338
348
|
applicableGVInfo: string;
|
|
339
349
|
pmpSettingInfoBox: {
|
|
@@ -53,6 +53,10 @@ declare const _default: {
|
|
|
53
53
|
overdraftAmount: {
|
|
54
54
|
excessUsage: string;
|
|
55
55
|
};
|
|
56
|
+
bankSync: {
|
|
57
|
+
title: string;
|
|
58
|
+
description: string;
|
|
59
|
+
};
|
|
56
60
|
};
|
|
57
61
|
en: {
|
|
58
62
|
topup: {
|
|
@@ -108,6 +112,10 @@ declare const _default: {
|
|
|
108
112
|
overdraftAmount: {
|
|
109
113
|
excessUsage: string;
|
|
110
114
|
};
|
|
115
|
+
bankSync: {
|
|
116
|
+
title: string;
|
|
117
|
+
description: string;
|
|
118
|
+
};
|
|
111
119
|
};
|
|
112
120
|
};
|
|
113
121
|
export default _default;
|
|
@@ -28,6 +28,7 @@ export declare const KycStatus: {
|
|
|
28
28
|
readonly completed: "COMPLETED";
|
|
29
29
|
readonly notCompleted: "NOT_COMPLETED";
|
|
30
30
|
readonly kycValidationInProcess: "KYC_VALIDATION_IN_PROCESS";
|
|
31
|
+
readonly kycUpdateRequiredFraudDetected: "KYC_UPDATE_REQUIRED_FRAUD_DETECTED";
|
|
31
32
|
};
|
|
32
33
|
export declare type KycStatusType = (typeof KycStatus)[keyof typeof KycStatus];
|
|
33
34
|
export interface KycData {
|
|
@@ -155,6 +155,10 @@ export declare type WalletMethod = MethodBase & {
|
|
|
155
155
|
cashBackExpirableBalanceInfo?: Balance;
|
|
156
156
|
};
|
|
157
157
|
};
|
|
158
|
+
bankSyncMode?: {
|
|
159
|
+
enabled: boolean;
|
|
160
|
+
label: string;
|
|
161
|
+
};
|
|
158
162
|
};
|
|
159
163
|
declare type PointToggleInfo = {
|
|
160
164
|
cashBackUseStatus: 'USE' | 'SAVE' | 'INVEST' | null;
|
package/dist/types.d.ts
CHANGED
|
@@ -53,10 +53,6 @@ export interface SetDataParams extends NativeParams<void> {
|
|
|
53
53
|
export interface GetDataParams extends NativeParams<MiniAppResult> {
|
|
54
54
|
key: string;
|
|
55
55
|
}
|
|
56
|
-
export interface GetCashbackInfoParams extends NativeParams<MiniAppResult> {
|
|
57
|
-
merchantPaymentId: string;
|
|
58
|
-
merchant?: string;
|
|
59
|
-
}
|
|
60
56
|
export interface RemoveDataParams extends NativeParams<void> {
|
|
61
57
|
key: string;
|
|
62
58
|
}
|
|
@@ -387,7 +383,7 @@ export declare type SaveCodeVerifierOption = {
|
|
|
387
383
|
codeVerifier: string;
|
|
388
384
|
domain: string;
|
|
389
385
|
isSecure: boolean;
|
|
390
|
-
expires?: number | Date
|
|
386
|
+
expires?: number | Date;
|
|
391
387
|
};
|
|
392
388
|
export declare type ClientJsBridge = {
|
|
393
389
|
_handleMessageFromNative: (json: NativeResponse) => void;
|
|
@@ -4,11 +4,11 @@ import { PPEnvType } from '../types/init';
|
|
|
4
4
|
interface EventParams {
|
|
5
5
|
env: PPEnvType;
|
|
6
6
|
event_category?: string;
|
|
7
|
-
event_label?:
|
|
7
|
+
event_label?: string | number;
|
|
8
8
|
screen_name: string;
|
|
9
9
|
event_action?: string;
|
|
10
10
|
error_value?: string;
|
|
11
|
-
event_label2?:
|
|
11
|
+
event_label2?: string | number;
|
|
12
12
|
merchant_id?: string;
|
|
13
13
|
order_type?: string;
|
|
14
14
|
user_agent?: string;
|
package/dist/utils/api.d.ts
CHANGED
|
@@ -66,6 +66,10 @@ export declare type BalanceInfo = {
|
|
|
66
66
|
amount: number;
|
|
67
67
|
currency: string;
|
|
68
68
|
};
|
|
69
|
+
bankSyncMode?: {
|
|
70
|
+
enabled: boolean;
|
|
71
|
+
label: string;
|
|
72
|
+
};
|
|
69
73
|
};
|
|
70
74
|
export declare function topup(queryParams: TopupQuery, body: TopupBody, paymentParams?: MakePaymentParams): Promise<PPFetchResult<TopupResponse>>;
|
|
71
75
|
export declare type BalanceParams = {
|
package/dist/utils/helper.d.ts
CHANGED
|
@@ -81,7 +81,7 @@ export declare function makeDefaultErrorHandler(params: {
|
|
|
81
81
|
fail?: (error: {
|
|
82
82
|
errorCode: ErrorCodesType;
|
|
83
83
|
}) => void;
|
|
84
|
-
} | undefined, onComplete: () => void): (err: unknown) => void;
|
|
84
|
+
} | undefined, onComplete: () => void, reportException?: (error: unknown) => void): (err: unknown) => void;
|
|
85
85
|
export declare function getCardBrandImage(brandName: string): string;
|
|
86
86
|
export declare function hasMultiplePPCD(paymentMethods: PaymentMethod[] | undefined): boolean;
|
|
87
87
|
export declare function addAdditionalInfoForMultiplePPCD(paymentMethods: PaymentMethod[]): void;
|
|
@@ -96,5 +96,5 @@ export declare function getOverDraftInfoBanner(banners?: Array<InfoBanner>): Inf
|
|
|
96
96
|
export declare function isValidUrl(urlChallenge: string): boolean;
|
|
97
97
|
export declare function calculateTopMargin(navigationStyle: string, statusBarHeight: number, navBarHeight: number): number;
|
|
98
98
|
export declare function getWindowByName(frames: Window, windowName: string): Window | undefined;
|
|
99
|
-
export declare function isPaymentMethodDisabled(paymentMethod: PaymentMethod,
|
|
99
|
+
export declare function isPaymentMethodDisabled(paymentMethod: PaymentMethod, ignoreMaintenanceFlag?: boolean): boolean;
|
|
100
100
|
export {};
|
|
@@ -20,7 +20,7 @@ export interface MessageCallbackType extends MessageBaseType {
|
|
|
20
20
|
args: Array<unknown>;
|
|
21
21
|
}
|
|
22
22
|
export declare type Callbacks = Record<string, (...args: Array<unknown>) => void>;
|
|
23
|
-
export declare type ErrorLogger = (functionName: string, message: string,
|
|
23
|
+
export declare type ErrorLogger = (functionName: string, message: string, errorCode: ErrorCodesType, originalError?: unknown) => void;
|
|
24
24
|
export declare type MessageRequestType = MessageBaseType & PartialMessageRequestType;
|
|
25
25
|
export declare type Params = Array<any>;
|
|
26
26
|
export interface FunctionType {
|
|
@@ -36,11 +36,11 @@ export declare type WindowBridgeFunctions<T extends FunctionsCollection> = {
|
|
|
36
36
|
export declare class WindowBridge {
|
|
37
37
|
private static _instance?;
|
|
38
38
|
private deferredPromises;
|
|
39
|
-
private functions;
|
|
40
|
-
private allowedOrigins?;
|
|
41
|
-
private middlewares;
|
|
39
|
+
private readonly functions;
|
|
40
|
+
private readonly allowedOrigins?;
|
|
41
|
+
private readonly middlewares;
|
|
42
42
|
private registeredCallbacks;
|
|
43
|
-
private errorLogger?;
|
|
43
|
+
private readonly errorLogger?;
|
|
44
44
|
private constructor();
|
|
45
45
|
private subscribeToMessageEvent;
|
|
46
46
|
private unsubscribeToMessageEvent;
|
|
@@ -54,6 +54,7 @@ export declare class WindowBridge {
|
|
|
54
54
|
private invokeCallback;
|
|
55
55
|
private sendMessage;
|
|
56
56
|
private sendRequest;
|
|
57
|
+
private setupRequest;
|
|
57
58
|
private addFunctionCallbacks;
|
|
58
59
|
static init(functions: FunctionsCollection, allowedOrigins?: Array<string>, middlewares?: Array<Middleware>, errorLogger?: ErrorLogger): WindowBridge;
|
|
59
60
|
static destroy(): void;
|
|
@@ -304,6 +304,10 @@ export declare const useMakePaymentStore: import("pinia").StoreDefinition<"makeP
|
|
|
304
304
|
formattedMin: string;
|
|
305
305
|
} | undefined;
|
|
306
306
|
} | undefined;
|
|
307
|
+
bankSyncMode?: {
|
|
308
|
+
enabled: boolean;
|
|
309
|
+
label: string;
|
|
310
|
+
} | undefined;
|
|
307
311
|
} | {
|
|
308
312
|
paymentMethodId: string;
|
|
309
313
|
paymentMethodType: "CREDIT_CARD";
|
|
@@ -1032,6 +1036,10 @@ export declare const useMakePaymentStore: import("pinia").StoreDefinition<"makeP
|
|
|
1032
1036
|
formattedMin: string;
|
|
1033
1037
|
} | undefined;
|
|
1034
1038
|
} | undefined;
|
|
1039
|
+
bankSyncMode?: {
|
|
1040
|
+
enabled: boolean;
|
|
1041
|
+
label: string;
|
|
1042
|
+
} | undefined;
|
|
1035
1043
|
} | {
|
|
1036
1044
|
paymentMethodId: string;
|
|
1037
1045
|
paymentMethodType: "CREDIT_CARD";
|
|
@@ -1778,6 +1786,10 @@ export declare const useMakePaymentStore: import("pinia").StoreDefinition<"makeP
|
|
|
1778
1786
|
formattedMin: string;
|
|
1779
1787
|
} | undefined;
|
|
1780
1788
|
} | undefined;
|
|
1789
|
+
bankSyncMode?: {
|
|
1790
|
+
enabled: boolean;
|
|
1791
|
+
label: string;
|
|
1792
|
+
} | undefined;
|
|
1781
1793
|
} | {
|
|
1782
1794
|
paymentMethodId: string;
|
|
1783
1795
|
paymentMethodType: "CREDIT_CARD";
|
|
@@ -2786,6 +2798,10 @@ export declare const useMakePaymentStore: import("pinia").StoreDefinition<"makeP
|
|
|
2786
2798
|
formattedMin: string;
|
|
2787
2799
|
} | undefined;
|
|
2788
2800
|
} | undefined;
|
|
2801
|
+
bankSyncMode?: {
|
|
2802
|
+
enabled: boolean;
|
|
2803
|
+
label: string;
|
|
2804
|
+
} | undefined;
|
|
2789
2805
|
} | {
|
|
2790
2806
|
paymentMethodId: string;
|
|
2791
2807
|
paymentMethodType: "CREDIT_CARD";
|
|
@@ -3514,6 +3530,10 @@ export declare const useMakePaymentStore: import("pinia").StoreDefinition<"makeP
|
|
|
3514
3530
|
formattedMin: string;
|
|
3515
3531
|
} | undefined;
|
|
3516
3532
|
} | undefined;
|
|
3533
|
+
bankSyncMode?: {
|
|
3534
|
+
enabled: boolean;
|
|
3535
|
+
label: string;
|
|
3536
|
+
} | undefined;
|
|
3517
3537
|
} | {
|
|
3518
3538
|
paymentMethodId: string;
|
|
3519
3539
|
paymentMethodType: "CREDIT_CARD";
|
|
@@ -4260,6 +4280,10 @@ export declare const useMakePaymentStore: import("pinia").StoreDefinition<"makeP
|
|
|
4260
4280
|
formattedMin: string;
|
|
4261
4281
|
} | undefined;
|
|
4262
4282
|
} | undefined;
|
|
4283
|
+
bankSyncMode?: {
|
|
4284
|
+
enabled: boolean;
|
|
4285
|
+
label: string;
|
|
4286
|
+
} | undefined;
|
|
4263
4287
|
} | {
|
|
4264
4288
|
paymentMethodId: string;
|
|
4265
4289
|
paymentMethodType: "CREDIT_CARD";
|
|
@@ -5268,6 +5292,10 @@ export declare const useMakePaymentStore: import("pinia").StoreDefinition<"makeP
|
|
|
5268
5292
|
formattedMin: string;
|
|
5269
5293
|
} | undefined;
|
|
5270
5294
|
} | undefined;
|
|
5295
|
+
bankSyncMode?: {
|
|
5296
|
+
enabled: boolean;
|
|
5297
|
+
label: string;
|
|
5298
|
+
} | undefined;
|
|
5271
5299
|
} | {
|
|
5272
5300
|
paymentMethodId: string;
|
|
5273
5301
|
paymentMethodType: "CREDIT_CARD";
|
|
@@ -5996,6 +6024,10 @@ export declare const useMakePaymentStore: import("pinia").StoreDefinition<"makeP
|
|
|
5996
6024
|
formattedMin: string;
|
|
5997
6025
|
} | undefined;
|
|
5998
6026
|
} | undefined;
|
|
6027
|
+
bankSyncMode?: {
|
|
6028
|
+
enabled: boolean;
|
|
6029
|
+
label: string;
|
|
6030
|
+
} | undefined;
|
|
5999
6031
|
} | {
|
|
6000
6032
|
paymentMethodId: string;
|
|
6001
6033
|
paymentMethodType: "CREDIT_CARD";
|
|
@@ -6742,6 +6774,10 @@ export declare const useMakePaymentStore: import("pinia").StoreDefinition<"makeP
|
|
|
6742
6774
|
formattedMin: string;
|
|
6743
6775
|
} | undefined;
|
|
6744
6776
|
} | undefined;
|
|
6777
|
+
bankSyncMode?: {
|
|
6778
|
+
enabled: boolean;
|
|
6779
|
+
label: string;
|
|
6780
|
+
} | undefined;
|
|
6745
6781
|
} | {
|
|
6746
6782
|
paymentMethodId: string;
|
|
6747
6783
|
paymentMethodType: "CREDIT_CARD";
|
|
@@ -7750,6 +7786,10 @@ export declare const useMakePaymentStore: import("pinia").StoreDefinition<"makeP
|
|
|
7750
7786
|
formattedMin: string;
|
|
7751
7787
|
} | undefined;
|
|
7752
7788
|
} | undefined;
|
|
7789
|
+
bankSyncMode?: {
|
|
7790
|
+
enabled: boolean;
|
|
7791
|
+
label: string;
|
|
7792
|
+
} | undefined;
|
|
7753
7793
|
} | {
|
|
7754
7794
|
paymentMethodId: string;
|
|
7755
7795
|
paymentMethodType: "CREDIT_CARD";
|
|
@@ -8478,6 +8518,10 @@ export declare const useMakePaymentStore: import("pinia").StoreDefinition<"makeP
|
|
|
8478
8518
|
formattedMin: string;
|
|
8479
8519
|
} | undefined;
|
|
8480
8520
|
} | undefined;
|
|
8521
|
+
bankSyncMode?: {
|
|
8522
|
+
enabled: boolean;
|
|
8523
|
+
label: string;
|
|
8524
|
+
} | undefined;
|
|
8481
8525
|
} | {
|
|
8482
8526
|
paymentMethodId: string;
|
|
8483
8527
|
paymentMethodType: "CREDIT_CARD";
|
|
@@ -9224,6 +9268,10 @@ export declare const useMakePaymentStore: import("pinia").StoreDefinition<"makeP
|
|
|
9224
9268
|
formattedMin: string;
|
|
9225
9269
|
} | undefined;
|
|
9226
9270
|
} | undefined;
|
|
9271
|
+
bankSyncMode?: {
|
|
9272
|
+
enabled: boolean;
|
|
9273
|
+
label: string;
|
|
9274
|
+
} | undefined;
|
|
9227
9275
|
} | {
|
|
9228
9276
|
paymentMethodId: string;
|
|
9229
9277
|
paymentMethodType: "CREDIT_CARD";
|
|
@@ -10037,6 +10085,8 @@ export declare const useMakePaymentStore: import("pinia").StoreDefinition<"makeP
|
|
|
10037
10085
|
topupHalfSheetAmount?: number[] | undefined;
|
|
10038
10086
|
};
|
|
10039
10087
|
} & import("pinia").PiniaCustomStateProperties<State>): boolean;
|
|
10088
|
+
isBankSyncModeEnabled(): boolean;
|
|
10089
|
+
showBankSyncTopupInfoBox(): boolean;
|
|
10040
10090
|
selectedTopupMethod(state: {
|
|
10041
10091
|
paymentParams: {
|
|
10042
10092
|
amount: {
|
|
@@ -10232,6 +10282,10 @@ export declare const useMakePaymentStore: import("pinia").StoreDefinition<"makeP
|
|
|
10232
10282
|
formattedMin: string;
|
|
10233
10283
|
} | undefined;
|
|
10234
10284
|
} | undefined;
|
|
10285
|
+
bankSyncMode?: {
|
|
10286
|
+
enabled: boolean;
|
|
10287
|
+
label: string;
|
|
10288
|
+
} | undefined;
|
|
10235
10289
|
} | {
|
|
10236
10290
|
paymentMethodId: string;
|
|
10237
10291
|
paymentMethodType: "CREDIT_CARD";
|
|
@@ -10960,6 +11014,10 @@ export declare const useMakePaymentStore: import("pinia").StoreDefinition<"makeP
|
|
|
10960
11014
|
formattedMin: string;
|
|
10961
11015
|
} | undefined;
|
|
10962
11016
|
} | undefined;
|
|
11017
|
+
bankSyncMode?: {
|
|
11018
|
+
enabled: boolean;
|
|
11019
|
+
label: string;
|
|
11020
|
+
} | undefined;
|
|
10963
11021
|
} | {
|
|
10964
11022
|
paymentMethodId: string;
|
|
10965
11023
|
paymentMethodType: "CREDIT_CARD";
|
|
@@ -11706,6 +11764,10 @@ export declare const useMakePaymentStore: import("pinia").StoreDefinition<"makeP
|
|
|
11706
11764
|
formattedMin: string;
|
|
11707
11765
|
} | undefined;
|
|
11708
11766
|
} | undefined;
|
|
11767
|
+
bankSyncMode?: {
|
|
11768
|
+
enabled: boolean;
|
|
11769
|
+
label: string;
|
|
11770
|
+
} | undefined;
|
|
11709
11771
|
} | {
|
|
11710
11772
|
paymentMethodId: string;
|
|
11711
11773
|
paymentMethodType: "CREDIT_CARD";
|
|
@@ -12714,6 +12776,10 @@ export declare const useMakePaymentStore: import("pinia").StoreDefinition<"makeP
|
|
|
12714
12776
|
formattedMin: string;
|
|
12715
12777
|
} | undefined;
|
|
12716
12778
|
} | undefined;
|
|
12779
|
+
bankSyncMode?: {
|
|
12780
|
+
enabled: boolean;
|
|
12781
|
+
label: string;
|
|
12782
|
+
} | undefined;
|
|
12717
12783
|
} | {
|
|
12718
12784
|
paymentMethodId: string;
|
|
12719
12785
|
paymentMethodType: "CREDIT_CARD";
|
|
@@ -13442,6 +13508,10 @@ export declare const useMakePaymentStore: import("pinia").StoreDefinition<"makeP
|
|
|
13442
13508
|
formattedMin: string;
|
|
13443
13509
|
} | undefined;
|
|
13444
13510
|
} | undefined;
|
|
13511
|
+
bankSyncMode?: {
|
|
13512
|
+
enabled: boolean;
|
|
13513
|
+
label: string;
|
|
13514
|
+
} | undefined;
|
|
13445
13515
|
} | {
|
|
13446
13516
|
paymentMethodId: string;
|
|
13447
13517
|
paymentMethodType: "CREDIT_CARD";
|
|
@@ -14188,6 +14258,10 @@ export declare const useMakePaymentStore: import("pinia").StoreDefinition<"makeP
|
|
|
14188
14258
|
formattedMin: string;
|
|
14189
14259
|
} | undefined;
|
|
14190
14260
|
} | undefined;
|
|
14261
|
+
bankSyncMode?: {
|
|
14262
|
+
enabled: boolean;
|
|
14263
|
+
label: string;
|
|
14264
|
+
} | undefined;
|
|
14191
14265
|
} | {
|
|
14192
14266
|
paymentMethodId: string;
|
|
14193
14267
|
paymentMethodType: "CREDIT_CARD";
|
|
@@ -15196,6 +15270,10 @@ export declare const useMakePaymentStore: import("pinia").StoreDefinition<"makeP
|
|
|
15196
15270
|
formattedMin: string;
|
|
15197
15271
|
} | undefined;
|
|
15198
15272
|
} | undefined;
|
|
15273
|
+
bankSyncMode?: {
|
|
15274
|
+
enabled: boolean;
|
|
15275
|
+
label: string;
|
|
15276
|
+
} | undefined;
|
|
15199
15277
|
} | {
|
|
15200
15278
|
paymentMethodId: string;
|
|
15201
15279
|
paymentMethodType: "CREDIT_CARD";
|
|
@@ -15924,6 +16002,10 @@ export declare const useMakePaymentStore: import("pinia").StoreDefinition<"makeP
|
|
|
15924
16002
|
formattedMin: string;
|
|
15925
16003
|
} | undefined;
|
|
15926
16004
|
} | undefined;
|
|
16005
|
+
bankSyncMode?: {
|
|
16006
|
+
enabled: boolean;
|
|
16007
|
+
label: string;
|
|
16008
|
+
} | undefined;
|
|
15927
16009
|
} | {
|
|
15928
16010
|
paymentMethodId: string;
|
|
15929
16011
|
paymentMethodType: "CREDIT_CARD";
|
|
@@ -16670,6 +16752,10 @@ export declare const useMakePaymentStore: import("pinia").StoreDefinition<"makeP
|
|
|
16670
16752
|
formattedMin: string;
|
|
16671
16753
|
} | undefined;
|
|
16672
16754
|
} | undefined;
|
|
16755
|
+
bankSyncMode?: {
|
|
16756
|
+
enabled: boolean;
|
|
16757
|
+
label: string;
|
|
16758
|
+
} | undefined;
|
|
16673
16759
|
} | {
|
|
16674
16760
|
paymentMethodId: string;
|
|
16675
16761
|
paymentMethodType: "CREDIT_CARD";
|
|
@@ -17678,6 +17764,10 @@ export declare const useMakePaymentStore: import("pinia").StoreDefinition<"makeP
|
|
|
17678
17764
|
formattedMin: string;
|
|
17679
17765
|
} | undefined;
|
|
17680
17766
|
} | undefined;
|
|
17767
|
+
bankSyncMode?: {
|
|
17768
|
+
enabled: boolean;
|
|
17769
|
+
label: string;
|
|
17770
|
+
} | undefined;
|
|
17681
17771
|
} | {
|
|
17682
17772
|
paymentMethodId: string;
|
|
17683
17773
|
paymentMethodType: "CREDIT_CARD";
|
|
@@ -18406,6 +18496,10 @@ export declare const useMakePaymentStore: import("pinia").StoreDefinition<"makeP
|
|
|
18406
18496
|
formattedMin: string;
|
|
18407
18497
|
} | undefined;
|
|
18408
18498
|
} | undefined;
|
|
18499
|
+
bankSyncMode?: {
|
|
18500
|
+
enabled: boolean;
|
|
18501
|
+
label: string;
|
|
18502
|
+
} | undefined;
|
|
18409
18503
|
} | {
|
|
18410
18504
|
paymentMethodId: string;
|
|
18411
18505
|
paymentMethodType: "CREDIT_CARD";
|
|
@@ -19152,6 +19246,10 @@ export declare const useMakePaymentStore: import("pinia").StoreDefinition<"makeP
|
|
|
19152
19246
|
formattedMin: string;
|
|
19153
19247
|
} | undefined;
|
|
19154
19248
|
} | undefined;
|
|
19249
|
+
bankSyncMode?: {
|
|
19250
|
+
enabled: boolean;
|
|
19251
|
+
label: string;
|
|
19252
|
+
} | undefined;
|
|
19155
19253
|
} | {
|
|
19156
19254
|
paymentMethodId: string;
|
|
19157
19255
|
paymentMethodType: "CREDIT_CARD";
|
|
@@ -20163,6 +20261,10 @@ export declare const useMakePaymentStore: import("pinia").StoreDefinition<"makeP
|
|
|
20163
20261
|
formattedMin: string;
|
|
20164
20262
|
} | undefined;
|
|
20165
20263
|
} | undefined;
|
|
20264
|
+
bankSyncMode?: {
|
|
20265
|
+
enabled: boolean;
|
|
20266
|
+
label: string;
|
|
20267
|
+
} | undefined;
|
|
20166
20268
|
} | {
|
|
20167
20269
|
paymentMethodId: string;
|
|
20168
20270
|
paymentMethodType: "CREDIT_CARD";
|
|
@@ -20891,6 +20993,10 @@ export declare const useMakePaymentStore: import("pinia").StoreDefinition<"makeP
|
|
|
20891
20993
|
formattedMin: string;
|
|
20892
20994
|
} | undefined;
|
|
20893
20995
|
} | undefined;
|
|
20996
|
+
bankSyncMode?: {
|
|
20997
|
+
enabled: boolean;
|
|
20998
|
+
label: string;
|
|
20999
|
+
} | undefined;
|
|
20894
21000
|
} | {
|
|
20895
21001
|
paymentMethodId: string;
|
|
20896
21002
|
paymentMethodType: "CREDIT_CARD";
|
|
@@ -21637,6 +21743,10 @@ export declare const useMakePaymentStore: import("pinia").StoreDefinition<"makeP
|
|
|
21637
21743
|
formattedMin: string;
|
|
21638
21744
|
} | undefined;
|
|
21639
21745
|
} | undefined;
|
|
21746
|
+
bankSyncMode?: {
|
|
21747
|
+
enabled: boolean;
|
|
21748
|
+
label: string;
|
|
21749
|
+
} | undefined;
|
|
21640
21750
|
} | {
|
|
21641
21751
|
paymentMethodId: string;
|
|
21642
21752
|
paymentMethodType: "CREDIT_CARD";
|
|
@@ -22645,6 +22755,10 @@ export declare const useMakePaymentStore: import("pinia").StoreDefinition<"makeP
|
|
|
22645
22755
|
formattedMin: string;
|
|
22646
22756
|
} | undefined;
|
|
22647
22757
|
} | undefined;
|
|
22758
|
+
bankSyncMode?: {
|
|
22759
|
+
enabled: boolean;
|
|
22760
|
+
label: string;
|
|
22761
|
+
} | undefined;
|
|
22648
22762
|
} | {
|
|
22649
22763
|
paymentMethodId: string;
|
|
22650
22764
|
paymentMethodType: "CREDIT_CARD";
|
|
@@ -23373,6 +23487,10 @@ export declare const useMakePaymentStore: import("pinia").StoreDefinition<"makeP
|
|
|
23373
23487
|
formattedMin: string;
|
|
23374
23488
|
} | undefined;
|
|
23375
23489
|
} | undefined;
|
|
23490
|
+
bankSyncMode?: {
|
|
23491
|
+
enabled: boolean;
|
|
23492
|
+
label: string;
|
|
23493
|
+
} | undefined;
|
|
23376
23494
|
} | {
|
|
23377
23495
|
paymentMethodId: string;
|
|
23378
23496
|
paymentMethodType: "CREDIT_CARD";
|
|
@@ -24119,6 +24237,10 @@ export declare const useMakePaymentStore: import("pinia").StoreDefinition<"makeP
|
|
|
24119
24237
|
formattedMin: string;
|
|
24120
24238
|
} | undefined;
|
|
24121
24239
|
} | undefined;
|
|
24240
|
+
bankSyncMode?: {
|
|
24241
|
+
enabled: boolean;
|
|
24242
|
+
label: string;
|
|
24243
|
+
} | undefined;
|
|
24122
24244
|
} | {
|
|
24123
24245
|
paymentMethodId: string;
|
|
24124
24246
|
paymentMethodType: "CREDIT_CARD";
|
|
@@ -25127,6 +25249,10 @@ export declare const useMakePaymentStore: import("pinia").StoreDefinition<"makeP
|
|
|
25127
25249
|
formattedMin: string;
|
|
25128
25250
|
} | undefined;
|
|
25129
25251
|
} | undefined;
|
|
25252
|
+
bankSyncMode?: {
|
|
25253
|
+
enabled: boolean;
|
|
25254
|
+
label: string;
|
|
25255
|
+
} | undefined;
|
|
25130
25256
|
} | {
|
|
25131
25257
|
paymentMethodId: string;
|
|
25132
25258
|
paymentMethodType: "CREDIT_CARD";
|
|
@@ -25855,6 +25981,10 @@ export declare const useMakePaymentStore: import("pinia").StoreDefinition<"makeP
|
|
|
25855
25981
|
formattedMin: string;
|
|
25856
25982
|
} | undefined;
|
|
25857
25983
|
} | undefined;
|
|
25984
|
+
bankSyncMode?: {
|
|
25985
|
+
enabled: boolean;
|
|
25986
|
+
label: string;
|
|
25987
|
+
} | undefined;
|
|
25858
25988
|
} | {
|
|
25859
25989
|
paymentMethodId: string;
|
|
25860
25990
|
paymentMethodType: "CREDIT_CARD";
|
|
@@ -26601,6 +26731,10 @@ export declare const useMakePaymentStore: import("pinia").StoreDefinition<"makeP
|
|
|
26601
26731
|
formattedMin: string;
|
|
26602
26732
|
} | undefined;
|
|
26603
26733
|
} | undefined;
|
|
26734
|
+
bankSyncMode?: {
|
|
26735
|
+
enabled: boolean;
|
|
26736
|
+
label: string;
|
|
26737
|
+
} | undefined;
|
|
26604
26738
|
} | {
|
|
26605
26739
|
paymentMethodId: string;
|
|
26606
26740
|
paymentMethodType: "CREDIT_CARD";
|
|
@@ -27613,6 +27747,10 @@ export declare const useMakePaymentStore: import("pinia").StoreDefinition<"makeP
|
|
|
27613
27747
|
formattedMin: string;
|
|
27614
27748
|
} | undefined;
|
|
27615
27749
|
} | undefined;
|
|
27750
|
+
bankSyncMode?: {
|
|
27751
|
+
enabled: boolean;
|
|
27752
|
+
label: string;
|
|
27753
|
+
} | undefined;
|
|
27616
27754
|
} | {
|
|
27617
27755
|
paymentMethodId: string;
|
|
27618
27756
|
paymentMethodType: "CREDIT_CARD";
|
|
@@ -28341,6 +28479,10 @@ export declare const useMakePaymentStore: import("pinia").StoreDefinition<"makeP
|
|
|
28341
28479
|
formattedMin: string;
|
|
28342
28480
|
} | undefined;
|
|
28343
28481
|
} | undefined;
|
|
28482
|
+
bankSyncMode?: {
|
|
28483
|
+
enabled: boolean;
|
|
28484
|
+
label: string;
|
|
28485
|
+
} | undefined;
|
|
28344
28486
|
} | {
|
|
28345
28487
|
paymentMethodId: string;
|
|
28346
28488
|
paymentMethodType: "CREDIT_CARD";
|
|
@@ -29087,6 +29229,10 @@ export declare const useMakePaymentStore: import("pinia").StoreDefinition<"makeP
|
|
|
29087
29229
|
formattedMin: string;
|
|
29088
29230
|
} | undefined;
|
|
29089
29231
|
} | undefined;
|
|
29232
|
+
bankSyncMode?: {
|
|
29233
|
+
enabled: boolean;
|
|
29234
|
+
label: string;
|
|
29235
|
+
} | undefined;
|
|
29090
29236
|
} | {
|
|
29091
29237
|
paymentMethodId: string;
|
|
29092
29238
|
paymentMethodType: "CREDIT_CARD";
|
|
@@ -30095,6 +30241,10 @@ export declare const useMakePaymentStore: import("pinia").StoreDefinition<"makeP
|
|
|
30095
30241
|
formattedMin: string;
|
|
30096
30242
|
} | undefined;
|
|
30097
30243
|
} | undefined;
|
|
30244
|
+
bankSyncMode?: {
|
|
30245
|
+
enabled: boolean;
|
|
30246
|
+
label: string;
|
|
30247
|
+
} | undefined;
|
|
30098
30248
|
} | {
|
|
30099
30249
|
paymentMethodId: string;
|
|
30100
30250
|
paymentMethodType: "CREDIT_CARD";
|
|
@@ -30823,6 +30973,10 @@ export declare const useMakePaymentStore: import("pinia").StoreDefinition<"makeP
|
|
|
30823
30973
|
formattedMin: string;
|
|
30824
30974
|
} | undefined;
|
|
30825
30975
|
} | undefined;
|
|
30976
|
+
bankSyncMode?: {
|
|
30977
|
+
enabled: boolean;
|
|
30978
|
+
label: string;
|
|
30979
|
+
} | undefined;
|
|
30826
30980
|
} | {
|
|
30827
30981
|
paymentMethodId: string;
|
|
30828
30982
|
paymentMethodType: "CREDIT_CARD";
|
|
@@ -31569,6 +31723,10 @@ export declare const useMakePaymentStore: import("pinia").StoreDefinition<"makeP
|
|
|
31569
31723
|
formattedMin: string;
|
|
31570
31724
|
} | undefined;
|
|
31571
31725
|
} | undefined;
|
|
31726
|
+
bankSyncMode?: {
|
|
31727
|
+
enabled: boolean;
|
|
31728
|
+
label: string;
|
|
31729
|
+
} | undefined;
|
|
31572
31730
|
} | {
|
|
31573
31731
|
paymentMethodId: string;
|
|
31574
31732
|
paymentMethodType: "CREDIT_CARD";
|
|
@@ -2,3 +2,4 @@ import { PaymentMethod } from '../../../types/makePayment';
|
|
|
2
2
|
export declare function hasAvailableTopupMethod(paymentMethods: PaymentMethod[]): boolean;
|
|
3
3
|
export declare function findFirstValidMethod(paymentMethods: PaymentMethod[]): number;
|
|
4
4
|
export declare function isValidPaymentMethod(savedMethodId: string | null, paymentMethods: PaymentMethod[]): boolean;
|
|
5
|
+
export declare function isPayPayBank(method: PaymentMethod | undefined | null): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paypay/mini-app-js-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.69.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "yarn build:client && yarn build:core",
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
"js-cookie": "^3.0.5"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
+
"@paypay/avalanche": "^0.1.2",
|
|
44
45
|
"@pinia/testing": "0.1.7",
|
|
45
46
|
"@playwright/test": "^1.49.1",
|
|
46
47
|
"@rollup/plugin-html": "^1.1.0",
|