【发布时间】:2019-10-02 23:25:53
【问题描述】:
我想在我的应用程序中添加 UPI 支付,目前正在使用 expo 工具创建应用程序,但现在我被卡住了,因为仅使用 js 无法找到任何直接实现,并要求我退出 expo。如果有任何方法可以在不退出世博会的情况下实现 UPI,因为世博会让事情变得非常容易。
我已尝试实现文档中提供的 react-native-upi-payment 简单代码,但它没有继续前进,并要求我浏览不在 expo 项目内的 android manifest。
import React from 'react'
import RNUpiPayment from 'react-native-upi-payment'
import { View, StyleSheet, Container } from 'react-native'
import { Input, Button } from 'react-native-elements'
import { Constants } from 'expo'
export default class PaymentScreen extends React.Component {
static navigationOptions = {
header: null
}
goToBhimUPI = () => {
RNUpiPayment.initializePayment({
vpa: 'someupi@ybl', // or can be john@ybl or mobileNo@upi
payeeName: 'Name',
amount: '1',
transactionRef: 'some-random-id'
}, this.successCallback, this.failureCallback);
}
failureCallback = (data) =>{
console.log(data)
}
successCallback = (data) => {
console.log(data)
}
render() {
return(
<Button
containerStyle = {styles.button}
type = 'clear'
title = 'Bhim UPI'
onPress = {this.goToBhimUPI}
/>
)
}
}
我希望这个模块将我带到 UPI 支付网关并返回到调用它的地方。目前这给了我错误:(未定义不是一个对象(评估'UpiModule.initializePayment'))
【问题讨论】:
-
我也遇到同样的错误
-
退出expo后可以进行upi支付
标签: react-native expo upi