From 907f316487714c0e059a3f5f754467443b39ebb5 Mon Sep 17 00:00:00 2001 From: Brij Date: Sat, 27 Feb 2021 15:08:19 +0530 Subject: [PATCH] Usage example fixed --- README.md | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 23da3d8..1cc5de7 100644 --- a/README.md +++ b/README.md @@ -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()); + } } ```