npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ngan-luong-2x

v1.0.9

Published

[![Build Status](https://travis-ci.org/joemccann/dillinger.svg?branch=master)](https://travis-ci.org/joemccann/dillinger)

Downloads

14

Readme

ngan-luong-2x

Build Status

Thư viện hỗi trợ xây dựng URL thanh toán cho cổng thanh toán trực tuyến ngân lượng phiên bản 2x

  • So với phiên bản 3x, phiên bản 2x có giao diện lựa chọn các phương thức/ngân hàng thanh toán.
  • Tạo link redirect thanh toán
  • Nhận kết quả trả về theo return_url
  • Kiểm tra trạng thái đơn hàng

Cài đặt

# npm
npm install ngan-luong-2x --save
# yarn
yarn add ngan-luong-2x

Tài liệu tích hợp

Bạn nên đọc trước tài liệu tích hợp từ cổng thanh toán link pdf

Hướng dẫn

  1. Require class hỗi trợ
const NganLuong = require("ngan-luong-2x");
  1. Khởi tạo với thông tin từ cổng thanh toán
const nganluong = new NganLuong({
  isSandbox: true,
  merchant_site_code: "47806",
  secure_pass: "bf461a3f91986e894ab8a19c0f400546"
});
  1. Tạo url redirect qua cổng thanh toán
var url = nganluong.buildCheckoutUrl({
  return_url: "http://localhost:3000/callback-payment",
  affiliate_code: "",
  buyer_info: "",
  currency: "vnd",
  discount: "0",
  fee_cal: "0",
  fee_shipping: "0",
  order_code: "laskjflkasjj8o3jflkdsjv",
  order_description: "dayladonhang est",
  price: "10000",
  quantity: "1",
  receiver: "[email protected]",
  tax: "0",
  transaction_info: "day_la_thong_tin_giao_dich"
});
console.log({ url });
/*
{ url:
   'https://sandbox.nganluong.vn:8088/nl35/checkout.php?merchant_site_code=47806&return_url=http://localhost:3000/callback-payment&currency=vnd&discount=0&fee_cal=0&fee_shipping=0&order_code=laskjflkasjj8o3jflkdsjv&order_description=day%20la%20don%20hang%20test&price=10000&quantity=1&[email protected]&tax=0&transaction_info=day%20la%20thong%20tin%20giao%20dich&secure_code=fc6f861d1fbc89599ac0491fbdba2ced' }
 */
  1. Kiểm tra và xác thực thanh toán quan url callback
var result_callback = nganluong.verifyReturnUrl({
  error_text: "",
  price: "10000",
  payment_id: "19682770",
  transaction_info: "day_la_thong_tin_giao_dich",
  order_code: "laskjflkasjj8o3jflkdsjv",
  payment_type: "2",
  secure_code: "25a50fe5ef428e35addbbbafbe13dc40",
  token_nl: "142989-8caae7fc844cc12a2328dc057aca43be"
});
console.log(result_callback);
/*
{ isSuccess: true,
  payment_id: '19682770',
  error_text: '',
  order_code: 'laskjflkasjj8o3jflkdsjv',
  token_nl: '142989-8caae7fc844cc12a2328dc057aca43be' }
*/

nếu check_payment.isSuccess === true thì thanh toán thành công

  1. Kiểm tra trạng thái đơn hàng
nganluong
  .checkOrderStatus("laskjflkasjj8o3jflkdsjv")
  .then(data => console.log(data))
  .catch(err => console.error(err));
/*
{ message: 'Giao dịch thành công',
  error_code: '00',
  data:
   { token: '142989-8caae7fc844cc12a2328dc057aca43be',
        ....
     transaction_id: 19682770,
     payment_type: 2,
     transaction_status: '00' } }
*/

License

MIT

Đức đẹp trai