nativescript-ravepay-simple
Flutterwave 插件为 Nativescript。使用 Flutterwave 在您的 Nativescript 应用中接收付款
npm i --save nativescript-ravepay-simple

nativescript-ravepay-simple

使用 Flutterwave 的 RavePay 接收付款

需求

iOS >= 11.0 -> RaveSDK-iOS

Android -> rave-android

安装

tns plugin add nativescript-ravepay-simple

屏幕截图

iOS

Alt text

Android

Alt text

用法

    import { RavepaySimple } from 'nativescript-ravepay-simple'

let rave = new RavePaySimple()
rave.amount = "250"
rave.email = "[Email]"
rave.encryptionKey = "[Encryption Key]"
rave.publicKey = "[Public Key]"
rave.firstName = "Salawu"
rave.lastName = "Oluwadamilola"
rave.phoneNumber = "[Phone]"
rave.isStaging = true
rave.transactionRef = "lfneioefjoief"

rave.pay()
.then((res) => {
let {status, data} = res

switch(status) {
case RavepaySimple.PAYMENT_SUCCESS:

//Successful payment

/* It is recommended you confirm transaction
before giving value */


let reference = data.txRef
console.log(reference);
break;

case RavepaySimple.PAYMENT_ERROR:
//Payment failed
console.log('Payment Error');
break;

case RavepaySimple.PAYMENT_CANCELLED:
//User cancelled payment
setTimeout(() => alert('Payment cancelled'), 1000);
break;
}
})
.catch(err => {
//Something totally went wrong
console.log(err)
})

API

属性 描述 默认 必需
country 收费国家 NG
currencyCode 收费货币 NGN
isStaging 设置测试或实时模式 true
amount 收费金额 null
email 客户的电子邮件地址 null
phoneNumber 客户的有效电话号码 null
firstName 客户的名字 null
lastName 客户的姓氏 null
encryptionKey 您的 RavePay 加密密钥 null
publicKey 您的 RavePay 公开密钥 null
transactionRef 支付交易参考 null

许可证

Apache 许可证版本 2.0,2004 年 1 月