zmp-sdk 2.47.0-beta.4 → 2.47.0-beta.6
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/checkoutKit/purchase.js +1 -1
- package/apis/apis/checkoutKit/showWidget.js +1 -1
- package/apis/apis/showCustomOAWidget.js +1 -1
- package/apis/apis/showFunctionButtonWidget.js +1 -1
- package/apis/common/apis/general/getSystemInfo.js +1 -1
- package/apis/common/apis/general/openShareSheet.js +1 -1
- package/apis/common/apis/general/scanNFC.js +1 -1
- package/apis/common/apis/general/storage/index.js +1 -1
- package/apis/common/utils.js +1 -1
- package/apis/index.d.ts +0 -90
- package/apis/package.json.js +1 -1
- package/apis/utils/common.js +1 -1
- package/browser.min.js +2 -2
- package/index.d.ts +0 -90
- package/index.es.js +2 -2
- package/index.js +2 -2
- package/index.umd.js +2 -2
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -2426,59 +2426,6 @@ declare const purchaseArgs$1: ZodObject<{
|
|
|
2426
2426
|
desc: string;
|
|
2427
2427
|
amount: string | number;
|
|
2428
2428
|
}>[];
|
|
2429
|
-
/**
|
|
2430
|
-
* ...Implementation of the Checkout Kit Widget Purchase...
|
|
2431
|
-
*
|
|
2432
|
-
* @minimumVersion 2.47.0
|
|
2433
|
-
* @zaloOnly Chỉ hoạt động khi chạy bên trong ứng dụng Zalo mobile.
|
|
2434
|
-
*
|
|
2435
|
-
* @param {string | number} amount - Số tiền cần thanh toán. Có thể là chuỗi hoặc số.
|
|
2436
|
-
* @param {string} desc - Mô tả giao dịch thanh toán.
|
|
2437
|
-
* @param {object} [payload] - Dữ liệu tuỳ chỉnh đi kèm với giao dịch thanh toán. Đây có thể là bất kỳ dữ liệu nào bạn muốn gửi kèm theo giao dịch, ví dụ như thông tin đơn hàng, mã khuyến mãi, v.v.
|
|
2438
|
-
*
|
|
2439
|
-
* @example Hiển thị Widget Checkout Kit và thực hiện thanh toán:
|
|
2440
|
-
* ```ts
|
|
2441
|
-
* import React, { useEffect } from "react";
|
|
2442
|
-
* import { CheckoutKit } from "zmp-sdk/apis";
|
|
2443
|
-
*
|
|
2444
|
-
* function HomePage() {
|
|
2445
|
-
* const handlePurchase = async () => {
|
|
2446
|
-
* try {
|
|
2447
|
-
* const result = await CheckoutKit.purchase({
|
|
2448
|
-
* amount: 10000,
|
|
2449
|
-
* desc: "Thanh toán đơn hàng #12345",
|
|
2450
|
-
* payload: {
|
|
2451
|
-
* orderId: "12345",
|
|
2452
|
-
* },
|
|
2453
|
-
* });
|
|
2454
|
-
* console.log("Thanh toán thành công:", result);
|
|
2455
|
-
* } catch (error) {
|
|
2456
|
-
* console.error("Lỗi thanh toán:", error);
|
|
2457
|
-
* }
|
|
2458
|
-
* };
|
|
2459
|
-
*
|
|
2460
|
-
* useEffect(() => {
|
|
2461
|
-
* CheckoutKit.showWidget({
|
|
2462
|
-
* id: "checkoutKitWidget",
|
|
2463
|
-
* onMethodChange: (data) => {
|
|
2464
|
-
* console.log(data);
|
|
2465
|
-
* },
|
|
2466
|
-
* });
|
|
2467
|
-
* }, []);
|
|
2468
|
-
*
|
|
2469
|
-
* return (
|
|
2470
|
-
* <>
|
|
2471
|
-
* ...
|
|
2472
|
-
* <div id="checkoutKitWidget" />
|
|
2473
|
-
* <button onClick={handlePurchase}>Thanh toán</button>
|
|
2474
|
-
* ...
|
|
2475
|
-
* </>
|
|
2476
|
-
* );
|
|
2477
|
-
* }
|
|
2478
|
-
*
|
|
2479
|
-
* export default HomePage;
|
|
2480
|
-
* ```
|
|
2481
|
-
*/
|
|
2482
2429
|
declare function purchase$1(args: AsyncCallback<CreateOrderReturns> & TypeOf<(typeof purchaseArgs$1)[0]>): Promise<CreateOrderReturns>;
|
|
2483
2430
|
|
|
2484
2431
|
declare const showWidgetArgs: ZodObject<{
|
|
@@ -2493,43 +2440,6 @@ declare const showWidgetArgs: ZodObject<{
|
|
|
2493
2440
|
onMethodChange?: ((...args: unknown[]) => unknown) | undefined;
|
|
2494
2441
|
id: string;
|
|
2495
2442
|
}>[];
|
|
2496
|
-
/**
|
|
2497
|
-
* ...Implementation of the Checkout Kit Widget...
|
|
2498
|
-
*
|
|
2499
|
-
* @minimumVersion 2.47.0
|
|
2500
|
-
* @zaloOnly Chỉ hoạt động khi chạy bên trong ứng dụng Zalo mobile.
|
|
2501
|
-
*
|
|
2502
|
-
* @param {string} id - ID của element, nơi cần hiển thị widget.
|
|
2503
|
-
* @param {(data: any) => void} [onMethodChange] - Callback được gọi khi phương thức thanh toán được thay đổi. Callback này nhận vào dữ liệu liên quan đến phương thức thanh toán đã chọn.
|
|
2504
|
-
* @param {(error: string) => void} [fail] - Callback được gọi khi có lỗi xảy ra trong quá trình tương tác với widget. Callback này nhận vào thông tin về lỗi.
|
|
2505
|
-
*
|
|
2506
|
-
* @example Hiển thị Widget Checkout Kit:
|
|
2507
|
-
* ```ts
|
|
2508
|
-
* import React, { useEffect } from "react";
|
|
2509
|
-
* import { CheckoutKit } from "zmp-sdk/apis";
|
|
2510
|
-
*
|
|
2511
|
-
* function HomePage() {
|
|
2512
|
-
* useEffect(() => {
|
|
2513
|
-
* CheckoutKit.showWidget({
|
|
2514
|
-
* id: "checkoutKitWidget",
|
|
2515
|
-
* onMethodChange: (data) => {
|
|
2516
|
-
* console.log(data);
|
|
2517
|
-
* },
|
|
2518
|
-
* });
|
|
2519
|
-
* }, []);
|
|
2520
|
-
*
|
|
2521
|
-
* return (
|
|
2522
|
-
* <>
|
|
2523
|
-
* ...
|
|
2524
|
-
* <div id="checkoutKitWidget" />
|
|
2525
|
-
* ...
|
|
2526
|
-
* </>
|
|
2527
|
-
* );
|
|
2528
|
-
* }
|
|
2529
|
-
*
|
|
2530
|
-
* export default HomePage;
|
|
2531
|
-
* ```
|
|
2532
|
-
*/
|
|
2533
2443
|
declare function showWidget(args: AsyncVoidCallback$1 & TypeOf<(typeof showWidgetArgs)[0]>): Promise<void>;
|
|
2534
2444
|
|
|
2535
2445
|
declare const eventTypeType: ZodEnum<["APP_INITIALIZING", "APP_READY"]>;
|