ioinc2沿彭、3方式:cordova-alipay-chenyu-ionic
js方式調(diào)用:cordova-alipay-chenyu
1.插件提供支付寶支付
2.本插件是基于cordova開發(fā)的支付寶支付插件, 凡是基于cordova的webapp項(xiàng)目就可以調(diào)用本插件
3.插件提供angular/ionic項(xiàng)目ts調(diào)用方式
4.你們支持是我們的開發(fā)動(dòng)力瞧柔、如果調(diào)用問題請(qǐng)聯(lián)系我們
5.ionic2 npm 地址:https://www.npmjs.com/package/cordova-alipay-chenyu-ionic
cordova plugin add cordova-alipay-chenyu --variable APP_ID=你的支付寶id
npm i cordova-alipay-chenyu-ionic --save
前者為cordova插件睦裳,后者為 ts調(diào)用方式
前者為cordova插件:地址:https://www.npmjs.com/package/cordova-alipay-chenyu
ts調(diào)用:詳情參考http://ionicframework.com/docs/native/
### //簽名字符串
首先在app.model.ts引入
import {AlipayChenyu} from "cordova-alipay-chenyu-ionic";
providers: [
AlipayChenyu
]
//為什么需要注入詳細(xì)參考anglar 依賴注入
//https://angular.cn/
//在調(diào)用的頁(yè)面模塊引入
import {AlipayChenyu} from "cordova-alipay-chenyu-ionic";
//同樣你要在constructor,注入public alipayChenyu:AlipayChenyu
constructor(public alipayChenyu:AlipayChenyu,public navCtrl: NavController) {
}
//調(diào)用方式
let orderStr="";
this.alipayChenyu.coolMethod(orderStr).then((data)=>{
console.log(data.resultStatus);
},(error)=>{
})
返回結(jié)果示例 iOS|Android
{
"memo" : "xxxxx",
"result" : "{
\"alipay_trade_app_pay_response\":{
\"code\":\"10000\",
\"msg\":\"Success\",
\"app_id\":\"2014072300007148\",
\"out_trade_no\":\"081622560194853\",
\"trade_no\":\"2016081621001004400236957647\",
\"total_amount\":\"0.01\",
\"seller_id\":\"2088702849871851\",
\"charset\":\"utf-8\",
\"timestamp\":\"2016-10-11 17:43:36\"
},
\"sign\":\"NGfStJf3i3ooWBuCDIQSumOpaGBcQz+aoAqyGh3W6EqA/gmyPYwLJ2REFijY9XPTApI9YglZyMw+ZMhd3kb0mh4RAXMrb6mekX4Zu8Nf6geOwIa9kLOnw0IMCjxi4abDIfXhxrXyj********\",
\"sign_type\":\"RSA2\"
}",
"resultStatus" : "9000"
}
[詳情參考支付寶文檔](https://docs.open.alipay.com/204/105301/)
QQ:250187715
QQ群:390736068