oegbuycard
v1.0.8
Published
Buy Card Sdk.
Downloads
14
Readme
Ví dụ
async function main() {
const buyCardService = new BuyCardService({
host: process.env.HOST,
serviceID: process.env.SERVICE_ID,
secret: process.env.SECRET_ID
})
// Tạo link nhúng để mua thẻ
console.log(buyCardService.createLinkBuyCard({
UserID: 1,
RequestID: Math.random().toString().substring(2),
TimeStamp: new Date().getTime()
}))
// Danh sách order
const orders = await buyCardService.orders({
OrderBy: "DESC", // OrderBy: "ASC",
UserID: 1,
Limit: 10,
StartAt: "2023-10-10 00:00:00",
Status: 0
})
console.log(orders)
// Thông tin chi tiết order
const order = await buyCardService.order(OrderID, UserID)
console.log(order)
// Danh sách phương thức thanh toán
const paymentMethod = await buyCardService.paymentMethod()
console.log(paymentMethod)
// Tạo đơn hàng
const createOrder = await buyCardService.createOrder({
UserID: 1,
CardPriceID: 1,
Quantity: 1,
PaymentMethodID: "MoMo"
})
console.log(createOrder)
}
main()