我想集成flutterwave到我的react native应用程序中。我下载了他们的 npm 包flutterwave-react-native并按照他们的教程进行操作,但仍然无法做到。我在Github上使用他们的示例片段,但收到一条错误消息:
this.usePaymentLink 不是函数
我到处搜索但找不到this.usePaymentLink定义的位置。您可以查看我的代码片段并告诉我我错过了什么以及this.usePaymentLink看起来如何。
import React from 'react';
import {View, TouchableOpacity} from 'react-native';
import {FlutterwaveInit} from 'flutterwave-react-native';
class MyCart extends React.Component {
abortController = null;
componentWillUnmout() {
if (this.abortController) {
this.abortController.abort();
}
}
handlePaymentInitialization = () => {
this.setState({
isPending: true,
}, () => {
// set abort controller
this.abortController = new AbortController;
try {
// initialize payment
const paymentLink = await FlutterwaveInit(
{
tx_ref: …Run Code Online (Sandbox Code Playgroud)