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

cordova-plugin-gli-alipay

v1.0.2

Published

支付宝支付插件,alipay payment

Downloads

4

Readme

Cordova 支付宝支付插件

安装命令

cordova plugin add https://github.com/EiyouZk/cordova-plugin-alipay.git

使用方法

window.alipay.pay({
	tradeNo: tradeNo,
	subject: "测试标题",
	body: "我是测试内容",
	price: 0.02,
	notifyUrl: "http://your.server.notify.url"
}, function(successResults){alert(results)}, function(errorResults){alert(results)});

参数说明

  • tradeNo 这个是支付宝需要的,应该是一个唯一的ID号
  • subject 这个字段会显示在支付宝付款的页面
  • body 订单详情,没找到会显示哪里
  • price 价格,支持两位小数
  • payinfo 订单休息
  • function(successResults){} 是成功之后的回调函数
  • function(errorResults){} 是失败之后的回调函数

注:改变之前加密、签名均在客户端的方式,有服务端生成订单信息以及加密、签名之后,通过payinfo传入,所以实际参数只有payinfo以及成功或者失败的回调函数。

successResultserrorResults分别是成功和失败之后支付宝SDK返回的结果,类似如下内容

// 成功
{
	resultStatus: "9000",
	memo: "",
	result: "partner=\"XXXX\"&seller_id=\"XXXX\"&out_trade_no=\"XXXXX\"..."	
}
// 用户取消
{
	memo: "用户中途取消", 
	resultStatus: "6001", 
	result: ""
}
  • resultStatus的含义请参照这个官方文档:客户端返回码
  • memo:一般是一些纯中文的解释,出错的时候会有内容。
  • result: 是所有支付请求参数的拼接起来的字符串。

关于私钥

这里用的私钥一定是PKCS格式的,详细生成步骤请参照官方文档:RSA私钥及公钥生成

文档中描述的这一步:OpenSSL> pkcs8 -topk8 -inform PEM -in rsa_private_key.pem -outform PEM -nocrypt会将生成的私钥打印到屏幕上,记得复制下来。

手动安装

  1. 使用git命令将插件下载到本地,并标记为$CORDOVA_PLUGIN_DIR

     git clone https://github.com/CUGCQH/cordova-plugin-alipay.git && cd cordova-plugin-alipay && export CORDOVA_PLUGIN_DIR=$(pwd)
  2. 安装

     cordova plugin add $CORDOVA_PLUGIN_DIR --variable PARTNER_ID=[你的商户PID可以在账户中查询] --variable SELLER_ACCOUNT=[你的商户支付宝帐号]