zmp-sdk 2.45.0-beta.1 → 2.45.0-beta.3

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/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;
@@ -3250,6 +3277,7 @@ declare const createOrderArgs: ZodObject<{
3250
3277
  amount: ZodUnion<[ZodString, ZodNumber]>;
3251
3278
  item: ZodArray<ZodRecord<ZodString, ZodAny>, "many">;
3252
3279
  desc: ZodString;
3280
+ mac: ZodString;
3253
3281
  extradata: ZodOptional<ZodAny>;
3254
3282
  payload: ZodOptional<ZodAny>;
3255
3283
  method: ZodOptional<ZodUnion<[ZodString, ZodObject<{
@@ -3262,7 +3290,6 @@ declare const createOrderArgs: ZodObject<{
3262
3290
  id: string;
3263
3291
  isCustom: boolean;
3264
3292
  }>]>>;
3265
- mac: ZodOptional<ZodString>;
3266
3293
  }, "strip", ZodTypeAny, {
3267
3294
  method?: string | {
3268
3295
  id: string;
@@ -3270,10 +3297,10 @@ declare const createOrderArgs: ZodObject<{
3270
3297
  } | undefined;
3271
3298
  extradata?: any;
3272
3299
  payload?: any;
3273
- mac?: string | undefined;
3274
3300
  desc: string;
3275
3301
  amount: string | number;
3276
3302
  item: Record<string, any>[];
3303
+ mac: string;
3277
3304
  }, {
3278
3305
  method?: string | {
3279
3306
  id: string;
@@ -3281,11 +3308,16 @@ declare const createOrderArgs: ZodObject<{
3281
3308
  } | undefined;
3282
3309
  extradata?: any;
3283
3310
  payload?: any;
3284
- mac?: string | undefined;
3285
3311
  desc: string;
3286
3312
  amount: string | number;
3287
3313
  item: Record<string, any>[];
3314
+ mac: string;
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;