react-native支付宝支付react-native-yunpeng-alipay

本文详细介绍了如何在React Native项目中集成并实现支付宝支付功能,通过react-native-yunpeng-alipay库进行封装,帮助开发者简化移动应用的支付流程。
摘要由CSDN通过智能技术生成

对于支付宝的支付做了封装

import Alipay from 'react-native-yunpeng-alipay';

var requestCommon ={
    //支付宝公共支付调用函数
    usePay:async function(tx_sn,successFunction,errorFunction){
        return fetch('http://'+ip+'/*****/***', {//获取用户支付的链接
            method: 'POST',
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded',
            },
            body: 'login_user_sn='+login_user_sn+'&aes_timestamp='+second+'&tx_sn='+tx_sn
        }).then((response) => response.json())
            .then((responseJson) => {
                console.log(responseJson,"调用app支付");
                let res = responseJson;
                if(res.result==0){
                    Alipay.pay(res.url_argv).then(function(data){
                        console.log(data,"
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值