@paypay/mini-app-js-sdk 1.49.0 → 1.50.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/mini-app-api.d.ts +2 -1
- package/dist/mini-app-js-sdk.browser.js +1 -1
- package/dist/mini-app-js-sdk.es.js +155 -83
- package/dist/model/bridge/getCashbackInformation.d.ts +2 -0
- package/dist/model/miniAppError.d.ts +2 -1
- package/dist/model/permission.d.ts +1 -0
- package/dist/types.d.ts +4 -0
- package/package.json +1 -1
|
@@ -85,8 +85,8 @@ function normalizeNativeResponseData(data2) {
|
|
|
85
85
|
}
|
|
86
86
|
class JsBridge {
|
|
87
87
|
constructor(global2) {
|
|
88
|
-
this.version = "1.
|
|
89
|
-
this.revision = "
|
|
88
|
+
this.version = "1.50.0";
|
|
89
|
+
this.revision = "d2542c6";
|
|
90
90
|
this.messageHandlers = new Map();
|
|
91
91
|
this.responseCallbacks = new Map();
|
|
92
92
|
this.global = global2;
|
|
@@ -214,6 +214,7 @@ var MiniAppErrorType;
|
|
|
214
214
|
MiniAppErrorType2["deeplinkUnavailable"] = "DEEPLINK_UNAVAILABLE";
|
|
215
215
|
MiniAppErrorType2["kycIncompleted"] = "KYC_INCOMPLETED";
|
|
216
216
|
MiniAppErrorType2["noBankAccount"] = "NO_BANK_ACCOUNT";
|
|
217
|
+
MiniAppErrorType2["invalidPaymentIdentifier"] = "INVALID_PAYMENT_IDENTIFIER";
|
|
217
218
|
})(MiniAppErrorType || (MiniAppErrorType = {}));
|
|
218
219
|
class PayPayJsBridgeBase {
|
|
219
220
|
constructor(jsBridge2) {
|
|
@@ -1956,7 +1957,7 @@ const opaUrl = () => {
|
|
|
1956
1957
|
const createHeaderMiniAppApi = (urlEndpoint, customHeaders) => {
|
|
1957
1958
|
let headers = new Headers(__spreadValues({
|
|
1958
1959
|
"Content-Type": "application/json",
|
|
1959
|
-
"Client-Version": "1.
|
|
1960
|
+
"Client-Version": "1.50.0",
|
|
1960
1961
|
"Client-OS-Type": getRuntime()
|
|
1961
1962
|
}, customHeaders));
|
|
1962
1963
|
if (urlEndpoint === "web-api/app/v2/payment/methods" || urlEndpoint === "web-api/app/v2/payment/consult" || urlEndpoint === "web-api/app/v1/payment/cashbackDetail" || urlEndpoint === "web-api/app/v1/confirmAgeForCashback" || urlEndpoint === "web-api/app/v1/internal/request" || urlEndpoint === "web-api/app/v1/addressbyzip" || urlEndpoint === "/web-api/app/platform/v1/balance" || urlEndpoint === "web-api/app/v1/users/autoTopupConfiguration" || urlEndpoint === "web-api/app/v1/users/preTransactionAutoTopupConfiguration") {
|
|
@@ -2149,10 +2150,10 @@ var MiniAppStatusType;
|
|
|
2149
2150
|
})(MiniAppStatusType || (MiniAppStatusType = {}));
|
|
2150
2151
|
function getUAID(params) {
|
|
2151
2152
|
const newParams = reconstructParams(params);
|
|
2152
|
-
execute$
|
|
2153
|
+
execute$g(newParams).catch(() => {
|
|
2153
2154
|
});
|
|
2154
2155
|
}
|
|
2155
|
-
async function execute$
|
|
2156
|
+
async function execute$g(params) {
|
|
2156
2157
|
var _a, _b, _c, _d, _e;
|
|
2157
2158
|
const res = await ppFetch2({
|
|
2158
2159
|
method: "GET",
|
|
@@ -2166,9 +2167,9 @@ async function execute$f(params) {
|
|
|
2166
2167
|
}
|
|
2167
2168
|
function checkAccessToken(params) {
|
|
2168
2169
|
const newParams = reconstructParams(params);
|
|
2169
|
-
execute$
|
|
2170
|
+
execute$f(newParams);
|
|
2170
2171
|
}
|
|
2171
|
-
function execute$
|
|
2172
|
+
function execute$f(params) {
|
|
2172
2173
|
var _a, _b;
|
|
2173
2174
|
const clientId = getClientId();
|
|
2174
2175
|
const token = getAccessToken();
|
|
@@ -2193,9 +2194,9 @@ function execute$e(params) {
|
|
|
2193
2194
|
}
|
|
2194
2195
|
async function getUserProfile(params) {
|
|
2195
2196
|
const newParams = reconstructParams(params);
|
|
2196
|
-
await execute$
|
|
2197
|
+
await execute$e(newParams);
|
|
2197
2198
|
}
|
|
2198
|
-
async function execute$
|
|
2199
|
+
async function execute$e(params) {
|
|
2199
2200
|
var _a, _b;
|
|
2200
2201
|
const res = await ppFetch2({
|
|
2201
2202
|
method: "GET",
|
|
@@ -7671,9 +7672,9 @@ const OTTLoginState = reactive({
|
|
|
7671
7672
|
});
|
|
7672
7673
|
async function init(params) {
|
|
7673
7674
|
const newParams = reconstructParams(params);
|
|
7674
|
-
await execute$
|
|
7675
|
+
await execute$d(newParams);
|
|
7675
7676
|
}
|
|
7676
|
-
async function execute$
|
|
7677
|
+
async function execute$d(params) {
|
|
7677
7678
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
|
7678
7679
|
try {
|
|
7679
7680
|
saveEnv((_a = params == null ? void 0 : params.env) != null ? _a : "");
|
|
@@ -8926,36 +8927,49 @@ const PermissionName = {
|
|
|
8926
8927
|
mini_app_user_address: "mini_app_user_address",
|
|
8927
8928
|
mini_app_user_phone_camera: "mini_app_user_phone_camera",
|
|
8928
8929
|
mini_app_user_phone_album: "mini_app_user_phone_album",
|
|
8929
|
-
mini_app_bank_information: "mini_app_bank_information"
|
|
8930
|
+
mini_app_bank_information: "mini_app_bank_information",
|
|
8931
|
+
mini_app_cashback_information: "mini_app_cashback_information"
|
|
8930
8932
|
};
|
|
8931
8933
|
const checkPermission = async (permissionNames) => {
|
|
8932
8934
|
var _a;
|
|
8933
|
-
|
|
8934
|
-
|
|
8935
|
-
|
|
8936
|
-
|
|
8937
|
-
|
|
8938
|
-
|
|
8939
|
-
|
|
8940
|
-
|
|
8935
|
+
try {
|
|
8936
|
+
if ((_a = getAppDetail()) == null ? void 0 : _a.isInternal) {
|
|
8937
|
+
return PermissionStatus.granted;
|
|
8938
|
+
}
|
|
8939
|
+
const resPermission = await getUserGrantedPermission();
|
|
8940
|
+
permissionNames = Array.isArray(permissionNames) ? permissionNames : [permissionNames];
|
|
8941
|
+
for (const permissionName of permissionNames) {
|
|
8942
|
+
if (!(resPermission == null ? void 0 : resPermission.find((name2) => name2 === permissionName))) {
|
|
8943
|
+
return PermissionStatus.denied;
|
|
8944
|
+
}
|
|
8941
8945
|
}
|
|
8946
|
+
return PermissionStatus.granted;
|
|
8947
|
+
} catch {
|
|
8948
|
+
throw Error(MiniAppErrorType.serverError);
|
|
8942
8949
|
}
|
|
8943
|
-
return PermissionStatus.granted;
|
|
8944
8950
|
};
|
|
8945
8951
|
async function getUserGrantedPermission() {
|
|
8946
8952
|
var _a, _b, _c, _d;
|
|
8947
|
-
|
|
8948
|
-
|
|
8949
|
-
|
|
8950
|
-
|
|
8951
|
-
|
|
8953
|
+
try {
|
|
8954
|
+
const response = await ppFetch2({
|
|
8955
|
+
method: "GET",
|
|
8956
|
+
url: "web-api/app/v1/users/permissions/granted"
|
|
8957
|
+
});
|
|
8958
|
+
if ((response == null ? void 0 : response.ppFetchResult) !== "success") {
|
|
8959
|
+
throw Error(MiniAppErrorType.serverError);
|
|
8960
|
+
} else {
|
|
8961
|
+
return (_d = (_c = (_b = (_a = response == null ? void 0 : response.body) == null ? void 0 : _a.unsigned) == null ? void 0 : _b.data) == null ? void 0 : _c.scopes) != null ? _d : [];
|
|
8962
|
+
}
|
|
8963
|
+
} catch {
|
|
8964
|
+
throw Error(MiniAppErrorType.serverError);
|
|
8965
|
+
}
|
|
8952
8966
|
}
|
|
8953
8967
|
async function getBalance(params) {
|
|
8954
8968
|
const newParams = reconstructParams(params);
|
|
8955
|
-
await execute$
|
|
8969
|
+
await execute$c(newParams);
|
|
8956
8970
|
}
|
|
8957
|
-
async function execute$
|
|
8958
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
8971
|
+
async function execute$c(params) {
|
|
8972
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
8959
8973
|
try {
|
|
8960
8974
|
const grantStatus = await checkPermission(PermissionName.mini_app_payment_balance);
|
|
8961
8975
|
if (grantStatus !== PermissionStatus.granted) {
|
|
@@ -8976,13 +8990,15 @@ async function execute$b(params) {
|
|
|
8976
8990
|
const newBalance = (_f = (_e = (_d = (_c = res == null ? void 0 : res.body) == null ? void 0 : _c.unsigned) == null ? void 0 : _d.data) == null ? void 0 : _e.totalBalance) == null ? void 0 : _f.amount;
|
|
8977
8991
|
return (_g = params == null ? void 0 : params.success) == null ? void 0 : _g.call(params, { balance: newBalance });
|
|
8978
8992
|
}
|
|
8993
|
+
} catch {
|
|
8994
|
+
return (_h = params == null ? void 0 : params.fail) == null ? void 0 : _h.call(params, { errorCode: MiniAppErrorType.serverError });
|
|
8979
8995
|
} finally {
|
|
8980
8996
|
}
|
|
8981
|
-
return (
|
|
8997
|
+
return (_i = params == null ? void 0 : params.fail) == null ? void 0 : _i.call(params, { errorCode: MiniAppErrorType.serverError });
|
|
8982
8998
|
}
|
|
8983
8999
|
async function getAuthStatus(params) {
|
|
8984
9000
|
const newParams = reconstructParams(params);
|
|
8985
|
-
await execute$
|
|
9001
|
+
await execute$b(newParams);
|
|
8986
9002
|
}
|
|
8987
9003
|
async function handlePKCE() {
|
|
8988
9004
|
const codeVerifier = generateCodeVerifier();
|
|
@@ -9004,7 +9020,7 @@ async function handleFailCallback(params, errorCode) {
|
|
|
9004
9020
|
code
|
|
9005
9021
|
});
|
|
9006
9022
|
}
|
|
9007
|
-
async function execute$
|
|
9023
|
+
async function execute$b(params) {
|
|
9008
9024
|
var _a, _b, _c, _d, _e, _f;
|
|
9009
9025
|
try {
|
|
9010
9026
|
const clientId = getClientId();
|
|
@@ -32850,7 +32866,7 @@ function createWrapComplete(fn) {
|
|
|
32850
32866
|
};
|
|
32851
32867
|
}
|
|
32852
32868
|
const makePayment = async (params) => {
|
|
32853
|
-
var _a, _b, _c, _d, _e, _f;
|
|
32869
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
32854
32870
|
if ((params == null ? void 0 : params.alwaysDisplayCompletionScreen) && (params == null ? void 0 : params.alwaysHideCompletionScreen)) {
|
|
32855
32871
|
(_a = params == null ? void 0 : params.fail) == null ? void 0 : _a.call(params, {
|
|
32856
32872
|
errorCode: MiniAppErrorType.badRequest
|
|
@@ -32858,12 +32874,19 @@ const makePayment = async (params) => {
|
|
|
32858
32874
|
return (_b = params == null ? void 0 : params.complete) == null ? void 0 : _b.call(params);
|
|
32859
32875
|
}
|
|
32860
32876
|
if ((_d = (_c = params == null ? void 0 : params.additionalUserInfo) == null ? void 0 : _c.userAddress) == null ? void 0 : _d.visible) {
|
|
32861
|
-
|
|
32862
|
-
|
|
32863
|
-
(
|
|
32864
|
-
|
|
32877
|
+
try {
|
|
32878
|
+
const grantStatus = await checkPermission(PermissionName.mini_app_user_address);
|
|
32879
|
+
if (grantStatus !== PermissionStatus.granted) {
|
|
32880
|
+
(_e = params == null ? void 0 : params.fail) == null ? void 0 : _e.call(params, {
|
|
32881
|
+
errorCode: MiniAppErrorType.insufficientScope
|
|
32882
|
+
});
|
|
32883
|
+
return (_f = params == null ? void 0 : params.complete) == null ? void 0 : _f.call(params);
|
|
32884
|
+
}
|
|
32885
|
+
} catch {
|
|
32886
|
+
(_g = params == null ? void 0 : params.fail) == null ? void 0 : _g.call(params, {
|
|
32887
|
+
errorCode: MiniAppErrorType.serverError
|
|
32865
32888
|
});
|
|
32866
|
-
return (
|
|
32889
|
+
return (_h = params == null ? void 0 : params.complete) == null ? void 0 : _h.call(params);
|
|
32867
32890
|
}
|
|
32868
32891
|
}
|
|
32869
32892
|
const success2 = params.success;
|
|
@@ -34194,17 +34217,14 @@ function removeStorageData(params) {
|
|
|
34194
34217
|
}
|
|
34195
34218
|
async function getPermissionStatus(params) {
|
|
34196
34219
|
const newParams = reconstructParams(params);
|
|
34197
|
-
await execute$
|
|
34220
|
+
await execute$a(newParams);
|
|
34198
34221
|
}
|
|
34199
|
-
async function execute$
|
|
34200
|
-
var _a, _b, _c
|
|
34222
|
+
async function execute$a(params) {
|
|
34223
|
+
var _a, _b, _c;
|
|
34201
34224
|
try {
|
|
34202
34225
|
const permissionList = await getUserGrantedPermission();
|
|
34203
|
-
if (!permissionList) {
|
|
34204
|
-
return (_a = params == null ? void 0 : params.fail) == null ? void 0 : _a.call(params, { errorCode: MiniAppErrorType.serverError });
|
|
34205
|
-
}
|
|
34206
34226
|
if (!(params == null ? void 0 : params.name)) {
|
|
34207
|
-
return (
|
|
34227
|
+
return (_a = params == null ? void 0 : params.success) == null ? void 0 : _a.call(params, {
|
|
34208
34228
|
granted_permissions: permissionList
|
|
34209
34229
|
});
|
|
34210
34230
|
} else {
|
|
@@ -34212,10 +34232,10 @@ async function execute$9(params) {
|
|
|
34212
34232
|
return name2 === (params == null ? void 0 : params.name);
|
|
34213
34233
|
});
|
|
34214
34234
|
const status2 = thePermission ? PermissionStatus.granted : PermissionStatus.denied;
|
|
34215
|
-
return (
|
|
34235
|
+
return (_b = params == null ? void 0 : params.success) == null ? void 0 : _b.call(params, { status: status2 });
|
|
34216
34236
|
}
|
|
34217
34237
|
} catch (_) {
|
|
34218
|
-
return (
|
|
34238
|
+
return (_c = params == null ? void 0 : params.fail) == null ? void 0 : _c.call(params, { errorCode: MiniAppErrorType.serverError });
|
|
34219
34239
|
}
|
|
34220
34240
|
}
|
|
34221
34241
|
function scanCode(_params) {
|
|
@@ -34625,9 +34645,9 @@ function showUpdateWarning$1(params) {
|
|
|
34625
34645
|
}
|
|
34626
34646
|
async function getPlatformInformation(params) {
|
|
34627
34647
|
const newParams = reconstructParams(params);
|
|
34628
|
-
await execute$
|
|
34648
|
+
await execute$9(newParams);
|
|
34629
34649
|
}
|
|
34630
|
-
async function execute$
|
|
34650
|
+
async function execute$9(params) {
|
|
34631
34651
|
var _a, _b;
|
|
34632
34652
|
let sdkVersion = null;
|
|
34633
34653
|
let preferredLanguage = getPayPayLanguage();
|
|
@@ -34656,9 +34676,9 @@ async function execute$8(params) {
|
|
|
34656
34676
|
}
|
|
34657
34677
|
function getDeviceInformation(params) {
|
|
34658
34678
|
const newParams = reconstructParams(params);
|
|
34659
|
-
execute$
|
|
34679
|
+
execute$8(newParams);
|
|
34660
34680
|
}
|
|
34661
|
-
function execute$
|
|
34681
|
+
function execute$8(params) {
|
|
34662
34682
|
var _a;
|
|
34663
34683
|
const runtime = getRuntime();
|
|
34664
34684
|
(_a = params == null ? void 0 : params.success) == null ? void 0 : _a.call(params, {
|
|
@@ -34860,9 +34880,9 @@ async function share(shareParams) {
|
|
|
34860
34880
|
}
|
|
34861
34881
|
async function getKycInformation(params) {
|
|
34862
34882
|
const newParams = reconstructParams(params);
|
|
34863
|
-
await execute$
|
|
34883
|
+
await execute$7(newParams);
|
|
34864
34884
|
}
|
|
34865
|
-
async function execute$
|
|
34885
|
+
async function execute$7(params) {
|
|
34866
34886
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
34867
34887
|
try {
|
|
34868
34888
|
const grantStatus = await checkPermission(PermissionName.mini_app_kyc);
|
|
@@ -34892,18 +34912,24 @@ async function execute$6(params) {
|
|
|
34892
34912
|
}
|
|
34893
34913
|
}
|
|
34894
34914
|
const initGetUserAddress = async (params) => {
|
|
34895
|
-
var _a, _b;
|
|
34896
|
-
|
|
34897
|
-
|
|
34898
|
-
|
|
34899
|
-
|
|
34915
|
+
var _a, _b, _c;
|
|
34916
|
+
try {
|
|
34917
|
+
const grantStatus = await checkPermission(PermissionName.mini_app_user_address);
|
|
34918
|
+
if (grantStatus !== PermissionStatus.granted) {
|
|
34919
|
+
return (_a = params == null ? void 0 : params.fail) == null ? void 0 : _a.call(params, {
|
|
34920
|
+
errorCode: MiniAppErrorType.insufficientScope
|
|
34921
|
+
});
|
|
34922
|
+
}
|
|
34923
|
+
} catch {
|
|
34924
|
+
return (_b = params == null ? void 0 : params.fail) == null ? void 0 : _b.call(params, {
|
|
34925
|
+
errorCode: MiniAppErrorType.serverError
|
|
34900
34926
|
});
|
|
34901
34927
|
}
|
|
34902
34928
|
const container2 = document.createElement("div");
|
|
34903
34929
|
container2.className = "ppmna-reset-css";
|
|
34904
34930
|
const res = await getAddressList();
|
|
34905
34931
|
if ((res == null ? void 0 : res.ppFetchResult) !== "success") {
|
|
34906
|
-
(
|
|
34932
|
+
(_c = params == null ? void 0 : params.fail) == null ? void 0 : _c.call(params, {
|
|
34907
34933
|
errorCode: getFailErrorCode(res == null ? void 0 : res.ppFetchResult)
|
|
34908
34934
|
});
|
|
34909
34935
|
return;
|
|
@@ -34928,12 +34954,12 @@ const initGetUserAddress = async (params) => {
|
|
|
34928
34954
|
}
|
|
34929
34955
|
}, popStateHandler(closeSheet, params)), {
|
|
34930
34956
|
render() {
|
|
34931
|
-
var _a2, _b2,
|
|
34957
|
+
var _a2, _b2, _c2;
|
|
34932
34958
|
return h(AppVue$7, {
|
|
34933
34959
|
show: this.show,
|
|
34934
34960
|
onClick: this.close,
|
|
34935
34961
|
getUserAddressParams: params,
|
|
34936
|
-
addresses: (
|
|
34962
|
+
addresses: (_c2 = (_b2 = (_a2 = res == null ? void 0 : res.body) == null ? void 0 : _a2.unsigned) == null ? void 0 : _b2.data) == null ? void 0 : _c2.addresses
|
|
34937
34963
|
});
|
|
34938
34964
|
}
|
|
34939
34965
|
}));
|
|
@@ -35252,12 +35278,12 @@ async function checkPaymentMethod(checkPayMethodParams) {
|
|
|
35252
35278
|
}
|
|
35253
35279
|
function debug(params) {
|
|
35254
35280
|
const newParams = reconstructParams(params);
|
|
35255
|
-
execute$
|
|
35281
|
+
execute$6(newParams);
|
|
35256
35282
|
}
|
|
35257
|
-
function execute$
|
|
35283
|
+
function execute$6(params) {
|
|
35258
35284
|
var _a;
|
|
35259
35285
|
(_a = params == null ? void 0 : params.success) == null ? void 0 : _a.call(params, {
|
|
35260
|
-
v: "1.
|
|
35286
|
+
v: "1.50.0"
|
|
35261
35287
|
});
|
|
35262
35288
|
}
|
|
35263
35289
|
function useCallBack(props, ctx) {
|
|
@@ -36359,25 +36385,31 @@ function _sfc_render$y(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
36359
36385
|
}
|
|
36360
36386
|
var AppVue$1 = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["render", _sfc_render$y]]);
|
|
36361
36387
|
async function initRegisterEmail(initRegisterEmail2, allowsUpdate) {
|
|
36362
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
36363
|
-
|
|
36364
|
-
|
|
36365
|
-
|
|
36366
|
-
|
|
36388
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
36389
|
+
try {
|
|
36390
|
+
const grantStatus = await checkPermission(PermissionName.mini_app_user_email_address);
|
|
36391
|
+
if (grantStatus !== PermissionStatus.granted) {
|
|
36392
|
+
return (_a = initRegisterEmail2 == null ? void 0 : initRegisterEmail2.fail) == null ? void 0 : _a.call(initRegisterEmail2, {
|
|
36393
|
+
errorCode: MiniAppErrorType.insufficientScope
|
|
36394
|
+
});
|
|
36395
|
+
}
|
|
36396
|
+
} catch {
|
|
36397
|
+
return (_b = initRegisterEmail2 == null ? void 0 : initRegisterEmail2.fail) == null ? void 0 : _b.call(initRegisterEmail2, {
|
|
36398
|
+
errorCode: MiniAppErrorType.serverError
|
|
36367
36399
|
});
|
|
36368
36400
|
}
|
|
36369
36401
|
const res = await getUserProfileDataV2();
|
|
36370
36402
|
if (res.ppFetchResult !== "success") {
|
|
36371
|
-
(
|
|
36403
|
+
(_c = initRegisterEmail2 == null ? void 0 : initRegisterEmail2.fail) == null ? void 0 : _c.call(initRegisterEmail2, {
|
|
36372
36404
|
errorCode: MiniAppErrorType.serverError
|
|
36373
36405
|
});
|
|
36374
36406
|
return;
|
|
36375
36407
|
}
|
|
36376
|
-
const email2 = (
|
|
36408
|
+
const email2 = (_e = (_d = res.body.unsigned) == null ? void 0 : _d.data) == null ? void 0 : _e.email;
|
|
36377
36409
|
const emailRegistered = !!email2;
|
|
36378
|
-
const emailVerified = ((
|
|
36410
|
+
const emailVerified = ((_g = (_f = res.body.unsigned) == null ? void 0 : _f.data) == null ? void 0 : _g.emailStatus) === "VERIFIED";
|
|
36379
36411
|
if (emailRegistered && emailVerified && !allowsUpdate) {
|
|
36380
|
-
(
|
|
36412
|
+
(_h = initRegisterEmail2 == null ? void 0 : initRegisterEmail2.success) == null ? void 0 : _h.call(initRegisterEmail2, {
|
|
36381
36413
|
statusCode: MiniAppStatusType.emailRegistered,
|
|
36382
36414
|
email: email2
|
|
36383
36415
|
});
|
|
@@ -36424,9 +36456,9 @@ function registerEmail(params, allowsUpdate = false) {
|
|
|
36424
36456
|
}
|
|
36425
36457
|
function registerKyc(params) {
|
|
36426
36458
|
const newParams = reconstructParams(params);
|
|
36427
|
-
execute$
|
|
36459
|
+
execute$5(newParams);
|
|
36428
36460
|
}
|
|
36429
|
-
function execute$
|
|
36461
|
+
function execute$5(params) {
|
|
36430
36462
|
var _a;
|
|
36431
36463
|
params = __spreadProps(__spreadValues({}, params), {
|
|
36432
36464
|
type: (params == null ? void 0 : params.type) || "EKYC"
|
|
@@ -36464,13 +36496,13 @@ function execute$4(params) {
|
|
|
36464
36496
|
}
|
|
36465
36497
|
async function startMultiFactorAuth(params) {
|
|
36466
36498
|
const newParams = reconstructParams(params);
|
|
36467
|
-
await execute$
|
|
36499
|
+
await execute$4(newParams);
|
|
36468
36500
|
}
|
|
36469
36501
|
function validType(params) {
|
|
36470
36502
|
const authTypes = ["BIOMETRIC"];
|
|
36471
36503
|
return authTypes.includes(params == null ? void 0 : params.type);
|
|
36472
36504
|
}
|
|
36473
|
-
async function execute$
|
|
36505
|
+
async function execute$4(params) {
|
|
36474
36506
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
36475
36507
|
if (!validType(params)) {
|
|
36476
36508
|
return (_a = params == null ? void 0 : params.fail) == null ? void 0 : _a.call(params, { errorCode: MiniAppErrorType.invalidType });
|
|
@@ -36500,9 +36532,9 @@ async function execute$3(params) {
|
|
|
36500
36532
|
}
|
|
36501
36533
|
function logout(params) {
|
|
36502
36534
|
const newParams = reconstructParams(params);
|
|
36503
|
-
execute$
|
|
36535
|
+
execute$3(newParams);
|
|
36504
36536
|
}
|
|
36505
|
-
function execute$
|
|
36537
|
+
function execute$3(params) {
|
|
36506
36538
|
var _a, _b;
|
|
36507
36539
|
try {
|
|
36508
36540
|
Object.entries(PpLocalStorageKey).forEach(([_, value2]) => {
|
|
@@ -36517,9 +36549,9 @@ function execute$2(params) {
|
|
|
36517
36549
|
}
|
|
36518
36550
|
async function verifyMultiFactorAuthResult(params) {
|
|
36519
36551
|
const newParams = reconstructParams(params);
|
|
36520
|
-
await execute$
|
|
36552
|
+
await execute$2(newParams);
|
|
36521
36553
|
}
|
|
36522
|
-
async function execute$
|
|
36554
|
+
async function execute$2(params) {
|
|
36523
36555
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
36524
36556
|
const urlParams = new URLSearchParams(window.location.search);
|
|
36525
36557
|
const sessionId = urlParams == null ? void 0 : urlParams.get("ppSessionId");
|
|
@@ -40629,9 +40661,9 @@ function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
40629
40661
|
var GetBankInfoWrapper = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$e]]);
|
|
40630
40662
|
function getBankInfo(params) {
|
|
40631
40663
|
const newParams = reconstructParams(params);
|
|
40632
|
-
execute(newParams);
|
|
40664
|
+
execute$1(newParams);
|
|
40633
40665
|
}
|
|
40634
|
-
function execute(params) {
|
|
40666
|
+
function execute$1(params) {
|
|
40635
40667
|
var _a;
|
|
40636
40668
|
try {
|
|
40637
40669
|
const container2 = document.createElement("div");
|
|
@@ -42353,6 +42385,42 @@ function registerPaymentFeatures(params) {
|
|
|
42353
42385
|
app.mount(container2);
|
|
42354
42386
|
document.body.appendChild(container2);
|
|
42355
42387
|
}
|
|
42388
|
+
async function getCashbackInformation(params) {
|
|
42389
|
+
const newParams = reconstructParams(params);
|
|
42390
|
+
await execute(newParams);
|
|
42391
|
+
}
|
|
42392
|
+
async function execute(params) {
|
|
42393
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
42394
|
+
try {
|
|
42395
|
+
if (!(params == null ? void 0 : params.merchantPaymentId)) {
|
|
42396
|
+
return (_a = params == null ? void 0 : params.fail) == null ? void 0 : _a.call(params, { errorCode: MiniAppErrorType.badRequest });
|
|
42397
|
+
}
|
|
42398
|
+
const grantStatus = await checkPermission(PermissionName.mini_app_cashback_information);
|
|
42399
|
+
if (grantStatus !== PermissionStatus.granted) {
|
|
42400
|
+
return (_b = params == null ? void 0 : params.fail) == null ? void 0 : _b.call(params, {
|
|
42401
|
+
errorCode: MiniAppErrorType.insufficientScope
|
|
42402
|
+
});
|
|
42403
|
+
}
|
|
42404
|
+
const res = await ppFetch2({
|
|
42405
|
+
method: "GET",
|
|
42406
|
+
url: `web-api/app/v1/payments/cashback/granted/${params.merchantPaymentId}`,
|
|
42407
|
+
params: { merchant: params == null ? void 0 : params.merchant }
|
|
42408
|
+
});
|
|
42409
|
+
if ((res == null ? void 0 : res.ppFetchResult) === "apiError" && ((_e = (_d = (_c = res == null ? void 0 : res.body) == null ? void 0 : _c.unsigned) == null ? void 0 : _d.resultInfo) == null ? void 0 : _e.code) === "RESOURCE_NOT_FOUND") {
|
|
42410
|
+
return (_f = params == null ? void 0 : params.fail) == null ? void 0 : _f.call(params, {
|
|
42411
|
+
errorCode: MiniAppErrorType.invalidPaymentIdentifier
|
|
42412
|
+
});
|
|
42413
|
+
} else if (res.ppFetchResult !== "success") {
|
|
42414
|
+
return (_g = params == null ? void 0 : params.fail) == null ? void 0 : _g.call(params, { errorCode: getFailErrorCode(res.ppFetchResult) });
|
|
42415
|
+
} else {
|
|
42416
|
+
return (_j = params == null ? void 0 : params.success) == null ? void 0 : _j.call(params, {
|
|
42417
|
+
jws: (_i = (_h = res == null ? void 0 : res.body) == null ? void 0 : _h.signed) == null ? void 0 : _i.jws
|
|
42418
|
+
});
|
|
42419
|
+
}
|
|
42420
|
+
} catch (e) {
|
|
42421
|
+
return (_k = params == null ? void 0 : params.fail) == null ? void 0 : _k.call(params, { errorCode: MiniAppErrorType.serverError });
|
|
42422
|
+
}
|
|
42423
|
+
}
|
|
42356
42424
|
var RuntimeEnv;
|
|
42357
42425
|
(function(RuntimeEnv2) {
|
|
42358
42426
|
RuntimeEnv2["JS"] = "JS";
|
|
@@ -42373,6 +42441,10 @@ class MiniAppModule extends JsBridgeModule {
|
|
|
42373
42441
|
copyToClipboard(params) {
|
|
42374
42442
|
copyToClipboard(params);
|
|
42375
42443
|
}
|
|
42444
|
+
getCashbackInformation(params) {
|
|
42445
|
+
getCashbackInformation(params).catch(() => {
|
|
42446
|
+
});
|
|
42447
|
+
}
|
|
42376
42448
|
openWebview(params) {
|
|
42377
42449
|
openWebview(params);
|
|
42378
42450
|
}
|
|
@@ -50,7 +50,8 @@ export declare enum MiniAppErrorType {
|
|
|
50
50
|
permissionRequired = "PERMISSION_REQUIRED",
|
|
51
51
|
deeplinkUnavailable = "DEEPLINK_UNAVAILABLE",
|
|
52
52
|
kycIncompleted = "KYC_INCOMPLETED",
|
|
53
|
-
noBankAccount = "NO_BANK_ACCOUNT"
|
|
53
|
+
noBankAccount = "NO_BANK_ACCOUNT",
|
|
54
|
+
invalidPaymentIdentifier = "INVALID_PAYMENT_IDENTIFIER"
|
|
54
55
|
}
|
|
55
56
|
export declare class MiniAppError extends Error {
|
|
56
57
|
constructor(type: MiniAppErrorType);
|
|
@@ -17,6 +17,7 @@ export declare const PermissionName: {
|
|
|
17
17
|
mini_app_user_phone_camera: string;
|
|
18
18
|
mini_app_user_phone_album: string;
|
|
19
19
|
mini_app_bank_information: string;
|
|
20
|
+
mini_app_cashback_information: string;
|
|
20
21
|
};
|
|
21
22
|
export declare const checkPermission: (permissionNames: string[] | string) => Promise<PermissionStatus>;
|
|
22
23
|
export declare function getUserGrantedPermission(): Promise<string[]>;
|
package/dist/types.d.ts
CHANGED
|
@@ -100,6 +100,10 @@ export interface SetDataParams extends NativeParams<void> {
|
|
|
100
100
|
export interface GetDataParams extends NativeParams<MiniAppResult> {
|
|
101
101
|
key: string;
|
|
102
102
|
}
|
|
103
|
+
export interface GetCashbackInfoParams extends NativeParams<MiniAppResult> {
|
|
104
|
+
merchantPaymentId: string;
|
|
105
|
+
merchant?: string;
|
|
106
|
+
}
|
|
103
107
|
export interface RemoveDataParams extends NativeParams<void> {
|
|
104
108
|
key: string;
|
|
105
109
|
}
|