zmp-sdk 2.47.0-beta.3 → 2.47.0-beta.4

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
@@ -2493,6 +2493,43 @@ declare const showWidgetArgs: ZodObject<{
2493
2493
  onMethodChange?: ((...args: unknown[]) => unknown) | undefined;
2494
2494
  id: string;
2495
2495
  }>[];
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
+ */
2496
2533
  declare function showWidget(args: AsyncVoidCallback$1 & TypeOf<(typeof showWidgetArgs)[0]>): Promise<void>;
2497
2534
 
2498
2535
  declare const eventTypeType: ZodEnum<["APP_INITIALIZING", "APP_READY"]>;