@paypay/mini-app-js-sdk 2.0.0-beta.2 → 2.1.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/clientUtils.d.ts +8 -4
- package/dist/client/index.d.ts +3 -1
- package/dist/core/coreUtils.d.ts +1 -0
- package/dist/mini-app-api.d.ts +1 -2
- package/dist/mini-app-js-sdk.browser.js +1 -1
- package/dist/mini-app-js-sdk.es.js +90 -52
- package/dist/model/bridge/render.d.ts +12 -0
- package/dist/model/makePayment.d.ts +6 -0
- package/dist/model/miniAppError.d.ts +1 -2
- package/dist/resources/en.d.ts +0 -82
- package/dist/resources/images.d.ts +0 -61
- package/dist/resources/ja.d.ts +0 -82
- package/dist/types.d.ts +14 -2
- package/dist/utils/fetch.d.ts +1 -1
- package/dist/utils/getLanguage.d.ts +0 -82
- package/dist/utils/storage.d.ts +0 -3
- package/package.json +1 -1
- package/dist/model/bridge/showStorageAccessPermissionAlert.d.ts +0 -2
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import { ClientJsBridge } from '../types';
|
|
2
|
-
export declare function checkIFrameOrigin(origin: string, env: string | undefined): boolean;
|
|
3
|
-
export declare function getIframeOrigin(env: string | undefined): string;
|
|
4
|
-
export declare function getIframeUrl(env: string | undefined): string;
|
|
2
|
+
export declare function checkIFrameOrigin(origin: string, env: string | undefined, coreVersion?: string): boolean;
|
|
3
|
+
export declare function getIframeOrigin(env: string | undefined, coreVersion?: string): string;
|
|
4
|
+
export declare function getIframeUrl(env: string | undefined, coreVersion?: string): string;
|
|
5
5
|
export declare function getIconUrl(theme?: string): string;
|
|
6
6
|
export declare function convertToString(str?: string): string;
|
|
7
|
-
export declare function generateMessageId(): string;
|
|
8
7
|
export declare function removeCookie(key: string, domain: string): void;
|
|
9
8
|
export declare function saveRefreshToken(refreshToken: string, domain: string, isSecure: boolean): string | undefined;
|
|
9
|
+
export declare function saveCodeVerifier(codeVerifier: string, domain: string, isSecure: boolean): string | undefined;
|
|
10
10
|
export declare function getRefreshToken(): string;
|
|
11
|
+
export declare function getCodeVerifier(): string;
|
|
11
12
|
export declare function exposeClientJsBridge(jsBridge: ClientJsBridge): boolean;
|
|
12
13
|
export declare function consoleDebugInfo(params: unknown[]): void;
|
|
13
14
|
export declare function isSupportedMiniapp(functionName: string): boolean;
|
|
14
15
|
export declare function isSupportedSmartpayment(functionName: string): boolean;
|
|
16
|
+
export declare function isFunctionRunning(): boolean;
|
|
17
|
+
export declare function functionEnd(messageId: string): void;
|
|
18
|
+
export declare function functionStart(): string;
|
package/dist/client/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { NativeParams } from '../jsbridge-core/jsbridge';
|
|
2
2
|
import { MiniAppModule } from '../mini-app-api';
|
|
3
|
-
import { CopyToClipBoardParams, GetDataParams, InitClientParams, MiniAppResult, RemoveDataParams, RenderSmartButtonParams, ScanCodeClientParams, SetDataParams, SetTitleParams, ShareParams } from '../types';
|
|
3
|
+
import { CopyToClipBoardParams, GetAuthStatusClientParams, GetDataParams, InitClientParams, MiniAppResult, RemoveDataParams, RenderSmartButtonParams, ScanCodeClientParams, SetDataParams, SetTitleParams, ShareParams } from '../types';
|
|
4
4
|
declare function init(params: InitClientParams): void;
|
|
5
|
+
declare function getAuthStatus(params: GetAuthStatusClientParams): void;
|
|
5
6
|
declare function verifyMultiFactorAuthResult(params: NativeParams<MiniAppResult>): void;
|
|
6
7
|
declare function getKycPassportInfo(params: NativeParams<MiniAppResult>): void;
|
|
7
8
|
declare function share(params: ShareParams): void;
|
|
@@ -28,6 +29,7 @@ declare const clientFunctions: {
|
|
|
28
29
|
setStorageData: typeof setStorageData;
|
|
29
30
|
removeStorageData: typeof removeStorageData;
|
|
30
31
|
getKycPassportInfo: typeof getKycPassportInfo;
|
|
32
|
+
getAuthStatus: typeof getAuthStatus;
|
|
31
33
|
};
|
|
32
34
|
declare type ClientSDKType = Omit<MiniAppModule, keyof typeof clientFunctions> & typeof clientFunctions;
|
|
33
35
|
declare const _default: ClientSDKType;
|
package/dist/core/coreUtils.d.ts
CHANGED
|
@@ -2,5 +2,6 @@ import { ConsoleDebugInfoParams } from '../types';
|
|
|
2
2
|
export declare function initCoreUtil(targetOrigin: string): void;
|
|
3
3
|
export declare function linkOpen(url: string, target?: string, isFocus?: boolean): void;
|
|
4
4
|
export declare function sendRefreshTokenToClient(refreshToken: string, subdomainCookieSharing?: boolean): void;
|
|
5
|
+
export declare function sendCodeVerifierToClient(codeVerifier: string, url: string): void;
|
|
5
6
|
export declare function sendMakeIframeVisible(): void;
|
|
6
7
|
export declare function sendDebugInfoToClient(data: ConsoleDebugInfoParams, env?: string | null, debugMode?: boolean): void;
|
package/dist/mini-app-api.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { JsBridge, NativeParams } from './jsbridge-core/jsbridge';
|
|
2
2
|
import { JsBridgeModule } from './jsbridge-core/module';
|
|
3
|
-
import { AddShortcutParams, CheckPaymentMethodParams, CloseAppParams, CopyToClipBoardParams, GetAuthStatusParams, GetBalanceParams, GetCashbackInfoParams, GetDataParams, GetKycInformationParams, GetKycPassportInfoParams, GetPermissionStatusParams, GetUserAddressParams, GetUserLocationParams, GetUserPaymentFeatureSettingsParams, InitKycPassportParams, InitParams, InputAddressParams, LogAppsFlyerEventParams, MakePaymentParams, MapParams, MiniAppResult, OpenAppParams, OpenMiniAppParams, OpenWebviewParams, RegisterKycParams, RegisterPaymentFeaturesParams, RegisterUserInfoParams, RemoveDataParams, RenderSmartButtonParams, RequestInternalParams, RequestParams, ScanCodeParams, SetDataParams, SetEnablePullDownRefreshParams, SetTitleParams, ShareParams, ShortcutExistsParams, ShowAlertParams, ShowErrorSheetParams,
|
|
3
|
+
import { AddShortcutParams, CheckPaymentMethodParams, CloseAppParams, CopyToClipBoardParams, GetAuthStatusParams, GetBalanceParams, GetCashbackInfoParams, GetDataParams, GetKycInformationParams, GetKycPassportInfoParams, GetPermissionStatusParams, GetUserAddressParams, GetUserLocationParams, GetUserPaymentFeatureSettingsParams, InitKycPassportParams, InitParams, InputAddressParams, LogAppsFlyerEventParams, MakePaymentParams, MapParams, MiniAppResult, OpenAppParams, OpenMiniAppParams, OpenWebviewParams, RegisterKycParams, RegisterPaymentFeaturesParams, RegisterUserInfoParams, RemoveDataParams, RenderSmartButtonParams, RequestInternalParams, RequestParams, ScanCodeParams, SetDataParams, SetEnablePullDownRefreshParams, SetTitleParams, ShareParams, ShortcutExistsParams, ShowAlertParams, ShowErrorSheetParams, ShowUpdateWarningParams, SmsAuthParams, StartMultiFactorAuthParams, TopupParams, VerifyMultiFactorAuthResultParams } from './types';
|
|
4
4
|
export declare class MiniAppModule extends JsBridgeModule {
|
|
5
5
|
constructor(jsBridge: JsBridge);
|
|
6
6
|
private detectMode;
|
|
@@ -53,7 +53,6 @@ export declare class MiniAppModule extends JsBridgeModule {
|
|
|
53
53
|
registerUserInfo(params: RegisterUserInfoParams): void;
|
|
54
54
|
getBankInfo(params: NativeParams<MiniAppResult>): void;
|
|
55
55
|
registerPaymentFeatures(params: RegisterPaymentFeaturesParams): void;
|
|
56
|
-
showStorageAccessPermissionAlert(params: ShowStorageAccessPermissionAlertParams): void;
|
|
57
56
|
addShortcut(params: AddShortcutParams): void;
|
|
58
57
|
shortcutExists(params: ShortcutExistsParams): void;
|
|
59
58
|
getUserPaymentFeatureSettings(params: GetUserPaymentFeatureSettingsParams): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document!="undefined"){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;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{user-select:auto}.ppmna-reset-css * li{list-style:none}.ppmna-reset-css * :where(*:not(svg,svg *)){all:revert}.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:#ff0033}.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";function e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)e[a]=n[a]}return e}var t=function t(n,a){function o(t,o,l){if("undefined"!=typeof document){"number"==typeof(l=e({},a,l)).expires&&(l.expires=new Date(Date.now()+864e5*l.expires)),l.expires&&(l.expires=l.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var i="";for(var r in l)l[r]&&(i+="; "+r,!0!==l[r]&&(i+="="+l[r].split(";")[0]));return document.cookie=t+"="+n.write(o,t)+i}}return Object.create({set:o,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var t=document.cookie?document.cookie.split("; "):[],a={},o=0;o<t.length;o++){var l=t[o].split("="),i=l.slice(1).join("=");try{var r=decodeURIComponent(l[0]);if(a[r]=n.read(i,r),e===r)break}catch(s){}}return e?a[e]:a}},remove:function(t,n){o(t,"",e({},n,{expires:-1}))},withAttributes:function(n){return t(this.converter,e({},this.attributes,n))},withConverter:function(n){return t(e({},this.converter,n),this.attributes)}},{attributes:{value:Object.freeze(a)},converter:{value:Object.freeze(n)}})}({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:"/"}),n=(e=>(e.accessToken="ppjssdk.accessToken",e.refreshToken="ppjssdk.refreshToken",e.env="ppjssdk.env",e.deviceUUID="ppjssdk.deviceUUID",e.clientUUID="ppjssdk.clientUUID",e.lastPayment="ppjssdk.lastPayment",e.lastTopup="ppjssdk.lastTopup",e.appDetail="ppjssdk.appDetail",e.appConfig="ppjssdk.appConfig",e.userInfo="ppjssdk.userInfo",e.lastPaymentMethod="ppjssdk.lastPaymentMethod",e.lastTopupPayMethod="ppjssdk.lastTopupPayMethod",e.codeVerifier="ppjssdk.codeVerifier",e.clientOrigin="ppjssdk.clientOrigin",e.clientVersion="ppjssdk.clientVersion",e.debugMode="ppjssdk.debugMode",e.merchant="ppjssdk.merchant",e))(n||{});const a="success",o="fail",l="complete",i="init",r="render",s="makePayment",c="verifyMultiFactorAuthResult",d="share",u="scanCode",p="showStorageAccessPermissionAlert",m="handleMessageFromNative",v="getKycPassportInfo",E="reload",I="link",f="saveRefreshToken",g="makeVisible",A="consoleDebugInfo",_="_PayPayJsBridge",h=["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","checkAccessToken","debug","inputAddress","getDeviceInformation","openMiniApp","request","requestInternal","registerPaymentFeatures","initKycPassport","getKycPassportInfo","shortcutExists","addShortcut","logAppsFlyerEvent","getAllUserAddresses"];function T(e){return"https://image.paypay.ne.jp/miniapps/mini-app-sdk/"+e}const N=T("icon-paypay-rec.svg"),S=T("icon-paypay-rec-white.svg");function y(e,t){return e===D(t)}function D(e){return new URL(P(e)).origin}function P(e){return`${function(){switch(e){case"staging":case"sandbox":case"canary":case"qa":return"https://mini-app-sdk-core.paypay.ne.jp/dev/stg/iframe.html";default:return"https://mini-app-sdk-core.paypay.ne.jp/iframe.html"}}()}?v=2.0.0-beta.2`}function O(e){return e?String(e):""}function C(){return Math.random().toString(36).substring(7)}function k(e,a,o){return function(e,n){t.remove(e),t.remove(e,{domain:n})}(n.refreshToken,a),t.set(n.refreshToken,e,{domain:a,expires:90,secure:o})}var R=(e=>(e.success="SUCCESS",e.invalidUrl="INVALID_URL",e.invalidData="INVALID_DATA",e.invalidHeader="INVALID_HEADER",e.invalidMethod="INVALID_METHOD",e.invalidPath="INVALID_PATH",e.notReachable="NOT_REACHABLE",e.notAvailable="NOT_AVAILABLE",e.timeOut="TIME_OUT",e.whiteListError="NONE_WHITELIST_DOMAIN",e.statusCodeError="STATUS_CODE_ERROR",e.invalidResponse="INVALID_RESPONSE",e.noLocationPermission="NO_USER_LOCATION_PERMISSION",e.noPermissionListAvailable="NO_PERMISSION_LIST_AVAILABLE",e.other="other",e.serverError="SERVER_ERROR",e.noCameraPermission="HOST_APP_CAMERA_DENIED",e.noAlbumPermission="HOST_APP_ALBUM_DENIED",e.insufficientScope="INSUFFICIENT_SCOPE",e.userCanceled="USER_CANCELED",e.invalidJSAPIParams="INVALID_JS_API_PARAMS",e.hostAppLocationDenied="HOST_APP_LOCATION_DENIED",e.hostAppContactsDenied="HOST_APP_READING_CONTACT_DENIED",e.badRequestInsufficientParameter="BAD_REQUEST_INSUFFICIENT_PARAMETER",e.badRequest="BAD_REQUEST",e.paymentFail="PAYMENT_FAIL",e.topupFail="TOPUP_FAIL",e.topupSuccessButNotAddToBalance="TOPUP_SUCCESS_BUT_NOT_ADD_TO_BALANCE",e.userCanceledSimilarTxn="USER_CANCELED_SIMILAR_TRANSACTION",e.mapAppNotFound="MAP_APP_NOT_FOUND",e.invalidAppSchemeURL="INVALID_APP_SCHEME_URL",e.noValueFound="NO_VALUE_FOUND",e.securityNotSetup="SECURITY_NOT_SETUP",e.userDenied="USER_DENIED",e.securityTemporaryLocked="SECURITY_TEMPORARY_LOCKED",e.couldNotGenerateBarcode="COULD_NOT_GENERATE_BARCODE",e.cannotDetectAvailability="CAN_NOT_DETECT_AVAILABILITY",e.suspectedDuplicatePayment="SUSPECTED_DUPLICATE_PAYMENT",e.noSufficientFund="NO_SUFFICIENT_FUND",e.unknown="UNKNOWN",e.sdkNotInitialized="SDK_NOT_INITIALIZED",e.tokenNotFound="TOKEN_NOT_FOUND",e.tokenExpired="TOKEN_EXPIRED",e.activeRequestExists="ACTIVE_REQUEST_EXISTS",e.invalidType="INVALID_TYPE",e.sessionNotFound="SESSION_NOT_FOUND",e.cookieError="COOKIE_ERROR",e.notAuthorized="NOT_AUTHORIZED",e.permissionRequired="PERMISSION_REQUIRED",e.deeplinkUnavailable="DEEPLINK_UNAVAILABLE",e.kycIncompleted="KYC_INCOMPLETED",e.noBankAccount="NO_BANK_ACCOUNT",e.invalidPaymentIdentifier="INVALID_PAYMENT_IDENTIFIER",e.otpSendTooShort="OTP_SEND_TOO_SHORT",e.otpSendOverLimit="OTP_SEND_OVER_LIMIT",e.userVerificationFailure="USER_VERIFICATION_FAILURE",e.unacceptableOp="UNACCEPTABLE_OP",e.kycUpdateRequired="KYC_UPDATE_REQUIRED",e.notCompleted="NOT_COMPLETED",e.kycValidationInProcess="KYC_VALIDATION_IN_PROCESS",e.storageAccessDenied="STORAGE_ACCESS_DENIED",e))(R||{});const U="ppmna-iframe",L="ppsdk-container";let b;function w(){return document.getElementById(L)}function M(){var e;return null==(e=w())?void 0:e.getElementsByTagName("iframe")[0]}function F(e){const t=w();t&&(t.style.display=e?"initial":"none")}function B(e,t,n){null==e||e.postMessage(JSON.parse(JSON.stringify(n)),D(t))}function V(e,t,n,r){(async()=>{let s=null;var c;s=e===i?await(c=b,new Promise(((e,t)=>{if(M())return void e(M());const n=document.createElement("div");document.createElement("div"),n.setAttribute("id",L),n.setAttribute("class",L),document.body.appendChild(n);const a=document.createElement("iframe");a.setAttribute("src",P(c)),a.setAttribute("name",U),a.setAttribute("id",U),a.setAttribute("allow","geolocation"),a.onload=()=>e(a),a.onerror=()=>t(),n.appendChild(a),a.style.all="initial",a.style.width="100%",a.style.height="100%",a.style.border="none",n.style.all="initial",n.style.display="none",n.style.position="fixed",n.style.width="100%",n.style.height="100%",n.style.top="0",n.style.left="0"}))):M();const d=C();F(t);const u=t=>{y(t.origin,b)&&t.data.name===e&&t.data.messageId===d&&function(e,t,n){var i,r,s;e.result===o&&(null==(i=null==t?void 0:t.fail)||i.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===l&&(null==(s=null==t?void 0:t.complete)||s.call(t),removeEventListener("message",n),F(!1))}(t.data,n,u)};addEventListener("message",u),B(null==s?void 0:s.contentWindow,b,{name:e,params:r,messageId:d})})().catch((()=>{}))}addEventListener("message",(e=>{if(y(e.origin,b))if(e.data.name===E&&window.location.reload(),e.data.name!==g){if(e.data.name===I){const t=e.data.data;"_blank"===t.target?window.open(t.url,"_blank"):window.location.href=t.url}if(e.data.name===f){const{refreshToken:t,domain:n,isSecure:a}=e.data.data;k(t,n,a)}if(e.data.name===A){const{params:t}=e.data.data;!function(e){console.debug(...e)}(t)}}else F(!0)}));!function(e){const t=window;(!t.hasOwnProperty(_)||t._PayPayJsBridge!==e)&&(t._PayPayJsBridge=e)}({_handleMessageFromNative:e=>{var t;const n=M();null==(t=null==n?void 0:n.contentWindow)||t.postMessage(JSON.parse(JSON.stringify({name:m,params:{json:e}})),D(b))}});return new Proxy({init:function(e){const a=new URL(window.location.href),o=a.searchParams.get("token"),l=a.searchParams.get("one_time_token"),r=t.get(n.refreshToken)||"";(o||l)&&function(e){e.searchParams.delete("token"),e.searchParams.delete("one_time_token"),e.search=e.searchParams.toString(),history.replaceState(null,"",e)}(a),b=e.env;const s={env:e.env,mode:e.mode,debugMode:e.debugMode,clientId:e.clientId,token:o,ott:l,refreshToken:r,clientVersion:"2.0.0-beta.2"};V(i,!1,e,s)},verifyMultiFactorAuthResult:function(e){const t=new URL(window.location.href);V(c,!1,e,{...e,sessionId:t.searchParams.get("ppSessionId")})},share:function(e){if(!(null==navigator?void 0:navigator.share))return void V(d,!1,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:R.unknown}),null==(n=null==e?void 0:e.complete)||n.call(e)}))},setTitle:function(e){var t,n;document.title=(null==e?void 0:e.title)||"",null==(t=null==e?void 0:e.success)||t.call(e),null==(n=null==e?void 0:e.complete)||n.call(e)},render:function(e){var t;const n=M();if(!(null==e?void 0:e.containerId)||!document.getElementById(null==e?void 0:e.containerId))return null==(t=null==e?void 0:e.fail)||t.call(e,{errorCode:R.badRequestInsufficientParameter}),console.error("Invalid container Id");let o=C();const l=t=>{var n,i;if(y(t.origin,b)&&t.data.name===r){const r=null==(n=t.data)?void 0:n.data,c=null==(i=t.data)?void 0:i.data;if(t.data.messageId!==o)return;t.data.result===a&&(!function(e,t){var n,a,o,l,i,r,c;const d=document.getElementById(t.containerId),u=document.createElement("button");u.className="ppmna-reset-css pp-smartButtonWrapper pp-button";const m=function(e){return"red"===e?S:N}(null==t?void 0:t.theme),v=(null==(a=null==(n=null==e?void 0:e.data)?void 0:n.cashbackInfo)?void 0:a.length)?"pp-cashback":"",E=t.isShortText?"pp-shortText":"",I=null!=(o=null==t?void 0:t.buttonSize)?o:"lg",f=null!=(l=null==t?void 0:t.theme)?l:"light",g=document.createElement("a");g.className=`pp-smartBtn pp-${f} pp-${I} pp-${O(t.type)} pp-${e.preferredLanguage} ${v} ${E}`,g.href=O(t.url);const A=document.createElement("span");A.className="pp-leftSection";const _=document.createElement("img");_.className="pp-img",_.src=m,_.alt="",A.appendChild(_);const h=document.createElement("span");h.className="pp-btnContent";const T=document.createElement("span");T.className="pp-title",T.innerText=null==(i=null==e?void 0:e.data)?void 0:i.title,h.appendChild(T),A.appendChild(h),g.append(A);const y=document.createElement("span");(null==(r=null==e?void 0:e.data)?void 0:r.cashbackInfo)&&(y.className="pp-cashbackInfo",y.innerText=null==(c=null==e?void 0:e.data)?void 0:c.cashbackInfo,h.append(y));if(e.data.avatarUrl){const t=document.createElement("img");t.className="pp-userProfile",t.src=e.data.avatarUrl,t.addEventListener("error",(function(e){var t;const n=e.target;null==(t=null==n?void 0:n.parentNode)||t.removeChild(n)})),g.append(t)}u.append(g),d&&(d.innerHTML="",d.appendChild(u),"pay"===t.type&&(null==e?void 0:e.isLoggedIn)&&u.addEventListener("click",(e=>{var n;e.preventDefault(),(null==t?void 0:t.callback)?null==(n=null==t?void 0:t.callback)||n.call(t):t.orderInfo&&V(s,!0,t,{...t.orderInfo})})));e.data.localStorageAvailable||u.addEventListener("click",(e=>{e.preventDefault();const t={clientUrl:window.location.href};return V(p,!0,{},t),!1}))}(c,e),"pay"===r.type&&(null==c?void 0:c.isJustLoggedIn)&&e.autoInvoke&&(null==c?void 0:c.isLoggedIn)&&V(s,!0,e,{...e.orderInfo})),removeEventListener("message",l)}};addEventListener("message",l),B(null==n?void 0:n.contentWindow,b,{name:r,params:e,messageId:o})},scanCode:function(e){var t;const n={...e,redirectUrlOnCancel:null!=(t=null==e?void 0:e.redirectUrlOnCancel)?t:window.location.href};V(u,!1,e,n)},copyToClipboard:function(e){var t,n,a;const o=document.createElement("textarea");o.setAttribute("readonly","true"),o.setAttribute("contenteditable","true"),o.value=e.value,document.body.appendChild(o),o.select(),o.setSelectionRange(0,o.value.length);const l=document.execCommand("copy");document.body.removeChild(o),l?null==(t=null==e?void 0:e.success)||t.call(e):null==(n=null==e?void 0:e.fail)||n.call(e,{errorCode:R.other}),null==(a=e.complete)||a.call(e)},getSessionData:function(e){var t,n;const a=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!=a?a:""}),null==(n=null==e?void 0:e.complete)||n.call(e)},setSessionData:function(e){var t,n,a;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==(a=null==e?void 0:e.complete)||a.call(e)},getStorageData:function(e){var t,n;const a=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!=a?a:""}),null==(n=null==e?void 0:e.complete)||n.call(e)},setStorageData:function(e){var t,n,a;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==(a=null==e?void 0:e.complete)||a.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=new URL(window.location.href);V(v,!1,e,{...e,url:t})}},{get(e,t){if(function(e){return h.includes(e)}(t))return Object.prototype.hasOwnProperty.call(e,t)?e[t]:e=>{V(t,!1,e,e)}}})}();
|
|
2
|
+
var pp=function(){"use strict";function e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)e[a]=n[a]}return e}var t=function t(n,a){function o(t,o,l){if("undefined"!=typeof document){"number"==typeof(l=e({},a,l)).expires&&(l.expires=new Date(Date.now()+864e5*l.expires)),l.expires&&(l.expires=l.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var i="";for(var r in l)l[r]&&(i+="; "+r,!0!==l[r]&&(i+="="+l[r].split(";")[0]));return document.cookie=t+"="+n.write(o,t)+i}}return Object.create({set:o,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var t=document.cookie?document.cookie.split("; "):[],a={},o=0;o<t.length;o++){var l=t[o].split("="),i=l.slice(1).join("=");try{var r=decodeURIComponent(l[0]);if(a[r]=n.read(i,r),e===r)break}catch(s){}}return e?a[e]:a}},remove:function(t,n){o(t,"",e({},n,{expires:-1}))},withAttributes:function(n){return t(this.converter,e({},this.attributes,n))},withConverter:function(n){return t(e({},this.converter,n),this.attributes)}},{attributes:{value:Object.freeze(a)},converter:{value:Object.freeze(n)}})}({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:"/"}),n=(e=>(e.accessToken="ppjssdk.accessToken",e.refreshToken="ppjssdk.refreshToken",e.env="ppjssdk.env",e.deviceUUID="ppjssdk.deviceUUID",e.clientUUID="ppjssdk.clientUUID",e.lastPayment="ppjssdk.lastPayment",e.lastTopup="ppjssdk.lastTopup",e.appDetail="ppjssdk.appDetail",e.appConfig="ppjssdk.appConfig",e.userInfo="ppjssdk.userInfo",e.lastPaymentMethod="ppjssdk.lastPaymentMethod",e.lastTopupPayMethod="ppjssdk.lastTopupPayMethod",e.codeVerifier="ppjssdk.codeVerifier",e.clientOrigin="ppjssdk.clientOrigin",e.clientVersion="ppjssdk.clientVersion",e.debugMode="ppjssdk.debugMode",e.merchant="ppjssdk.merchant",e))(n||{});const a="success",o="fail",l="complete",i="init",r="render",s="makePayment",c="verifyMultiFactorAuthResult",d="share",u="scanCode",p="getAuthStatus",m="handleMessageFromNative",v="getKycPassportInfo",f="reload",I="link",E="saveRefreshToken",g="saveCodeVerifier",A="makeVisible",h="consoleDebugInfo",_="_PayPayJsBridge",T=["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","checkAccessToken","debug","inputAddress","getDeviceInformation","openMiniApp","request","requestInternal","registerPaymentFeatures","initKycPassport","getKycPassportInfo","shortcutExists","addShortcut","logAppsFlyerEvent","getAllUserAddresses"];function N(e){return"https://image.paypay.ne.jp/miniapps/mini-app-sdk/"+e}const S=N("icon-paypay-rec.svg"),y=N("icon-paypay-rec-white.svg");function P(e,t,n){return e===D(t,n)}function D(e,t){return new URL(O(e,t)).origin}function O(e,t){return`${function(){switch(e){case"staging":case"sandbox":case"canary":case"qa":return"staging"===t?"https://mini-app-sdk-core.paypay.ne.jp/dev/stg/iframe.html":"https://mini-app-sdk-core.paypay.ne.jp/iframe.html";default:return"https://mini-app-sdk-core.paypay.ne.jp/iframe.html"}}()}?v=2.1.0`}function C(e){return e?String(e):""}function k(e,n){t.remove(e),t.remove(e,{domain:n})}let R=[];function U(e){R=R.filter((t=>t!==e))}function L(){const e=Math.random().toString(36).substring(7);return R.push(e),e}var b=(e=>(e.success="SUCCESS",e.invalidUrl="INVALID_URL",e.invalidData="INVALID_DATA",e.invalidHeader="INVALID_HEADER",e.invalidMethod="INVALID_METHOD",e.invalidPath="INVALID_PATH",e.notReachable="NOT_REACHABLE",e.notAvailable="NOT_AVAILABLE",e.timeOut="TIME_OUT",e.whiteListError="NONE_WHITELIST_DOMAIN",e.statusCodeError="STATUS_CODE_ERROR",e.invalidResponse="INVALID_RESPONSE",e.noLocationPermission="NO_USER_LOCATION_PERMISSION",e.noPermissionListAvailable="NO_PERMISSION_LIST_AVAILABLE",e.other="other",e.serverError="SERVER_ERROR",e.noCameraPermission="HOST_APP_CAMERA_DENIED",e.noAlbumPermission="HOST_APP_ALBUM_DENIED",e.insufficientScope="INSUFFICIENT_SCOPE",e.userCanceled="USER_CANCELED",e.invalidJSAPIParams="INVALID_JS_API_PARAMS",e.hostAppLocationDenied="HOST_APP_LOCATION_DENIED",e.hostAppContactsDenied="HOST_APP_READING_CONTACT_DENIED",e.badRequestInsufficientParameter="BAD_REQUEST_INSUFFICIENT_PARAMETER",e.badRequest="BAD_REQUEST",e.paymentFail="PAYMENT_FAIL",e.topupFail="TOPUP_FAIL",e.topupSuccessButNotAddToBalance="TOPUP_SUCCESS_BUT_NOT_ADD_TO_BALANCE",e.userCanceledSimilarTxn="USER_CANCELED_SIMILAR_TRANSACTION",e.mapAppNotFound="MAP_APP_NOT_FOUND",e.invalidAppSchemeURL="INVALID_APP_SCHEME_URL",e.noValueFound="NO_VALUE_FOUND",e.securityNotSetup="SECURITY_NOT_SETUP",e.userDenied="USER_DENIED",e.securityTemporaryLocked="SECURITY_TEMPORARY_LOCKED",e.couldNotGenerateBarcode="COULD_NOT_GENERATE_BARCODE",e.cannotDetectAvailability="CAN_NOT_DETECT_AVAILABILITY",e.suspectedDuplicatePayment="SUSPECTED_DUPLICATE_PAYMENT",e.noSufficientFund="NO_SUFFICIENT_FUND",e.unknown="UNKNOWN",e.sdkNotInitialized="SDK_NOT_INITIALIZED",e.tokenNotFound="TOKEN_NOT_FOUND",e.tokenExpired="TOKEN_EXPIRED",e.activeRequestExists="ACTIVE_REQUEST_EXISTS",e.invalidType="INVALID_TYPE",e.sessionNotFound="SESSION_NOT_FOUND",e.cookieError="COOKIE_ERROR",e.notAuthorized="NOT_AUTHORIZED",e.permissionRequired="PERMISSION_REQUIRED",e.deeplinkUnavailable="DEEPLINK_UNAVAILABLE",e.kycIncompleted="KYC_INCOMPLETED",e.noBankAccount="NO_BANK_ACCOUNT",e.invalidPaymentIdentifier="INVALID_PAYMENT_IDENTIFIER",e.otpSendTooShort="OTP_SEND_TOO_SHORT",e.otpSendOverLimit="OTP_SEND_OVER_LIMIT",e.userVerificationFailure="USER_VERIFICATION_FAILURE",e.unacceptableOp="UNACCEPTABLE_OP",e.kycUpdateRequired="KYC_UPDATE_REQUIRED",e.notCompleted="NOT_COMPLETED",e.kycValidationInProcess="KYC_VALIDATION_IN_PROCESS",e))(b||{});const w="ppmna-iframe",M="ppsdk-container";let F,V=!1,B="";function j(){return document.getElementById(M)}function x(){var e;return null==(e=j())?void 0:e.getElementsByTagName("iframe")[0]}function K(e){const t=j();t&&(t.style.display=e?"initial":"none")}function H(e,t,n){var i,r,s;e.result===o&&(null==(i=null==t?void 0:t.fail)||i.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===l&&(null==(s=null==t?void 0:t.complete)||s.call(t),removeEventListener("message",n),U(e.messageId),R.length>0||K(!1))}function J(e,t,n){null==e||e.postMessage(JSON.parse(JSON.stringify(n)),D(t))}function Y(e,t,n,a){(async()=>{let o=null;var l;o=e===i?await(l=F,new Promise(((e,t)=>{if(x())return void e(x());const n=document.createElement("div");document.createElement("div"),n.setAttribute("id",M),n.setAttribute("class",M),document.body.appendChild(n);const a=document.createElement("iframe");a.setAttribute("src",O(l,B)),a.setAttribute("name",w),a.setAttribute("id",w),a.setAttribute("allow","geolocation"),a.onload=()=>e(a),a.onerror=()=>t(),n.appendChild(a),a.style.all="initial",a.style.width="100%",a.style.height="100%",a.style.border="none",n.style.all="initial",n.style.display="none",n.style.position="fixed",n.style.width="100%",n.style.height="100%",n.style.top="0",n.style.left="0"}))):x();const r=L();K(t);const s=t=>{P(t.origin,F,B)&&t.data.name===e&&t.data.messageId===r&&H(t.data,n,s)};addEventListener("message",s),J(null==o?void 0:o.contentWindow,F,{name:e,params:a,messageId:r})})().catch((()=>{}))}addEventListener("message",(e=>{if(P(e.origin,F,B))if(e.data.name===f&&window.location.reload(),e.data.name!==A){if(e.data.name===I){const t=e.data.data;"_blank"===t.target?window.open(t.url,"_blank"):window.location.href=t.url}if(e.data.name===E){const{refreshToken:a,domain:o,isSecure:l}=e.data.data;!function(e,a,o){k(n.refreshToken,a),t.set(n.refreshToken,e,{domain:a,expires:90,secure:o})}(a,o,l)}if(e.data.name===g){const{codeVerifier:a,domain:o,isSecure:l}=e.data.data;!function(e,a,o){k(n.codeVerifier,a),t.set(n.codeVerifier,e,{domain:a,secure:o})}(a,o,l)}if(e.data.name===h){const{params:t}=e.data.data;!function(e){console.debug(...e)}(t)}}else K(!0)}));!function(e){const t=window;(!t.hasOwnProperty(_)||t._PayPayJsBridge!==e)&&(t._PayPayJsBridge=e)}({_handleMessageFromNative:e=>{var t;const n=x();null==(t=null==n?void 0:n.contentWindow)||t.postMessage(JSON.parse(JSON.stringify({name:m,params:{json:e}})),D(F))}});return new Proxy({init:function(e){B=e.coreVersion;const a=new URL(window.location.href),o=a.searchParams.get("token"),l=a.searchParams.get("one_time_token"),r=t.get(n.refreshToken)||"",s=t.get(n.codeVerifier)||"";V=!!e.useAllFunctions,(o||l)&&function(e){e.searchParams.delete("token"),e.searchParams.delete("one_time_token"),e.search=e.searchParams.toString(),history.replaceState(null,"",e)}(a),F=e.env;const c={env:e.env,mode:e.mode,debugMode:e.debugMode,clientId:e.clientId,token:o,ott:l,refreshToken:r,clientVersion:"2.1.0",codeVerifier:s};Y(i,!1,e,c)},verifyMultiFactorAuthResult:function(e){const t=new URL(window.location.href);Y(c,!1,e,{...e,sessionId:t.searchParams.get("ppSessionId")})},share:function(e){if(!(null==navigator?void 0:navigator.share))return void Y(d,!1,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:b.unknown}),null==(n=null==e?void 0:e.complete)||n.call(e)}))},setTitle:function(e){var t,n;document.title=(null==e?void 0:e.title)||"",null==(t=null==e?void 0:e.success)||t.call(e),null==(n=null==e?void 0:e.complete)||n.call(e)},render:function(e){var t;const n=x();if(!(null==e?void 0:e.containerId)||!document.getElementById(null==e?void 0:e.containerId))return null==(t=null==e?void 0:e.fail)||t.call(e,{errorCode:b.badRequestInsufficientParameter}),console.error("Invalid container Id");let o=L();const i=t=>{var n,c;if(!P(t.origin,F,B)||t.data.name!==r||t.data.messageId!==o)return;const d=null==(n=t.data)?void 0:n.data,u=null==(c=t.data)?void 0:c.data;t.data.result===a&&(!function(e,t){var n,a,o,l,i,r,c;const d=document.getElementById(t.containerId),u=document.createElement("button");u.className="ppmna-reset-css pp-smartButtonWrapper pp-button";const p=function(e){return"red"===e?y:S}(null==t?void 0:t.theme),m=(null==(a=null==(n=null==e?void 0:e.data)?void 0:n.cashbackInfo)?void 0:a.length)?"pp-cashback":"",v=t.isShortText?"pp-shortText":"",f=null!=(o=null==t?void 0:t.buttonSize)?o:"lg",I=null!=(l=null==t?void 0:t.theme)?l:"light",E=document.createElement("a");E.className=`pp-smartBtn pp-${I} pp-${f} pp-${C(t.type)} pp-${e.preferredLanguage} ${m} ${v}`,E.href=C(t.url);const g=document.createElement("span");g.className="pp-leftSection";const A=document.createElement("img");A.className="pp-img",A.src=p,A.alt="",g.appendChild(A);const h=document.createElement("span");h.className="pp-btnContent";const _=document.createElement("span");_.className="pp-title",_.innerText=null==(i=null==e?void 0:e.data)?void 0:i.title,h.appendChild(_),g.appendChild(h),E.append(g);const T=document.createElement("span");(null==(r=null==e?void 0:e.data)?void 0:r.cashbackInfo)&&(T.className="pp-cashbackInfo",T.innerText=null==(c=null==e?void 0:e.data)?void 0:c.cashbackInfo,h.append(T));if(e.data.avatarUrl){const t=document.createElement("img");t.className="pp-userProfile",t.src=e.data.avatarUrl,t.addEventListener("error",(function(e){var t;const n=e.target;null==(t=null==n?void 0:n.parentNode)||t.removeChild(n)})),E.append(t)}u.append(E),d&&(d.innerHTML="",d.appendChild(u),"pay"===t.type&&(null==e?void 0:e.isLoggedIn)&&u.addEventListener("click",(e=>{var n;e.preventDefault(),(null==t?void 0:t.callback)?null==(n=null==t?void 0:t.callback)||n.call(t):t.orderInfo&&Y(s,!0,t,{...t.orderInfo})})))}(u,e),"pay"===d.type&&(null==u?void 0:u.isJustLoggedIn)&&e.autoInvoke&&(null==u?void 0:u.isLoggedIn)&&Y(s,!0,e,{...e.orderInfo})),t.data.result===l&&(U(t.data.messageId),removeEventListener("message",i))};addEventListener("message",i),J(null==n?void 0:n.contentWindow,F,{name:r,params:e,messageId:o})},scanCode:function(e){var t;const n={...e,redirectUrlOnCancel:null!=(t=null==e?void 0:e.redirectUrlOnCancel)?t:window.location.href};Y(u,!1,e,n)},copyToClipboard:function(e){var t,n,a;const o=document.createElement("textarea");o.setAttribute("readonly","true"),o.setAttribute("contenteditable","true"),o.value=e.value,document.body.appendChild(o),o.select(),o.setSelectionRange(0,o.value.length);const l=document.execCommand("copy");document.body.removeChild(o),l?null==(t=null==e?void 0:e.success)||t.call(e):null==(n=null==e?void 0:e.fail)||n.call(e,{errorCode:b.other}),null==(a=e.complete)||a.call(e)},getSessionData:function(e){var t,n;const a=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!=a?a:""}),null==(n=null==e?void 0:e.complete)||n.call(e)},setSessionData:function(e){var t,n,a;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==(a=null==e?void 0:e.complete)||a.call(e)},getStorageData:function(e){var t,n;const a=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!=a?a:""}),null==(n=null==e?void 0:e.complete)||n.call(e)},setStorageData:function(e){var t,n,a;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==(a=null==e?void 0:e.complete)||a.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=new URL(window.location.href);Y(v,!1,e,{...e,url:t})},getAuthStatus:function(e){const t=window.location.href;Y(p,!1,e,{...e,url:t})}},{get(e,t){const n=t;if(!V&&!function(e){return T.includes(e)}(n))throw new Error(`${n} is not supported by Mini Apps JS SDK`);return Object.prototype.hasOwnProperty.call(e,t)?e[t]:e=>{Y(t,!1,e,e)}}})}();
|
|
@@ -165,7 +165,6 @@ const PPFunctionName = {
|
|
|
165
165
|
debug: "debug",
|
|
166
166
|
copyToClipboard: "copyToClipboard",
|
|
167
167
|
createOrder: "createOrder",
|
|
168
|
-
showStorageAccessPermissionAlert: "showStorageAccessPermissionAlert",
|
|
169
168
|
handleMessageFromNative: "handleMessageFromNative",
|
|
170
169
|
initKycPassport: "initKycPassport",
|
|
171
170
|
smsAuth: "smsAuth",
|
|
@@ -175,6 +174,7 @@ const PPUtilFunctionName = {
|
|
|
175
174
|
reload: "reload",
|
|
176
175
|
link: "link",
|
|
177
176
|
saveRefreshToken: "saveRefreshToken",
|
|
177
|
+
saveCodeVerifier: "saveCodeVerifier",
|
|
178
178
|
makeVisible: "makeVisible",
|
|
179
179
|
consoleDebugInfo: "consoleDebugInfo"
|
|
180
180
|
};
|
|
@@ -237,15 +237,15 @@ function url(path) {
|
|
|
237
237
|
}
|
|
238
238
|
const img_paypayRec = url("icon-paypay-rec.svg");
|
|
239
239
|
const img_paypayRecWhite = url("icon-paypay-rec-white.svg");
|
|
240
|
-
function checkIFrameOrigin(origin, env2) {
|
|
241
|
-
return origin === getIframeOrigin(env2);
|
|
240
|
+
function checkIFrameOrigin(origin, env2, coreVersion2) {
|
|
241
|
+
return origin === getIframeOrigin(env2, coreVersion2);
|
|
242
242
|
}
|
|
243
|
-
function getIframeOrigin(env2) {
|
|
244
|
-
const iframeUrl = new URL(getIframeUrl(env2));
|
|
243
|
+
function getIframeOrigin(env2, coreVersion2) {
|
|
244
|
+
const iframeUrl = new URL(getIframeUrl(env2, coreVersion2));
|
|
245
245
|
return iframeUrl.origin;
|
|
246
246
|
}
|
|
247
|
-
function getIframeUrl(env2) {
|
|
248
|
-
const version = "2.
|
|
247
|
+
function getIframeUrl(env2, coreVersion2) {
|
|
248
|
+
const version = "2.1.0";
|
|
249
249
|
return `${getUrl()}?v=${version}`;
|
|
250
250
|
function getUrl() {
|
|
251
251
|
switch (env2) {
|
|
@@ -253,7 +253,11 @@ function getIframeUrl(env2) {
|
|
|
253
253
|
case "sandbox":
|
|
254
254
|
case "canary":
|
|
255
255
|
case "qa": {
|
|
256
|
-
|
|
256
|
+
if (coreVersion2 === "staging") {
|
|
257
|
+
return "https://mini-app-sdk-core.paypay.ne.jp/dev/stg/iframe.html";
|
|
258
|
+
} else {
|
|
259
|
+
return "https://mini-app-sdk-core.paypay.ne.jp/iframe.html";
|
|
260
|
+
}
|
|
257
261
|
}
|
|
258
262
|
case "production":
|
|
259
263
|
default:
|
|
@@ -282,9 +286,19 @@ function saveRefreshToken(refreshToken, domain, isSecure) {
|
|
|
282
286
|
secure: isSecure
|
|
283
287
|
});
|
|
284
288
|
}
|
|
289
|
+
function saveCodeVerifier(codeVerifier, domain, isSecure) {
|
|
290
|
+
removeCookie(PpLocalStorageKey.codeVerifier, domain);
|
|
291
|
+
return api.set(PpLocalStorageKey.codeVerifier, codeVerifier, {
|
|
292
|
+
domain,
|
|
293
|
+
secure: isSecure
|
|
294
|
+
});
|
|
295
|
+
}
|
|
285
296
|
function getRefreshToken() {
|
|
286
297
|
return api.get(PpLocalStorageKey.refreshToken) || "";
|
|
287
298
|
}
|
|
299
|
+
function getCodeVerifier() {
|
|
300
|
+
return api.get(PpLocalStorageKey.codeVerifier) || "";
|
|
301
|
+
}
|
|
288
302
|
function exposeClientJsBridge(jsBridge) {
|
|
289
303
|
const global = window;
|
|
290
304
|
if (global.hasOwnProperty(jsBridgeNamespace) && global[jsBridgeNamespace] === jsBridge) {
|
|
@@ -299,6 +313,20 @@ function consoleDebugInfo(params) {
|
|
|
299
313
|
function isSupportedMiniapp(functionName) {
|
|
300
314
|
return miniAppSupportedFunctions.includes(functionName);
|
|
301
315
|
}
|
|
316
|
+
let runningFunctions = [];
|
|
317
|
+
function isFunctionRunning() {
|
|
318
|
+
return runningFunctions.length > 0;
|
|
319
|
+
}
|
|
320
|
+
function functionEnd(messageId) {
|
|
321
|
+
runningFunctions = runningFunctions.filter((val) => {
|
|
322
|
+
return val !== messageId;
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
function functionStart() {
|
|
326
|
+
const messageId = generateMessageId();
|
|
327
|
+
runningFunctions.push(messageId);
|
|
328
|
+
return messageId;
|
|
329
|
+
}
|
|
302
330
|
var MiniAppErrorType = /* @__PURE__ */ ((MiniAppErrorType2) => {
|
|
303
331
|
MiniAppErrorType2["success"] = "SUCCESS";
|
|
304
332
|
MiniAppErrorType2["invalidUrl"] = "INVALID_URL";
|
|
@@ -360,15 +388,16 @@ var MiniAppErrorType = /* @__PURE__ */ ((MiniAppErrorType2) => {
|
|
|
360
388
|
MiniAppErrorType2["kycUpdateRequired"] = "KYC_UPDATE_REQUIRED";
|
|
361
389
|
MiniAppErrorType2["notCompleted"] = "NOT_COMPLETED";
|
|
362
390
|
MiniAppErrorType2["kycValidationInProcess"] = "KYC_VALIDATION_IN_PROCESS";
|
|
363
|
-
MiniAppErrorType2["storageAccessDenied"] = "STORAGE_ACCESS_DENIED";
|
|
364
391
|
return MiniAppErrorType2;
|
|
365
392
|
})(MiniAppErrorType || {});
|
|
366
393
|
var style = "";
|
|
367
394
|
const frameName = "ppmna-iframe";
|
|
368
395
|
const containerName = "ppsdk-container";
|
|
369
396
|
let env;
|
|
397
|
+
let useAllFunctions = false;
|
|
398
|
+
let coreVersion = "";
|
|
370
399
|
const commonMessageHandler = (e) => {
|
|
371
|
-
if (!checkIFrameOrigin(e.origin, env)) {
|
|
400
|
+
if (!checkIFrameOrigin(e.origin, env, coreVersion)) {
|
|
372
401
|
return;
|
|
373
402
|
}
|
|
374
403
|
if (e.data.name === PPUtilFunctionName.reload) {
|
|
@@ -390,6 +419,10 @@ const commonMessageHandler = (e) => {
|
|
|
390
419
|
const { refreshToken, domain, isSecure } = e.data.data;
|
|
391
420
|
saveRefreshToken(refreshToken, domain, isSecure);
|
|
392
421
|
}
|
|
422
|
+
if (e.data.name === PPUtilFunctionName.saveCodeVerifier) {
|
|
423
|
+
const { codeVerifier, domain, isSecure } = e.data.data;
|
|
424
|
+
saveCodeVerifier(codeVerifier, domain, isSecure);
|
|
425
|
+
}
|
|
393
426
|
if (e.data.name === PPUtilFunctionName.consoleDebugInfo) {
|
|
394
427
|
const { params } = e.data.data;
|
|
395
428
|
consoleDebugInfo(params);
|
|
@@ -397,11 +430,14 @@ const commonMessageHandler = (e) => {
|
|
|
397
430
|
};
|
|
398
431
|
addEventListener("message", commonMessageHandler);
|
|
399
432
|
function init(params) {
|
|
433
|
+
coreVersion = params.coreVersion;
|
|
400
434
|
const url2 = new URL(window.location.href);
|
|
401
435
|
const token = url2.searchParams.get("token");
|
|
402
436
|
const ott = url2.searchParams.get("one_time_token");
|
|
403
437
|
const refreshToken = getRefreshToken();
|
|
404
|
-
const
|
|
438
|
+
const codeVerifier = getCodeVerifier();
|
|
439
|
+
const clientVersion = "2.1.0";
|
|
440
|
+
useAllFunctions = !!params.useAllFunctions;
|
|
405
441
|
if (token || ott) {
|
|
406
442
|
removeTokenFromUrl(url2);
|
|
407
443
|
}
|
|
@@ -414,10 +450,23 @@ function init(params) {
|
|
|
414
450
|
token,
|
|
415
451
|
ott,
|
|
416
452
|
refreshToken,
|
|
417
|
-
clientVersion
|
|
453
|
+
clientVersion,
|
|
454
|
+
codeVerifier
|
|
418
455
|
};
|
|
419
456
|
triggerPostMessageToCore(PPFunctionName.init, false, params, initParams);
|
|
420
457
|
}
|
|
458
|
+
function getAuthStatus(params) {
|
|
459
|
+
const url2 = window.location.href;
|
|
460
|
+
triggerPostMessageToCore(
|
|
461
|
+
PPFunctionName.getAuthStatus,
|
|
462
|
+
false,
|
|
463
|
+
params,
|
|
464
|
+
{
|
|
465
|
+
...params,
|
|
466
|
+
url: url2
|
|
467
|
+
}
|
|
468
|
+
);
|
|
469
|
+
}
|
|
421
470
|
function verifyMultiFactorAuthResult(params) {
|
|
422
471
|
const url2 = new URL(window.location.href);
|
|
423
472
|
triggerPostMessageToCore(
|
|
@@ -467,28 +516,24 @@ function render(params) {
|
|
|
467
516
|
});
|
|
468
517
|
return console.error("Invalid container Id");
|
|
469
518
|
}
|
|
470
|
-
let messageId =
|
|
519
|
+
let messageId = functionStart();
|
|
471
520
|
const getRenderMessageHandler = (e) => {
|
|
472
521
|
var _a2, _b;
|
|
473
|
-
if (!checkIFrameOrigin(e.origin, env)) {
|
|
522
|
+
if (!checkIFrameOrigin(e.origin, env, coreVersion) || e.data.name !== PPFunctionName.render || e.data.messageId !== messageId) {
|
|
474
523
|
return;
|
|
475
524
|
}
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
if (info.type === "pay") {
|
|
485
|
-
if ((data == null ? void 0 : data.isJustLoggedIn) && params.autoInvoke && (data == null ? void 0 : data.isLoggedIn)) {
|
|
486
|
-
triggerPostMessageToCore(PPFunctionName.makePayment, true, params, {
|
|
487
|
-
...params.orderInfo
|
|
488
|
-
});
|
|
489
|
-
}
|
|
490
|
-
}
|
|
525
|
+
const info = (_a2 = e.data) == null ? void 0 : _a2.data;
|
|
526
|
+
const data = (_b = e.data) == null ? void 0 : _b.data;
|
|
527
|
+
if (e.data.result === PPFunctionResult.success) {
|
|
528
|
+
renderButton(data, params);
|
|
529
|
+
if (info.type === "pay" && (data == null ? void 0 : data.isJustLoggedIn) && params.autoInvoke && (data == null ? void 0 : data.isLoggedIn)) {
|
|
530
|
+
triggerPostMessageToCore(PPFunctionName.makePayment, true, params, {
|
|
531
|
+
...params.orderInfo
|
|
532
|
+
});
|
|
491
533
|
}
|
|
534
|
+
}
|
|
535
|
+
if (e.data.result === PPFunctionResult.complete) {
|
|
536
|
+
functionEnd(e.data.messageId);
|
|
492
537
|
removeEventListener("message", getRenderMessageHandler);
|
|
493
538
|
}
|
|
494
539
|
};
|
|
@@ -581,7 +626,7 @@ function createIframe(env2) {
|
|
|
581
626
|
container.setAttribute("class", containerName);
|
|
582
627
|
document.body.appendChild(container);
|
|
583
628
|
const iframe = document.createElement("iframe");
|
|
584
|
-
iframe.setAttribute("src", getIframeUrl(env2));
|
|
629
|
+
iframe.setAttribute("src", getIframeUrl(env2, coreVersion));
|
|
585
630
|
iframe.setAttribute("name", frameName);
|
|
586
631
|
iframe.setAttribute("id", frameName);
|
|
587
632
|
iframe.setAttribute("allow", "geolocation");
|
|
@@ -612,7 +657,10 @@ function receiveMessageFromIframe(messageData, params, eventHandler) {
|
|
|
612
657
|
if (messageData.result === PPFunctionResult.complete) {
|
|
613
658
|
(_c = params == null ? void 0 : params.complete) == null ? void 0 : _c.call(params);
|
|
614
659
|
removeEventListener("message", eventHandler);
|
|
615
|
-
|
|
660
|
+
functionEnd(messageData.messageId);
|
|
661
|
+
if (!isFunctionRunning()) {
|
|
662
|
+
showIframe(false);
|
|
663
|
+
}
|
|
616
664
|
}
|
|
617
665
|
}
|
|
618
666
|
function postMessageToCore(target, env2, messageData) {
|
|
@@ -635,10 +683,10 @@ function triggerPostMessageToCore(type, showIframeFlag, params, postMessageParam
|
|
|
635
683
|
} else {
|
|
636
684
|
iframe = getIframe();
|
|
637
685
|
}
|
|
638
|
-
const messageId =
|
|
686
|
+
const messageId = functionStart();
|
|
639
687
|
showIframe(showIframeFlag);
|
|
640
688
|
const fnMessageHandler = (e) => {
|
|
641
|
-
if (!checkIFrameOrigin(e.origin, env)) {
|
|
689
|
+
if (!checkIFrameOrigin(e.origin, env, coreVersion)) {
|
|
642
690
|
return;
|
|
643
691
|
}
|
|
644
692
|
if (e.data.name === type) {
|
|
@@ -721,21 +769,6 @@ function renderButton(data, params) {
|
|
|
721
769
|
});
|
|
722
770
|
}
|
|
723
771
|
}
|
|
724
|
-
if (!data.data.localStorageAvailable) {
|
|
725
|
-
button.addEventListener("click", (e) => {
|
|
726
|
-
e.preventDefault();
|
|
727
|
-
const showStorageAccessPermissionAlertParam = {
|
|
728
|
-
clientUrl: window.location.href
|
|
729
|
-
};
|
|
730
|
-
triggerPostMessageToCore(
|
|
731
|
-
PPFunctionName.showStorageAccessPermissionAlert,
|
|
732
|
-
true,
|
|
733
|
-
{},
|
|
734
|
-
showStorageAccessPermissionAlertParam
|
|
735
|
-
);
|
|
736
|
-
return false;
|
|
737
|
-
});
|
|
738
|
-
}
|
|
739
772
|
}
|
|
740
773
|
const clientJsBridge = {
|
|
741
774
|
_handleMessageFromNative: (json) => {
|
|
@@ -768,14 +801,19 @@ const clientFunctions = {
|
|
|
768
801
|
getStorageData,
|
|
769
802
|
setStorageData,
|
|
770
803
|
removeStorageData,
|
|
771
|
-
getKycPassportInfo
|
|
804
|
+
getKycPassportInfo,
|
|
805
|
+
getAuthStatus
|
|
772
806
|
};
|
|
773
807
|
const proxy = new Proxy(clientFunctions, {
|
|
774
808
|
get(target, prop) {
|
|
775
809
|
const functionName = prop;
|
|
776
|
-
{
|
|
777
|
-
|
|
778
|
-
|
|
810
|
+
if (!useAllFunctions) {
|
|
811
|
+
{
|
|
812
|
+
if (!isSupportedMiniapp(functionName)) {
|
|
813
|
+
throw new Error(
|
|
814
|
+
`${functionName} is not supported by Mini Apps JS SDK`
|
|
815
|
+
);
|
|
816
|
+
}
|
|
779
817
|
}
|
|
780
818
|
}
|
|
781
819
|
if (Object.prototype.hasOwnProperty.call(target, prop)) {
|
|
@@ -2,5 +2,17 @@ import { RenderSmartButtonParams } from '../../types';
|
|
|
2
2
|
export declare function getRenderButtonInfo(params: RenderSmartButtonParams): Promise<{
|
|
3
3
|
data: import('../../types').SmartButtonParam;
|
|
4
4
|
preferredLanguage: string;
|
|
5
|
+
} | {
|
|
6
|
+
renderParams: RenderSmartButtonParams;
|
|
7
|
+
data: import('../../types').SmartButtonParam;
|
|
8
|
+
preferredLanguage: string;
|
|
9
|
+
isLoggedIn?: undefined;
|
|
10
|
+
isJustLoggedIn?: undefined;
|
|
11
|
+
} | {
|
|
12
|
+
renderParams: RenderSmartButtonParams;
|
|
13
|
+
data: import('../../types').SmartButtonParam;
|
|
14
|
+
isLoggedIn: boolean;
|
|
15
|
+
preferredLanguage: string;
|
|
16
|
+
isJustLoggedIn: boolean;
|
|
5
17
|
} | null>;
|
|
6
18
|
export declare function render(params: RenderSmartButtonParams): void;
|
|
@@ -64,6 +64,11 @@ declare type MethodBase = {
|
|
|
64
64
|
statusDescription: DescriptionInfo | null;
|
|
65
65
|
additionalDescription: DescriptionInfo | null;
|
|
66
66
|
detailDescription: DescriptionInfo | null;
|
|
67
|
+
amountInfo?: {
|
|
68
|
+
label: string;
|
|
69
|
+
amount: number;
|
|
70
|
+
currency: string;
|
|
71
|
+
};
|
|
67
72
|
};
|
|
68
73
|
};
|
|
69
74
|
export declare type DescriptionInfo = {
|
|
@@ -168,6 +173,7 @@ export declare type BankInfo = {
|
|
|
168
173
|
bankAccountType?: string;
|
|
169
174
|
bankAccountNumberLast2digits?: string;
|
|
170
175
|
preTransactionAutoChargeSupported?: boolean;
|
|
176
|
+
showAmount?: boolean;
|
|
171
177
|
};
|
|
172
178
|
export declare type BankMethod = MethodBase & {
|
|
173
179
|
paymentMethodType: PaymentMethodType.BANK | PaymentMethodType.YMONEY_BANK;
|
|
@@ -58,8 +58,7 @@ export declare enum MiniAppErrorType {
|
|
|
58
58
|
unacceptableOp = "UNACCEPTABLE_OP",
|
|
59
59
|
kycUpdateRequired = "KYC_UPDATE_REQUIRED",
|
|
60
60
|
notCompleted = "NOT_COMPLETED",
|
|
61
|
-
kycValidationInProcess = "KYC_VALIDATION_IN_PROCESS"
|
|
62
|
-
storageAccessDenied = "STORAGE_ACCESS_DENIED"
|
|
61
|
+
kycValidationInProcess = "KYC_VALIDATION_IN_PROCESS"
|
|
63
62
|
}
|
|
64
63
|
export declare class MiniAppError extends Error {
|
|
65
64
|
constructor(type: MiniAppErrorType);
|
package/dist/resources/en.d.ts
CHANGED
|
@@ -402,88 +402,6 @@ export declare const en: {
|
|
|
402
402
|
close: string;
|
|
403
403
|
};
|
|
404
404
|
};
|
|
405
|
-
showStorageAccessPermission: {
|
|
406
|
-
alert: {
|
|
407
|
-
title: string;
|
|
408
|
-
text: string;
|
|
409
|
-
button: string;
|
|
410
|
-
unknown: {
|
|
411
|
-
button: string;
|
|
412
|
-
text: string;
|
|
413
|
-
};
|
|
414
|
-
};
|
|
415
|
-
guide: {
|
|
416
|
-
ui: {
|
|
417
|
-
complete: string;
|
|
418
|
-
next: string;
|
|
419
|
-
prev: string;
|
|
420
|
-
refresh: string;
|
|
421
|
-
settingCookie: string;
|
|
422
|
-
refreshPage: string;
|
|
423
|
-
};
|
|
424
|
-
title: string;
|
|
425
|
-
complete: string;
|
|
426
|
-
desktop: {
|
|
427
|
-
chrome: {
|
|
428
|
-
text1: string;
|
|
429
|
-
text2: string;
|
|
430
|
-
text3: string;
|
|
431
|
-
text4: string;
|
|
432
|
-
};
|
|
433
|
-
safari: {
|
|
434
|
-
text1: string;
|
|
435
|
-
text2: string;
|
|
436
|
-
text3: string;
|
|
437
|
-
};
|
|
438
|
-
edge: {
|
|
439
|
-
text1: string;
|
|
440
|
-
text2: string;
|
|
441
|
-
text3: string;
|
|
442
|
-
text4: string;
|
|
443
|
-
};
|
|
444
|
-
firefox: {
|
|
445
|
-
text1: string;
|
|
446
|
-
};
|
|
447
|
-
};
|
|
448
|
-
mobile: {
|
|
449
|
-
android: {
|
|
450
|
-
edge: {
|
|
451
|
-
text1: string;
|
|
452
|
-
text2: string;
|
|
453
|
-
text3: string;
|
|
454
|
-
text4: string;
|
|
455
|
-
text5: string;
|
|
456
|
-
};
|
|
457
|
-
firefox: {
|
|
458
|
-
text1: string;
|
|
459
|
-
text2: string;
|
|
460
|
-
text3: string;
|
|
461
|
-
text4: string;
|
|
462
|
-
};
|
|
463
|
-
chrome: {
|
|
464
|
-
text1: string;
|
|
465
|
-
text2: string;
|
|
466
|
-
text3: string;
|
|
467
|
-
text4: string;
|
|
468
|
-
text5: string;
|
|
469
|
-
};
|
|
470
|
-
};
|
|
471
|
-
ios: {
|
|
472
|
-
safari: {
|
|
473
|
-
text1: string;
|
|
474
|
-
text2: string;
|
|
475
|
-
};
|
|
476
|
-
edge: {
|
|
477
|
-
text1: string;
|
|
478
|
-
text2: string;
|
|
479
|
-
text3: string;
|
|
480
|
-
text4: string;
|
|
481
|
-
text5: string;
|
|
482
|
-
};
|
|
483
|
-
};
|
|
484
|
-
};
|
|
485
|
-
};
|
|
486
|
-
};
|
|
487
405
|
};
|
|
488
406
|
getKycPassport: {
|
|
489
407
|
fallbackSmsSheet: {
|
|
@@ -48,67 +48,6 @@ export declare const img_iconTopupSuccess: string;
|
|
|
48
48
|
export declare const img_icon3DSecure: string;
|
|
49
49
|
export declare const img_iconArrowRightBlue: string;
|
|
50
50
|
export declare const img_iconInfo: string;
|
|
51
|
-
export declare const img_showStorageAccessPermission: {
|
|
52
|
-
guide: {
|
|
53
|
-
desktop: {
|
|
54
|
-
chrome: {
|
|
55
|
-
image1: string;
|
|
56
|
-
image2: string;
|
|
57
|
-
image3: string;
|
|
58
|
-
};
|
|
59
|
-
safari: {
|
|
60
|
-
image1: string;
|
|
61
|
-
image2: string;
|
|
62
|
-
};
|
|
63
|
-
edge: {
|
|
64
|
-
image1: string;
|
|
65
|
-
image2: string;
|
|
66
|
-
image3: string;
|
|
67
|
-
};
|
|
68
|
-
firefox: {
|
|
69
|
-
image1: string;
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
mobile: {
|
|
73
|
-
android: {
|
|
74
|
-
chrome: {
|
|
75
|
-
image1: string;
|
|
76
|
-
image2: string;
|
|
77
|
-
image3: string;
|
|
78
|
-
image4: string;
|
|
79
|
-
image5: string;
|
|
80
|
-
};
|
|
81
|
-
edge: {
|
|
82
|
-
image1: string;
|
|
83
|
-
image2: string;
|
|
84
|
-
image3: string;
|
|
85
|
-
image4: string;
|
|
86
|
-
image5: string;
|
|
87
|
-
};
|
|
88
|
-
firefox: {
|
|
89
|
-
image1: string;
|
|
90
|
-
image2: string;
|
|
91
|
-
image3: string;
|
|
92
|
-
image4: string;
|
|
93
|
-
image5: string;
|
|
94
|
-
};
|
|
95
|
-
};
|
|
96
|
-
ios: {
|
|
97
|
-
safari: {
|
|
98
|
-
image1: string;
|
|
99
|
-
image2: string;
|
|
100
|
-
};
|
|
101
|
-
edge: {
|
|
102
|
-
image1: string;
|
|
103
|
-
image2: string;
|
|
104
|
-
image3: string;
|
|
105
|
-
image4: string;
|
|
106
|
-
image5: string;
|
|
107
|
-
};
|
|
108
|
-
};
|
|
109
|
-
};
|
|
110
|
-
};
|
|
111
|
-
};
|
|
112
51
|
export declare const img_paypayMulti: string;
|
|
113
52
|
export declare const img_mobileIcon: string;
|
|
114
53
|
export declare const img_exclaimIcon: string;
|
package/dist/resources/ja.d.ts
CHANGED
|
@@ -422,88 +422,6 @@ export declare const ja: {
|
|
|
422
422
|
};
|
|
423
423
|
};
|
|
424
424
|
};
|
|
425
|
-
showStorageAccessPermission: {
|
|
426
|
-
alert: {
|
|
427
|
-
title: string;
|
|
428
|
-
text: string;
|
|
429
|
-
button: string;
|
|
430
|
-
unknown: {
|
|
431
|
-
button: string;
|
|
432
|
-
text: string;
|
|
433
|
-
};
|
|
434
|
-
};
|
|
435
|
-
guide: {
|
|
436
|
-
ui: {
|
|
437
|
-
complete: string;
|
|
438
|
-
next: string;
|
|
439
|
-
prev: string;
|
|
440
|
-
refresh: string;
|
|
441
|
-
settingCookie: string;
|
|
442
|
-
refreshPage: string;
|
|
443
|
-
};
|
|
444
|
-
title: string;
|
|
445
|
-
complete: string;
|
|
446
|
-
desktop: {
|
|
447
|
-
chrome: {
|
|
448
|
-
text1: string;
|
|
449
|
-
text2: string;
|
|
450
|
-
text3: string;
|
|
451
|
-
text4: string;
|
|
452
|
-
};
|
|
453
|
-
safari: {
|
|
454
|
-
text1: string;
|
|
455
|
-
text2: string;
|
|
456
|
-
text3: string;
|
|
457
|
-
};
|
|
458
|
-
edge: {
|
|
459
|
-
text1: string;
|
|
460
|
-
text2: string;
|
|
461
|
-
text3: string;
|
|
462
|
-
text4: string;
|
|
463
|
-
};
|
|
464
|
-
firefox: {
|
|
465
|
-
text1: string;
|
|
466
|
-
};
|
|
467
|
-
};
|
|
468
|
-
mobile: {
|
|
469
|
-
android: {
|
|
470
|
-
edge: {
|
|
471
|
-
text1: string;
|
|
472
|
-
text2: string;
|
|
473
|
-
text3: string;
|
|
474
|
-
text4: string;
|
|
475
|
-
text5: string;
|
|
476
|
-
};
|
|
477
|
-
firefox: {
|
|
478
|
-
text1: string;
|
|
479
|
-
text2: string;
|
|
480
|
-
text3: string;
|
|
481
|
-
text4: string;
|
|
482
|
-
};
|
|
483
|
-
chrome: {
|
|
484
|
-
text1: string;
|
|
485
|
-
text2: string;
|
|
486
|
-
text3: string;
|
|
487
|
-
text4: string;
|
|
488
|
-
text5: string;
|
|
489
|
-
};
|
|
490
|
-
};
|
|
491
|
-
ios: {
|
|
492
|
-
safari: {
|
|
493
|
-
text1: string;
|
|
494
|
-
text2: string;
|
|
495
|
-
};
|
|
496
|
-
edge: {
|
|
497
|
-
text1: string;
|
|
498
|
-
text2: string;
|
|
499
|
-
text3: string;
|
|
500
|
-
text4: string;
|
|
501
|
-
text5: string;
|
|
502
|
-
};
|
|
503
|
-
};
|
|
504
|
-
};
|
|
505
|
-
};
|
|
506
|
-
};
|
|
507
425
|
getKycPassport: {
|
|
508
426
|
fallbackSmsSheet: {
|
|
509
427
|
title: string;
|
package/dist/types.d.ts
CHANGED
|
@@ -51,6 +51,8 @@ export interface InitClientParams extends NativeParams<MiniAppResult> {
|
|
|
51
51
|
env?: string;
|
|
52
52
|
mode?: string;
|
|
53
53
|
debugMode?: boolean;
|
|
54
|
+
useAllFunctions?: boolean;
|
|
55
|
+
coreVersion?: string;
|
|
54
56
|
}
|
|
55
57
|
export interface InitParams extends NativeParams<MiniAppResult> {
|
|
56
58
|
clientId?: string;
|
|
@@ -60,8 +62,10 @@ export interface InitParams extends NativeParams<MiniAppResult> {
|
|
|
60
62
|
ott?: string;
|
|
61
63
|
clientOrigin?: string;
|
|
62
64
|
refreshToken?: string;
|
|
65
|
+
codeVerifier?: string;
|
|
63
66
|
clientVersion?: string;
|
|
64
67
|
debugMode?: boolean;
|
|
68
|
+
useAllFunctions?: boolean;
|
|
65
69
|
}
|
|
66
70
|
export interface IosMapParams {
|
|
67
71
|
label: string;
|
|
@@ -309,7 +313,6 @@ export interface SmartButtonParam {
|
|
|
309
313
|
title: string;
|
|
310
314
|
avatarUrl?: string;
|
|
311
315
|
cashbackInfo?: string;
|
|
312
|
-
localStorageAvailable?: boolean;
|
|
313
316
|
}
|
|
314
317
|
declare type SmartPayCurrency = 'JPY';
|
|
315
318
|
interface SmartPayAmount {
|
|
@@ -488,8 +491,12 @@ interface AuthStatusFailResult extends MiniAppErrorResultType {
|
|
|
488
491
|
} | null;
|
|
489
492
|
}
|
|
490
493
|
export declare type ResultErrorType = MiniAppErrorResultType | AuthStatusFailResult;
|
|
494
|
+
export interface GetAuthStatusClientParams extends NativeParams<MiniAppResult, AuthStatusFailResult> {
|
|
495
|
+
isInternal?: boolean;
|
|
496
|
+
}
|
|
491
497
|
export interface GetAuthStatusParams extends NativeParams<MiniAppResult, AuthStatusFailResult> {
|
|
492
498
|
isInternal?: boolean;
|
|
499
|
+
url?: string;
|
|
493
500
|
}
|
|
494
501
|
export declare type ErrorSheetButton = {
|
|
495
502
|
title: string;
|
|
@@ -626,7 +633,6 @@ export declare const PPFunctionName: {
|
|
|
626
633
|
readonly debug: "debug";
|
|
627
634
|
readonly copyToClipboard: "copyToClipboard";
|
|
628
635
|
readonly createOrder: "createOrder";
|
|
629
|
-
readonly showStorageAccessPermissionAlert: "showStorageAccessPermissionAlert";
|
|
630
636
|
readonly handleMessageFromNative: "handleMessageFromNative";
|
|
631
637
|
readonly initKycPassport: "initKycPassport";
|
|
632
638
|
readonly smsAuth: "smsAuth";
|
|
@@ -637,6 +643,7 @@ export declare const PPUtilFunctionName: {
|
|
|
637
643
|
readonly reload: "reload";
|
|
638
644
|
readonly link: "link";
|
|
639
645
|
readonly saveRefreshToken: "saveRefreshToken";
|
|
646
|
+
readonly saveCodeVerifier: "saveCodeVerifier";
|
|
640
647
|
readonly makeVisible: "makeVisible";
|
|
641
648
|
readonly consoleDebugInfo: "consoleDebugInfo";
|
|
642
649
|
};
|
|
@@ -646,6 +653,11 @@ export declare type SaveRefreshTokenOption = {
|
|
|
646
653
|
domain: string;
|
|
647
654
|
isSecure: boolean;
|
|
648
655
|
};
|
|
656
|
+
export declare type SaveCodeVerifierOption = {
|
|
657
|
+
codeVerifier: string;
|
|
658
|
+
domain: string;
|
|
659
|
+
isSecure: boolean;
|
|
660
|
+
};
|
|
649
661
|
export declare type ClientJsBridge = {
|
|
650
662
|
_handleMessageFromNative: (json: NativeResponse) => void;
|
|
651
663
|
};
|
package/dist/utils/fetch.d.ts
CHANGED
|
@@ -68,5 +68,5 @@ export declare type PPFetchResult<T, E = Record<string, unknown>> = {
|
|
|
68
68
|
body?: null;
|
|
69
69
|
};
|
|
70
70
|
export declare function ppFetch2<T, E = Record<string, unknown>>(options: PPFetchOptions): Promise<PPFetchResult<T, E>>;
|
|
71
|
-
export declare function fetchRefreshToken(refreshToken?: string): Promise<boolean>;
|
|
71
|
+
export declare function fetchRefreshToken(refreshToken?: string, clientOrigin?: string): Promise<boolean>;
|
|
72
72
|
export { createHeaderMiniAppApi };
|
|
@@ -422,88 +422,6 @@ export declare function getLanguage(): {
|
|
|
422
422
|
};
|
|
423
423
|
};
|
|
424
424
|
};
|
|
425
|
-
showStorageAccessPermission: {
|
|
426
|
-
alert: {
|
|
427
|
-
title: string;
|
|
428
|
-
text: string;
|
|
429
|
-
button: string;
|
|
430
|
-
unknown: {
|
|
431
|
-
button: string;
|
|
432
|
-
text: string;
|
|
433
|
-
};
|
|
434
|
-
};
|
|
435
|
-
guide: {
|
|
436
|
-
ui: {
|
|
437
|
-
complete: string;
|
|
438
|
-
next: string;
|
|
439
|
-
prev: string;
|
|
440
|
-
refresh: string;
|
|
441
|
-
settingCookie: string;
|
|
442
|
-
refreshPage: string;
|
|
443
|
-
};
|
|
444
|
-
title: string;
|
|
445
|
-
complete: string;
|
|
446
|
-
desktop: {
|
|
447
|
-
chrome: {
|
|
448
|
-
text1: string;
|
|
449
|
-
text2: string;
|
|
450
|
-
text3: string;
|
|
451
|
-
text4: string;
|
|
452
|
-
};
|
|
453
|
-
safari: {
|
|
454
|
-
text1: string;
|
|
455
|
-
text2: string;
|
|
456
|
-
text3: string;
|
|
457
|
-
};
|
|
458
|
-
edge: {
|
|
459
|
-
text1: string;
|
|
460
|
-
text2: string;
|
|
461
|
-
text3: string;
|
|
462
|
-
text4: string;
|
|
463
|
-
};
|
|
464
|
-
firefox: {
|
|
465
|
-
text1: string;
|
|
466
|
-
};
|
|
467
|
-
};
|
|
468
|
-
mobile: {
|
|
469
|
-
android: {
|
|
470
|
-
edge: {
|
|
471
|
-
text1: string;
|
|
472
|
-
text2: string;
|
|
473
|
-
text3: string;
|
|
474
|
-
text4: string;
|
|
475
|
-
text5: string;
|
|
476
|
-
};
|
|
477
|
-
firefox: {
|
|
478
|
-
text1: string;
|
|
479
|
-
text2: string;
|
|
480
|
-
text3: string;
|
|
481
|
-
text4: string;
|
|
482
|
-
};
|
|
483
|
-
chrome: {
|
|
484
|
-
text1: string;
|
|
485
|
-
text2: string;
|
|
486
|
-
text3: string;
|
|
487
|
-
text4: string;
|
|
488
|
-
text5: string;
|
|
489
|
-
};
|
|
490
|
-
};
|
|
491
|
-
ios: {
|
|
492
|
-
safari: {
|
|
493
|
-
text1: string;
|
|
494
|
-
text2: string;
|
|
495
|
-
};
|
|
496
|
-
edge: {
|
|
497
|
-
text1: string;
|
|
498
|
-
text2: string;
|
|
499
|
-
text3: string;
|
|
500
|
-
text4: string;
|
|
501
|
-
text5: string;
|
|
502
|
-
};
|
|
503
|
-
};
|
|
504
|
-
};
|
|
505
|
-
};
|
|
506
|
-
};
|
|
507
425
|
getKycPassport: {
|
|
508
426
|
fallbackSmsSheet: {
|
|
509
427
|
title: string;
|
package/dist/utils/storage.d.ts
CHANGED
|
@@ -27,12 +27,9 @@ export declare function getClientId(): string | null;
|
|
|
27
27
|
export declare function saveClientId(id: string): void;
|
|
28
28
|
export declare function getUserInfo(): string | null;
|
|
29
29
|
export declare function saveUserInfo(userData: string): void;
|
|
30
|
-
export declare function getCodeVerifier(): string | null;
|
|
31
|
-
export declare function saveCodeVerifier(codeVerifier: string): void;
|
|
32
30
|
export declare function removeCodeVerifier(): void;
|
|
33
31
|
export declare function saveClientOrigin(origin: string): void;
|
|
34
32
|
export declare function getClientOrigin(): string;
|
|
35
|
-
export declare function isEnableLocalStorage(): boolean;
|
|
36
33
|
export declare function saveClientVersion(clientVersion: string): void;
|
|
37
34
|
export declare function getClientVersion(): string;
|
|
38
35
|
export declare function saveDebugMode(isDebugMode: boolean): void;
|
package/package.json
CHANGED