nativescript-ravepay-simple
Flutterwave 插件为 Nativescript。使用 Flutterwave 在您的 Nativescript 应用中接收付款
npm i --save nativescript-ravepay-simple
- 版本:0.0.6
- GitHub: https://github.com/dammynex/nativescript-ravepay-simple
- NPM: https://npmjs.net.cn/package/nativescript-ravepay-simple
- 下载
- 昨天: 0
- 上周: 1
- 上个月: 17
nativescript-ravepay-simple
使用 Flutterwave 的 RavePay 接收付款
需求
iOS >= 11.0 -> RaveSDK-iOS
Android -> rave-android
安装
tns plugin add nativescript-ravepay-simple
屏幕截图
iOS
Android
用法
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 | 是 |
客户的电子邮件地址 | null | 是 | |
phoneNumber | 客户的有效电话号码 | null | 是 |
firstName | 客户的名字 | null | 是 |
lastName | 客户的姓氏 | null | 是 |
encryptionKey | 您的 RavePay 加密密钥 | null | 是 |
publicKey | 您的 RavePay 公开密钥 | null | 是 |
transactionRef | 支付交易参考 | null | 是 |
许可证
Apache 许可证版本 2.0,2004 年 1 月