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 🙏

© 2026 – Pkg Stats / Ryan Hefner

ga-payment-sdk

v1.1.0

Published

ga-payment-nodesdk

Readme

ga-payment-sdk

连连全球支付 ga-payment-sdk for Node.js

一、安装

npm install ga-payment-sdk

二、使用说明

//引入ga-payment-sdk
const LLPaySdk = require('ga-payment-sdk');
//配置信息:
const config = {
  env: 'sandbox', //支付环境'sandbox' | 'product';
  sign_type: 'RSA', //签名算法  'RSA' | 'HMAC';
  merchant_sign_key: '', //配置商户秘钥
  ll_sign_key: '', // 配置连连秘钥
  merchant_id: '', //商户号
  sub_merchant_id: '', //二级商户号
  is_print_log: true, //控制台是否打印日志   
};
const LLPay = new LLPaySdk(config);

config 配置信息说明

| 参数 | 类型 | 是否必须 | 描述 | 默认值 | | :---------------| :-------: | :------: | :--------------------------------------------------- | :-----: | | env | string | 是 | 支付环境沙箱或线上环境,值为"sandbox""product" | -- | | sign_type | string | 否 | 签名算法 "RSA""HMAC" | "RSA" | | merchant_sign_key | string | 是 | 配置商户秘钥;RSA - 商户私钥 - 商户自己创建;HMAC - 连连提供的HMAC key | --- | | ll_sign_key | string | 是 | 配置连连秘钥;RSA - 连连公钥 - 连连提供;HMAC - 连连提供的HMAC key | --- | | merchant_id | string | 是 |商户号 连连提供 | --- | | sub_merchant_id | string | 否 | 二级商户号 连连提供(若无则不填) | --- | | is_print_log | boolean | 否 | 控制台是否打印日志 | true |

三、方法说明

提供创单支付、退款、支付查询、退款查询、物流上传、支付取消、获取 iframe 支付 token、支付通知/退款通知解析的方法,开发者只需按如下调用示例说明调用即可。

目前已支持的接口,如 api 文档所示:https://doc.lianlianpay.com/doc-api/open-api/pay-order

SDK集成说明:SDK已经对加签验签逻辑做了封装,使用 SDK 时传入商户公钥等内容可直接通过SDK自动进行加验签,签名方法:加签验签详情参见:https://doc.lianlianpay.com/pay-guide/dev-ready/rule

注意:
1、调用方法中的params中的merchant_idsub_merchant_id均不需传入,因为在实例化对象的config配置信息中已配置。

2、接口请求成功回调的res:Object结构示例及说明:

{
  "verifySignResult": true, //boolean,验签成功或失败
  "verifySignMessage": "验签成功", //string,验签描述
  "body": "{}" // json字符串,body其中的参数可参考各API文档出参
}

四、调用方法示例

创单支付调用示例

LLPay.pay({
  params: {
    //请求入参,参考API文档:https://doc.lianlianpay.com/doc-api/open-api/pay-order#%E5%85%A5%E5%8F%82
  },
  //成功回调
  successcb: function (res) {
    
  },
  //失败回调
  failcb: function (res) {
    
  },
});

支付结果查询调用示例

LLPay.payResultQuery({
  params: {
    //请求入参,参考API文档:https://doc.lianlianpay.com/doc-api/open-api/pay-result#%E5%85%A5%E5%8F%82
  },
  //成功回调
  successcb: function (res) {
   
  },
  //失败回调
  failcb: function (res) {
    
  },
});

支付结果查询(POST)调用示例(v1.1.0+)

LLPay.payResultQueryPost({
  params: {
    //请求入参,merchant_transaction_id 与 arn 至少传一个
  },
  //可选:传入 accept-version 作为请求头(不参与签名/请求体)
  version: "3.3",
  //成功回调
  successcb: function (res) {
   
  },
  //失败回调
  failcb: function (res) {
    
  },
});

退款调用示例

LLPay.refund({
  params: {
    //请求入参,参考API文档:https://doc.lianlianpay.com/doc-api/open-api/refund#%E5%85%A5%E5%8F%82
  },
  //成功回调
  successcb: function (res) {
   
  },
  //失败回调
  failcb: function (res) {
   
  },
});

退款结果查询调用示例

LLPay.refundResultQuery({
  params: {
    //请求入参,参考 API文档:https://doc.lianlianpay.com/doc-api/open-api/refund-result#%E5%85%A5%E5%8F%82
  },
  //成功回调
  successcb: function (res) {
    
  },
  //失败回调
  failcb: function (res) {
    
  },
});

支付取消调用示例

LLPay.payCancel({
  params: {
    //请求入参,参考API文档:https://doc.lianlianpay.com/doc-api/open-api/pay-cancel#%E5%85%A5%E5%8F%82
  },
  //成功回调
  successcb: function (res) {
    
  },
  //失败回调
  failcb: function (res) {
    
  },
});

物流上传调用示例

LLPay.shipmentsUpload({
  params: {
    //请求入参,参考API文档:https://doc.lianlianpay.com/doc-api/open-api/logistics#%E5%85%A5%E5%8F%82
  },
  //成功回调
  successcb: function (res) {
    
  },
  //失败回调
  failcb: function (res) {
    
  },
});

获取iframe支付token调用示例

LLPay.getTokenIframe({
  //成功回调
  successcb: function (res) {
    
  },
  //失败回调
  failcb: function (res) {
    
  },
});

支付/退款通知解析调用示例

/**
 * @params body:String, 通知body,为json字符串
 * @params header:{ [key: string]: string } 通知头部,类型为Object
 * @return {Object}
 * {
 *    verifySignResult: true | false, //验签结果
 *    verifySignMessage: '验签成功'|'验签失败',//验签成功或失败的描述
 *    body
 * }
 *
 */
LLPay.llNotice(body, header);