0.0.3 • Published 3 years ago

depay-cash-sdk v0.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

depay-cash-sdk

To integrate dePay into your marketplace, you will first need to generate a payment URL that can be used to initialize an iframe with the dePay payment flow.

    import dePay from "depay-cash-sdk";

    (async () => {
    try {
        // init dePay object
        const dePayOBJ = new dePay({
            appId: "YOUR-APP-ID",
            apiSecret: "YOUR-SECRET",
            sandbox: true, // false for production
        });

         const response = await dePayOBJ.checkout.init({
            nft_action_type: "bid",
            total_value_in_smallest_unit: "1600000000000000",
            user_wallet_address: "0x4r87......o4t40",
            nfts_list: [],
        });

        // The payment status can be tracked using the PAYMENT_ID
        const status = await dePayOBJ.checkout.status("PAYMENT_ID");

    } catch (e) {
        // Deal with the fact the chain failed
        throw e;
    }
    })();