zmp-sdk 2.45.0-beta.1 → 2.45.0-beta.2
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/apis/apis/payment/checkTransaction.js +1 -1
- package/apis/apis/payment/index.js +1 -1
- package/apis/apis/showFunctionButtonWidget.js +1 -1
- package/apis/common/apis/general/payment/checkTransaction.js +1 -1
- package/apis/common/apis/general/payment/createOrder.js +1 -1
- package/apis/common/apis/general/payment/utils.js +1 -0
- package/apis/common/eventEmitter.js +1 -1
- package/apis/constants.js +1 -1
- package/apis/index.d.ts +63 -4
- package/apis/package.json.js +1 -1
- package/apis/types/enum.js +1 -1
- package/browser.min.js +2 -2
- package/index.d.ts +67 -4
- package/index.es.js +2 -2
- package/index.js +2 -2
- package/index.umd.js +3 -3
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -978,6 +978,16 @@ declare enum Events {
|
|
|
978
978
|
AppClose = "h5.event.action.close",
|
|
979
979
|
PaymentCallback = "payment.callback",
|
|
980
980
|
PaymentResult = "action.payment.result",
|
|
981
|
+
/** Người dùng đã hoàn thành quy trình thanh toán ở CheckoutSDK
|
|
982
|
+
* * Lưu ý: Event sẽ được gửi khi người dùng hoàn tất hoặc hủy quy trình thanh toán.
|
|
983
|
+
* * Đối tác cần sử dụng API checkTransaction để kiểm tra trạng thái thanh toán mới nhất.
|
|
984
|
+
*
|
|
985
|
+
* Ví dụ:
|
|
986
|
+
*
|
|
987
|
+
* ```tsx
|
|
988
|
+
* ```
|
|
989
|
+
* */
|
|
990
|
+
PaymentDone = "action.payment.done",
|
|
981
991
|
PaymentClose = "action.payment.close",
|
|
982
992
|
DownloadProgress = "h5.event.webview.download.progress"
|
|
983
993
|
}
|
|
@@ -1323,7 +1333,24 @@ declare const ACTION: {
|
|
|
1323
1333
|
HIDE_KEYBOARD: {};
|
|
1324
1334
|
OPEN_PHONE: {};
|
|
1325
1335
|
OPEN_QR: {};
|
|
1326
|
-
OPEN_SMS: {
|
|
1336
|
+
OPEN_SMS: {
|
|
1337
|
+
errorList: {
|
|
1338
|
+
iOS: {
|
|
1339
|
+
"-9": {
|
|
1340
|
+
mapTo: {
|
|
1341
|
+
code: number;
|
|
1342
|
+
message: string;
|
|
1343
|
+
};
|
|
1344
|
+
};
|
|
1345
|
+
"-10": {
|
|
1346
|
+
mapTo: {
|
|
1347
|
+
code: number;
|
|
1348
|
+
message: string;
|
|
1349
|
+
};
|
|
1350
|
+
};
|
|
1351
|
+
};
|
|
1352
|
+
};
|
|
1353
|
+
};
|
|
1327
1354
|
VIEW_MYQR: {
|
|
1328
1355
|
haveCallback: boolean;
|
|
1329
1356
|
timeout: boolean;
|
|
@@ -3286,6 +3313,11 @@ declare const createOrderArgs: ZodObject<{
|
|
|
3286
3313
|
amount: string | number;
|
|
3287
3314
|
item: Record<string, any>[];
|
|
3288
3315
|
}>[];
|
|
3316
|
+
/**
|
|
3317
|
+
* Tạo yêu cầu thanh toán, mở giao diện chọn phương thức thanh toán
|
|
3318
|
+
* @link https://mini.zalo.me/documents/checkout-sdk/createOrder/
|
|
3319
|
+
* @param args
|
|
3320
|
+
*/
|
|
3289
3321
|
declare function createOrder(args: AsyncCallback<CreateOrderReturns> & TypeOf<(typeof createOrderArgs)[0]>): Promise<CreateOrderReturns>;
|
|
3290
3322
|
|
|
3291
3323
|
declare const purchaseArgs: ZodObject<{
|
|
@@ -3307,6 +3339,11 @@ declare const purchaseArgs: ZodObject<{
|
|
|
3307
3339
|
desc: string;
|
|
3308
3340
|
amount: string | number;
|
|
3309
3341
|
}>[];
|
|
3342
|
+
/**
|
|
3343
|
+
* Gửi thông tin thanh toán đến CheckoutSDK
|
|
3344
|
+
* @link https://mini.zalo.me/documents/checkout-sdk/purchase/
|
|
3345
|
+
* @param args
|
|
3346
|
+
*/
|
|
3310
3347
|
declare function purchase(args: AsyncCallback<CreateOrderReturns> & TypeOf<(typeof purchaseArgs)[0]>): Promise<CreateOrderReturns>;
|
|
3311
3348
|
|
|
3312
3349
|
declare const selectPaymentMethodArgs: ZodOptional<ZodObject<{
|
|
@@ -3357,12 +3394,30 @@ declare const selectPaymentMethodArgs: ZodOptional<ZodObject<{
|
|
|
3357
3394
|
declare function selectPaymentMethod(args: AsyncCallback<SelectPaymentMethodReturns> & TypeOf<(typeof selectPaymentMethodArgs)[0]>): Promise<SelectPaymentMethodReturns>;
|
|
3358
3395
|
|
|
3359
3396
|
declare const checkTransactionArgs: ZodObject<{
|
|
3360
|
-
data: ZodUnion<[ZodString, ZodRecord<ZodString, ZodString
|
|
3397
|
+
data: ZodUnion<[ZodString, ZodRecord<ZodString, ZodOptional<ZodNullable<ZodString>>>]>;
|
|
3361
3398
|
}, "strip", ZodTypeAny, {
|
|
3362
|
-
data: string | Record<string, string>;
|
|
3399
|
+
data: string | Record<string, string | null | undefined>;
|
|
3363
3400
|
}, {
|
|
3364
|
-
data: string | Record<string, string>;
|
|
3401
|
+
data: string | Record<string, string | null | undefined>;
|
|
3365
3402
|
}>[];
|
|
3403
|
+
/**
|
|
3404
|
+
* Kiểm tra trạng thái giao dịch
|
|
3405
|
+
* @link https://mini.zalo.me/documents/checkout-sdk/checkTransaction/
|
|
3406
|
+
* @param args
|
|
3407
|
+
* @example
|
|
3408
|
+
* ```ts
|
|
3409
|
+
* import { CheckoutSDK } from "zmp-sdk/apis";
|
|
3410
|
+
* // Kiểm tra bằng `orderId` tạo bởi Checkout SDK
|
|
3411
|
+
* const result = await CheckoutSDK.checkTransaction({
|
|
3412
|
+
* data: { orderId: "123456"}
|
|
3413
|
+
* });
|
|
3414
|
+
*
|
|
3415
|
+
* // Kiểm tra bằng `transId` tạo bởi đối tác thanh toán
|
|
3416
|
+
* const result = await CheckoutSDK.checkTransaction({
|
|
3417
|
+
* data: { transId: "123456"}
|
|
3418
|
+
* });
|
|
3419
|
+
*
|
|
3420
|
+
*/
|
|
3366
3421
|
declare function checkTransaction(args: AsyncCallback<CheckTransactionReturns> & TypeOf<(typeof checkTransactionArgs)[0]>): Promise<CheckTransactionReturns>;
|
|
3367
3422
|
|
|
3368
3423
|
declare const createOrderIAPArgs: ZodObject<{
|
|
@@ -3780,6 +3835,7 @@ declare const nativeStorage: {
|
|
|
3780
3835
|
};
|
|
3781
3836
|
|
|
3782
3837
|
declare const Payment: {
|
|
3838
|
+
purchase: typeof purchase;
|
|
3783
3839
|
createOrder: typeof createOrder;
|
|
3784
3840
|
checkTransaction: typeof checkTransaction;
|
|
3785
3841
|
createOrderIAP: typeof createOrderIAP;
|
|
@@ -3787,6 +3843,9 @@ declare const Payment: {
|
|
|
3787
3843
|
};
|
|
3788
3844
|
declare const CheckoutSDK: {
|
|
3789
3845
|
purchase: typeof purchase;
|
|
3846
|
+
createOrder: typeof createOrder;
|
|
3847
|
+
checkTransaction: typeof checkTransaction;
|
|
3848
|
+
createOrderIAP: typeof createOrderIAP;
|
|
3790
3849
|
selectPaymentMethod: typeof selectPaymentMethod;
|
|
3791
3850
|
};
|
|
3792
3851
|
|
|
@@ -3909,6 +3968,7 @@ declare const otherApis: {
|
|
|
3909
3968
|
getStorageInfo: typeof getStorageInfoSync;
|
|
3910
3969
|
};
|
|
3911
3970
|
Payment: {
|
|
3971
|
+
purchase: typeof purchase;
|
|
3912
3972
|
createOrder: typeof createOrder;
|
|
3913
3973
|
checkTransaction: typeof checkTransaction;
|
|
3914
3974
|
createOrderIAP: typeof createOrderIAP;
|
|
@@ -3916,6 +3976,9 @@ declare const otherApis: {
|
|
|
3916
3976
|
};
|
|
3917
3977
|
CheckoutSDK: {
|
|
3918
3978
|
purchase: typeof purchase;
|
|
3979
|
+
createOrder: typeof createOrder;
|
|
3980
|
+
checkTransaction: typeof checkTransaction;
|
|
3981
|
+
createOrderIAP: typeof createOrderIAP;
|
|
3919
3982
|
selectPaymentMethod: typeof selectPaymentMethod;
|
|
3920
3983
|
};
|
|
3921
3984
|
downloadFile: typeof downloadFile;
|