Skip to content

Commit

Permalink
Usage example fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
brijesh888 committed Feb 27, 2021
1 parent 617109d commit 907f316
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,37 @@ For RN Version < 0.60 (no autolinking)

For RN Version > 0.60 (with autolinking) nothing needs to be done other than installing the package.

Add `pod 'RNCardConnectReactLibrary', :path => '../node_modules/react-native-card-connect'` in your pod file for ios

## Usage
```javascript
import CardConnect from 'react-native-card-connect';
import moment from 'moment';

async tokenizeCard() {
async tokenizeCard() {

try {
try {

const siteId = "fts";
const cardNumber = "42424242424242";
const expiryDate = moment('12/22', 'MM/YY').toISOString();
const cVc = "123";
const siteId = "fts";
const cardNumber = "42424242424242";
const expiryDate = moment('12/22', 'MM/YY').toISOString();
const cVc = "123";

CardConnect.setupConsumerApiEndpoint(site_id + ".cardconnect.com:443");
CardConnect.setupConsumerApiEndpoint(siteId + ".cardconnect.com:443");

const token = await CardConnect.getCardToken(
cardNumber,
expiryDate
cVc
);
const token = await CardConnect.getCardToken(
cardNumber,
expiryDate,
cVc
);

console.log(token)
console.log(token)

} catch (error) {
} catch (error) {

console.log(error.toString());
console.log(error.toString());

}
}
```

Expand Down

0 comments on commit 907f316

Please sign in to comment.