React-Native调用支付宝,微信
- https://www.pingxx.com/docs/downloads
- Ping++ 是为移动端应用以及 PC 网页量身打造的下一代支付系统,通过一个 SDK 便可以同时支持移动端以及 PC 端网页的多种主流支付渠道,你只需要一次接入即可完成多个渠道的接入。 Ping++ SDK 包括 Client SDK 和 Server SDK 两部分,支持主流的七种后端开发语言,适配了 Android,iOS 和 HTML5 三种移动端平台以及 PC 端网页。
支持以下渠道支付
支付宝 (alipay)
微信支付 (wx)
银联支付(upacp)
百付宝Wap (bfb_wap)
QQ钱包 (qpay) /**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/ import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
TouchableOpacity
} from 'react-native'; var NetUtil = require('./netutil.js');
var Pingpp = require('pingpp-react-native'); export default class PingppDemoApp extends Component {
setDebugModel(enabled) {
Pingpp.setDebugModel(enabled);
}; pay(channel) {
NetUtil.postJson(
"http://218.244.151.190/demo/charge",
{amount: , channel: channel, order_no: new Date().getTime()},
function(object) {
Pingpp.createPayment(
{
"object":object,
"scheme":"pingppdemoapp"
}, function(res, error) {
alert(res);
console.log(error);
alert(JSON.stringify(error));
}
);
}
);
} render() {
return (
<View style={styles.container}>
<TouchableOpacity onPress = {()=>{this.pay("alipay")}}>
<Text style={styles.welcome}>支付宝</Text>
</TouchableOpacity>
<TouchableOpacity onPress={()=>{this.pay("wx")}}>
<Text style={styles.welcome}>微信</Text>
</TouchableOpacity>
<TouchableOpacity onPress={()=>{this.pay("upacp")}}>
<Text style={styles.welcome}>银联</Text>
</TouchableOpacity>
<TouchableOpacity onPress={()=>{this.pay("qpay")}}>
<Text style={styles.welcome}>QQ钱包</Text>
</TouchableOpacity>
<TouchableOpacity onPress={()=>{this.setDebugModel(true)}}>
<Text style={styles.welcome}>开启调试</Text>
</TouchableOpacity>
</View>
);
}
} const styles = StyleSheet.create({
container: {
flex: ,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: ,
textAlign: 'center',
margin: ,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: ,
},
});
React-Native调用支付宝,微信的更多相关文章
- react native 调用Android原生方法
来源:https://www.youtube.com/watch?v=WmJpHHmOKM8 教程:https://www.youtube.com/watch?v=GiUo88TGebs Breaki ...
- [RN] React Native代码转换成微信小程序代码的转换引擎工具
React Native代码转换成微信小程序代码的转换引擎工具 https://github.com/areslabs/alita
- 【React Native 实战】微信登录
1.前言 在今天无论是游戏开发还是app开发,微信作为第三方登录必不可少,今天我们就用react-native-wechat实现微信登录,分享和支付同样的道理就不过多的介绍了. 2.属性 1)regi ...
- React Native 调用 Web3(1.x) 的正确姿势
1 创建项目 react-native init lm1 cd lm1 2 安装依赖包 yarn add node-libs-browser 3 创建 rn-cli.config.js 脚本 cons ...
- React Native调用系统浏览器
import { Linking} from 'react-native'; //使用系统浏览器访问指定URLexport const contactBaidu = () => { var ba ...
- [书籍精读]《React Native精解与实战》精读笔记分享
写在前面 书籍介绍:本书由架构师撰写,包含ReactNative框架底层原理,以及与iOS.Android混合开发案例,精选了大量实例代码,方便读者快速学习.主要内容分为两大部分,第1部分" ...
- 使用React Native来撰写跨平台的App
React Native 是一个 JavaScript 的框架,用来撰写实时的.可原生呈现 iOS 和 Android 的应用.其是基于 React的,而 React 是 Facebook 的用于构建 ...
- H5、React Native、Native应用对比分析
每日更新关注:http://weibo.com/hanjunqiang 新浪微博!iOS开发者交流QQ群: 446310206 "存在即合理".凡是存在的,都是合乎规律的.任何新 ...
- 《React Native 精解与实战》书籍连载「Android 平台与 React Native 混合开发」
此文是我的出版书籍<React Native 精解与实战>连载分享,此书由机械工业出版社出版,书中详解了 React Native 框架底层原理.React Native 组件布局.组件与 ...
- React Native之支付集成(微信 支付宝)(ios android)
React Native之支付集成(微信 支付宝)(ios android) 一,需求分析 1.1,app在线充值与提现 二,技术介绍与集成 2.1,微信支付 2.1.1,Android配置 详细配置 ...
随机推荐
- windows安装linux虚拟机、修改apt源
记录一下windows安装虚拟机以及初始配置的一些坑. 安装VMware Workstation 直接百度搜索VMware,选择合适的版本下载: 按照一般软件的安装步骤安装VMware Worksta ...
- nginx升级至1.12.1版本
nginx升级至1.12.1 编号 名称 说明 1 nginx-1.12.1.tar.gz nginx安装程序 2 nginx_upstream_check_module-master.zip 实现后 ...
- 全局应用程序类(Global.asax)
注:该部分参考的园区的“积少成多”的 <ASP.NET MVC中的Global.asax文件> . 1.Global.asax文件介绍 global.asax这个文件包含全局应用程序事件 ...
- LGPL 与GPL的区别
GPL(GNU General Public License) 我们很熟悉的Linux就是采用了GPL.GPL协议和BSD, Apache Licence等鼓励代码重用的许可很不一样.GPL的出发点是 ...
- NTP路由器配置
14.1. 路由器日志显示时间戳 提问 在路由器 的日志和排错信息里面显示时间 回答 Router#configure terminal Enter configuration commands, o ...
- 7. Docker Compose 项目
- python中调用cmd
1. 使用os.system("cmd") 这是最简单的一种方法,特点是执行的时候程序会打出cmd在linux上执行的信息.使用前需要import os. os.system(&q ...
- shell脚本中${var1:-var2}
在一个shell脚本中看见一行代码: DATE=${:-`date "+%Y%m%d" -d "-1 day"`} 查了一下 ${var1:-var2} 这种结 ...
- 几道坑人的PHP面试题 试试看看你会不会也中招
这篇文章主要介绍了几道坑人的PHP面试题,试试看看你会不会也中招,这些题目都用了一些障眼法,需要你有一双火眼金睛哦,需要的朋友可以参考下 这几道题是在德问上看到的,感觉挺有意思,拿来给大家分享其中的陷 ...
- JSTL-3
.循环标签:forEach标签, forTokens标签 <c:forEach>:标签:该标签根据循环条件遍历集合(Collection)中的元素 <c:forEach [var=& ...