https://github.com/nuremx/conekta-react-native
React Native Conekta wrapper for iOS (Android missing)
https://github.com/nuremx/conekta-react-native
conekta ios payments react-native swift
Last synced: about 1 month ago
JSON representation
React Native Conekta wrapper for iOS (Android missing)
- Host: GitHub
- URL: https://github.com/nuremx/conekta-react-native
- Owner: nuremx
- Created: 2018-08-18T21:18:41.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-01-27T16:34:32.000Z (over 6 years ago)
- Last Synced: 2025-04-13T03:03:27.096Z (about 2 months ago)
- Topics: conekta, ios, payments, react-native, swift
- Language: Swift
- Homepage: https://conekta.com
- Size: 354 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Conekta React Native [](https://badge.fury.io/js/conekta-react-native) [](https://swift.org)
> Conekta online payment processing platform on React Native
> **Currently iOS only**
## Installation
```bash
yarn add conekta-react-native # or npm i
```Link the module
```bash
react-native link conekta-react-native
```#### iOS Notes
Check that the Libraries group in Xcode have `RNConekta` and the project settings include `libRNConekta` in Linked Frameworks and Libraries. See [Manual Linking](https://facebook.github.io/react-native/docs/linking-libraries-ios).
**Important**. Since this module uses Swift, and RN projects are based in Obj-C, add an empty Swift file inside your project (no bridging header required), this will remove linked Xcode error. See related [Stack Overflow Post](https://stackoverflow.com/questions/50096025/it-gives-errors-when-using-swift-static-library-with-objective-c-project)
## Usage
With async/await:
```javascript
const conekta = new Conekta('key_KJysdbf6PotS2ut2')const card = conekta.createCard({
number: '4242424242424242',
name: 'Julian Ceballos',
cvc: '123',
expMonth: '10',
expYear: '2018',
})try {
const data = await card.createToken()
console.log('DATA', data)
} catch (error) {
console.log('ERROR', error)
}
```Or if you prefer promises:
```javascript
const conekta = new Conekta("key_KJysdbf6PotS2ut2");const card = conekta.createCard({
number: "4242424242424242",
name: "Julian Ceballos",
cvc: "123",
expMonth: "10",
expYear: "2018"
});card
.createToken()
.then(data => {
console.log("DATA", data);
})
.catch(error => {
console.log("ERROR", error);
});
```## TODO
- [ ] Android version
- [ ] Optimization
- [ ] TestingPlease feel free to post a PR
## Licence
MIT