Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/happones/nativescript-conekta
Nativescript Plugin for Conekta
https://github.com/happones/nativescript-conekta
conekta conekta-api nativescript nativescript-plugin
Last synced: 26 days ago
JSON representation
Nativescript Plugin for Conekta
- Host: GitHub
- URL: https://github.com/happones/nativescript-conekta
- Owner: happones
- License: apache-2.0
- Created: 2018-04-09T20:01:12.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-07-16T22:49:26.000Z (over 6 years ago)
- Last Synced: 2024-11-13T12:44:56.597Z (about 2 months ago)
- Topics: conekta, conekta-api, nativescript, nativescript-plugin
- Language: TypeScript
- Size: 2.09 MB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Nativescript Conekta Sdk
Works on ios and android
## Installation
Install with following command:
```
tns plugin add nativescript-conekta-sdk
// or
npm i nativescript-conekta-sdk
```
So while cloning from the repo![NativeScript demo android](https://github.com/happones/nativescript-conekta/blob/master/screenshots/android.png?raw=true)
![NativeScript demo ios](https://github.com/happones/nativescript-conekta/blob/master/screenshots/ios.png?raw=true)
## Usage
TypeScript
```Typescript
import { TNSConekta } from 'nativescript-conekta-sdk'private conekta: TNSConekta;
this.conekta = new TNSConekta()
this.conekta.setPublicKey('your_key')
this.conekta.createToken(params) // Promise, params is required, (name, number, cvc, exp_month, exp_year)
```
JavaScript
```Javascript
const TNSConekta = require('nativescript-conekta-sdk').TNSConekta;const conekta = new TNSConekta()
conekta.setPublicKey('your_key')
conekta.setLanguage('en') // only in android
conekta.createToken(params) // Promise, params is required, (name, number, cvc, exp_month, exp_year)```
Handle errors
JavaScript
```Javascript
conekta.createToken(params).then(success => {
// your success function
}).catch(error => {
alert(error.message_to_purchaser)
}) // Promise, params is required, (name, number, cvc, exp_month, exp_year)```
**Wants card validation**
Use this plugin [Credit Card Validator ](https://github.com/braintree/card-validator)
## License
Apache License Version 2.0, January 2004