1.0.8 • Published 2 years ago

oegbuycard v1.0.8

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

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()
1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago