簡體   English   中英

如何在我的React-Native-App中實施UPI付款?

[英]How to Implement UPI Payment in my React-Native-App with Expo?

我想在我的應用程序中添加UPI付款,目前正在使用expo工具創建應用程序,但現在我卡住了,因為無法通過僅使用js找到任何直接實現,並要求我從世博會中彈出。 如果有任何方法我可以在不退出世博會的情況下實施UPI,因為世博會讓事情變得非常簡單。

我試圖實現文檔中為react-native-upi-payment提供的簡單代碼,但它沒有繼續前進並要求我通過不在expo項目內的android清單。

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支付網關並返回到它所在的地方。 目前這給了我錯誤:( undefined不是一個對象(評估'UpiModule.intializePayment'))

您可以使用react-native-upi-payment支持所有類型的upi,或者使用phonepesdk僅用於手機集成

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM