zmp-sdk 2.18.6 → 2.19.0-rc.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.
@@ -0,0 +1,27 @@
1
+ import * as InputDataType from '../types/inputData';
2
+ import * as CallbackDataType from '../types/callbackData';
3
+ import { PaymentServiceInterface } from '../types/interface';
4
+ import { SDKCreator } from '..';
5
+ export declare class PaymentService implements PaymentServiceInterface {
6
+ #private;
7
+ private static instance;
8
+ static getInstance(): PaymentService;
9
+ /**
10
+ * Tạo đơn hàng
11
+ *
12
+ * @async
13
+ * @function createOrder
14
+ * @category PaymentService
15
+ * @returns {Promise<CallbackDataType.CreateOrderCallBack>}
16
+ */
17
+ createOrder(this: PaymentService, sdk: SDKCreator, object: InputDataType.CreateOrder): Promise<CallbackDataType.CreateOrderCallBack>;
18
+ /**
19
+ * Lấy thông tin transaction
20
+ *
21
+ * @async
22
+ * @function checkTransaction
23
+ * @category PaymentService
24
+ * @returns {Promise<CallbackDataType.CheckTransactionSuccessCallBack>}
25
+ */
26
+ checkTransaction(this: PaymentService, sdk: SDKCreator, object: InputDataType.CheckTransaction): Promise<CallbackDataType.CheckTransactionSuccessCallBack>;
27
+ }
@@ -115,6 +115,7 @@ export declare type AppInfoSuccessCallBack = {
115
115
  name: string;
116
116
  appUrl: string;
117
117
  qrCodeUrl: string;
118
+ logoUrl?: string;
118
119
  };
119
120
  /**
120
121
  * get phone number success callback
@@ -152,3 +153,22 @@ export declare type GetActionsSupportedSuccessCallBack = {
152
153
  export declare type OpenMediaPickerSuccessCallBack = {
153
154
  urls: Array<string>;
154
155
  };
156
+ /**
157
+ * open create order success callback
158
+ * @typedef CreateOrderCallBack
159
+ */
160
+ export declare type CreateOrderCallBack = {
161
+ orderId: string;
162
+ };
163
+ /**
164
+ * get transaction success callback
165
+ * @typedef CheckTransactionSuccessCallBack
166
+ */
167
+ export declare type CheckTransactionSuccessCallBack = {
168
+ msg: string;
169
+ appId: string;
170
+ orderId: string;
171
+ resultCode: number;
172
+ transTime: number;
173
+ createdAt: string;
174
+ };
@@ -444,4 +444,21 @@ export declare type GetShareableLink<T> = CallbackType<T> & {
444
444
  thumbnail: string;
445
445
  path: string;
446
446
  };
447
+ /**
448
+ * CreateOrder type
449
+ */
450
+ export declare type CreateOrder = CallbackType & {
451
+ amount: string | number;
452
+ item: Array<{
453
+ [key: string]: string;
454
+ }>;
455
+ desc: string;
456
+ extradata?: any;
457
+ method?: 'ZALOPAY' | 'MOMO' | 'ZALOPAY_SANDBOX' | 'MOMO_SANDBOX' | 'ATM' | 'ATM_SANDBOX' | 'CC' | 'CC_SANDBOX';
458
+ };
459
+ export declare type CheckTransaction = CallbackType & {
460
+ data: string | {
461
+ [key: string]: string;
462
+ };
463
+ };
447
464
  export {};
@@ -2,6 +2,7 @@ import * as InputDataType from './inputData';
2
2
  import * as CallbackDataType from './callbackData';
3
3
  import { systemInfo } from './entity';
4
4
  import { MediaPickerType } from './enum';
5
+ import { SDKCreator } from '..';
5
6
  export interface SDKServiceInterface {
6
7
  getAppId: () => string;
7
8
  login: (object?: InputDataType.CallbackType) => Promise<string>;
@@ -80,3 +81,7 @@ export interface SDKServiceInterface {
80
81
  openOutApp: (url: string) => Promise<void>;
81
82
  closeLoading: (when: string) => Promise<void>;
82
83
  }
84
+ export interface PaymentServiceInterface {
85
+ createOrder: (sdk: SDKCreator, object: InputDataType.CreateOrder) => Promise<CallbackDataType.CreateOrderCallBack>;
86
+ checkTransaction: (sdk: SDKCreator, object: InputDataType.CheckTransaction) => Promise<CallbackDataType.CheckTransactionSuccessCallBack>;
87
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zmp-sdk",
3
- "version": "2.18.6",
3
+ "version": "2.19.0-rc.2",
4
4
  "description": "Zalo Mini App SDK",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",