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-alipay-pay

v1.0.3

Published

Cordova Alipay Plugin

Downloads

7

Readme

cordova集成支付宝插件

前言

插件编写于15年11月份,如果之后支付宝更换了支付方式,本插件会失效,在此之前可以正常使用

说明

  • SDK

    需要和支付宝签约移动支付,然后下载SDK,里面有Android、IOS提供了完整的文档,看需求选择业务需要的。

  • 支持平台

    Android

使用

在添加插件之前,需要配置与支付宝签约的帐号密匙

yourProject\plugins\alipay\src\android\alipay\PayKeys.java

package com.yumemor.cordova.alipay;

/**
 * 商户配置信息
 * 
 * @author yy
 * 
 */
public final class PayKeys {

	// 合作身份者id,以2088开头的16位纯数字
	public static final String DEFAULT_PARTNER = "";

	// 收款支付宝账号
	public static final String DEFAULT_SELLER = "";

	// 商户私钥 自助生成
	public static final String PRIVATE = "";

	// 支付宝默认公钥 请勿修改
	public static final String PUBLIC = "";

}

添加插件到你的项目

cordova plugins add cordova-plugin-alipay-pay

js调用

window.plugins.Alipay.pay(out_trade_no,subject,body,total_fee,successCallback,errorCallback,callbackUrl);

参数说明:

  • out_trade_no: 订单号(不能重复)
  • subject: 商品名称
  • body: 描述
  • total_fee: 价格
  • successCallback: 成功回调
  • errorCallback: 失败回调
  • callbackUrl: 回调地址/支付宝调用

当调用方法后如果安装了支付宝会调用支付宝进行支付,如果没有则用HTML5支付。

截图

支付宝:

image

HTML5:

image

回调:

image

  • 注意

    如果配置错了密匙,是不会打开支付界面的。