npm i --save nativescript-open-pay
- 版本:1.0.0
- GitHub: https://github.com/NeriCodec/nativescript-open-pay
- NPM: https://npmjs.net.cn/package/nativescript-open-pay
- 下载
- 昨日: 0
- 上周: 0
- 上个月: 0
Openpay

支持
支持 Android & iOS。
安装
tns plugin add nativescript-open-pay
用法
在演示中您将找到一个测试令牌以快速测试
import { Observable } from "tns-core-modules/data/observable";
import { OpenPay, Card } from "nativescript-open-pay";
export class HelloWorldModel extends Observable {
private openPay: OpenPay;
constructor() {
super();
this.openPay = new OpenPay();
this.openPay.setup(
"merchant_id", // merchantId
"api_key", // apiKey
false // ProductionMode Sandbox = false
);
let card: Card = {
holderName: "Juan Perez Ramirez",
cardNumber: "4111111111111111",
expirationMonth: "12",
expirationYear: "20",
cvv2: "110"
};
this.openPay
.createToken(card)
.then(function(args) {
console.dir(args);
})
.catch(function(error) {
console.log(error);
});
}
}
许可证
Apache 许可证版本 2.0,2004 年 1 月