Giter VIP home page Giter VIP logo

cordova-plugin-alipay's Introduction

cordova-plugin-alipay

Makes your Cordova application enable to use the Alipay SDK for mobile payment with Alipay App or Mobile Web. Requires cordova-android 4.0 or greater.

ChangeLogs

本cordova插件是基于支付宝App支付SDK的Demo实现

  • 升级支付宝SDK版本到20160825;

  • 修改了一些bug;

  • 支持Android和iOS Alipay SDK ###主要功能

  • 主要功能是:服务器把订单信息签名后,调用该插件调用支付宝sdk进行支付,支付完成后如支付成功,如果是9000状态,还要去服务端去验证是否真正支付

Install 安装

The following directions are for cordova-cli (most people).

  • Open an existing cordova project, with cordova-android 4.0.0+, and using the latest CLI. TBS X5 variables can be configured as an option when installing the plugin

  • Add this plugin

    cordova plugin add https://github.com/offbye/cordova-plugin-alipay.git --variable PARTNER_ID=[你的商户PID可以在账户中查询]

    (对于android,可以不传PARTNER_ID)

    offline:下载后再进行安装 cordova plugin add YOUR_DIR

支持平台

	Android IOS

Android API

  • js调用插件方法
    //第一步:订单在服务端签名生成订单信息,具体请参考官网进行签名处理
    var payInfo  = "xxxx";

    //第二步:调用支付插件        	
    cordova.plugins.AliPay.pay(payInfo,function success(e){},function error(e){});

	 //e.resultStatus  状态代码  e.result  本次操作返回的结果数据 e.memo 提示信息
	 //e.resultStatus  9000  订单支付成功 ;8000 正在处理中  调用function success
	 //e.resultStatus  4000  订单支付失败 ;6001  用户中途取消 ;6002 网络连接出错  调用function error
	 //当e.resultStatus为9000时,请去服务端验证支付结果
	 			/**
				 * 同步返回的结果必须放置到服务端进行验证(验证的规则请看https://doc.open.alipay.com/doc2/
				 * detail.htm?spm=0.0.0.0.xdvAU6&treeId=59&articleId=103665&
				 * docType=1) 建议商户依赖异步通知
				 */

cordova-plugin-alipay's People

Contributors

chenyuanchn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cordova-plugin-alipay's Issues

ios版插件安装报错

相关的三个没有关贴的问题
#1
#3
#5
处理方式,我是用的cordova

  1. 将插件下载到本地后修改plugin.xml中 ios部分的配置
<platform name="ios"> 
...
<resource-file src="src/lib/AlipaySDK.bundle"/> // 这是错误的,src/后少个ios目录,修改为
<resource-file src="src/ios/lib/AlipaySDK.bundle"/>
...
</platform>
  1. 通过本地路劲的方式安装此插件 cordova plugin add 本地路劲 --variable PARTNER_ID=xxx

之所以通过本地安装的方式是避免重复的修改

可以考虑本地订单参数组装吗?

这里应该是可以生成订单的吧?要先去服务器组装订单返回再请求alipay?为什么不直接在请求前根据关键参数组装好直接请求?

Failed to install 'cordova-plugin-offbye-alipay':Error: Uh oh! for iOS

Installing "cordova-plugin-offbye-alipay" for ios
Using this version of Cordova with older version of cordova-ios is being deprecated. Consider upgrading to [email protected] or n
ewer.
Error during processing of action! Attempting to revert...
Failed to install 'cordova-plugin-offbye-alipay':Error: Uh oh!
cannot find "E:\demoapp\plugins\cordova-plugin-offbye-alipay\src\lib\AlipaySDK.bundle" ios
at module.exports.resource-file.install (C:\Users\heh\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\pl
ugman\platforms\ios.js:166:48)
at C:\Users\heh\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\platforms\PlatformApiPoly.js:660:27
at Object.ActionStack.process (C:\Users\heh\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-common\src\ActionSta
ck.js:56:25)
at PlatformApiPoly.addPlugin (C:\Users\heh\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\platforms\Pla
tformApiPoly.js:255:20)
at handleInstall (C:\Users\heh\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\install.js:611:6)

at C:\Users\heh\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\install.js:407:28
at _fulfilled (C:\Users\heh\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:787:54)
at self.promiseDispatch.done (C:\Users\heh\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:816:30)
at Promise.promise.promiseDispatch (C:\Users\heh\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:749:13)
at C:\Users\heh\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:509:49

Error: Uh oh!

请问ios的怎么加载进去呢?

Cannot find resource file [project name]/plugins/cordova-plugin-alipay/src/lib/AlipaySDK.bundle " for plugin cordova-plugin-alipay in iOS platform

路径有错

你那个XML文件的RESOURCE路径错了,掉了个iOS子目录

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.