depay-sdk
v0.2.1
Published
depay-sdk
Downloads
1
Readme
depay-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-sdk";
(async () => {
try {
// init dePay object
const dePayOBJ = new dePay({
appId: "YOUR-APP-ID",
appSecret: "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;
}
})();