card-react-native 0.0.10 → 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,37 +2,47 @@
2
2
 
3
3
  Tap Card React-Native Wrapper
4
4
 
5
- # Card-React-Native
6
-
7
- We at [Tap Payments](https://www.tap.company/) strive to make your payments easier than ever. We as a PCI compliant company, provide you a from the self solution to process card payments in your iOS apps.
8
-
9
- # Steps overview
10
- ```mermaid
11
- sequenceDiagram
12
-
13
- participant A as App
14
- participant T as Tap
15
- participant C as Card React Native
16
-
17
- A->>T: Regsiter app.
18
- T-->>A: Public key.
19
- A ->> C : Install SDK
20
- A ->> C : Init TapCardView
21
- C -->> A : tapCardView
22
- A ->> C : pass Config and callbacks
23
- C -->> A: onReady()
24
- C -->> C : Enter card data
25
- C -->> A : onBinIdentification(data)
26
- C -->> A : onValidInput
27
- A ->> C : tapCardView.generateTapToken()
28
- C -->> A : onSuccess(data)
5
+
6
+ # Introduction[]()
7
+
8
+ Before diving into the development process, it's essential to establish the prerequisites and criteria necessary for a successful build. In this step, we'll outline the specific iOS requirements, including the minimum SDK version and other important details you need to consider. Let's ensure your project is set up for success from the very beginning.
9
+
10
+
11
+ # Sample Demo[]()
12
+
13
+
14
+ https://github.com/Tap-Payments/Card-React-Native/assets/121755223/5a926c3b-45f3-4ed8-94e2-e1e69deb55a3
15
+
16
+
17
+
18
+ # Step 1: Requirements[]()
19
+
20
+ - React native 0.64
21
+ - - A minimum [Android SDK/API level](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) of 24+
22
+ - In order to be able to use card scanner functionality, please make sure you added the correct permission key-value in the iOS project info.plist.
23
+
24
+ ```xml
25
+ <key>NSCameraUsageDescription</key>
26
+ <string>Card SDK needs it for scanner functionality</string>
27
+ ```
28
+ - in order to accept online payments on your application, you will need to add at least the Internet permission in the manifest file.
29
+ ```xml
30
+ <uses-permission android:name="android.permission.INTERNET" /> //get internet access to complete online payments
31
+ <uses-permission android:name="android.permission.CAMERA"/>
32
+ <uses-permission android:name="android.permission.NFC" />
33
+ <uses-feature android:name="android.hardware.nfc" android:required="true" />
34
+ <uses-feature
35
+ android:name="android.hardware.camera"
36
+ android:required="true" />
37
+
29
38
  ```
30
39
 
31
- # Get your Tap keys
40
+ # Step 2: Get Your Public Keys[]()
41
+
42
+ While you can certainly use the sandbox keys available within our sample app which you can get by following the [installation](https://developers.tap.company/docs/android-card-sdk#step-3-installation-using-gradle) process, however, we highly recommend visiting our [onboarding](https://register.tap.company/ae/en/sell) page, there you'll have the opportunity to register your package name and acquire your essential Tap Key for activating Card-iOS integration.
32
43
 
33
- You can always use the example keys within our example app, but we do recommend you to head to our [onboarding](https://register.tap.company/sell) page. You will need to register your `bundle id` to get your `Tap Key` that you will need to activate our `Card SDK`.
34
44
 
35
- # Installation
45
+ # Step 3: Installation[]()
36
46
 
37
47
  We got you covered, `card-react-native` can be installed with all possible technologies.
38
48
 
@@ -54,12 +64,32 @@ pod install
54
64
  pod update
55
65
  ```
56
66
 
67
+
68
+
57
69
  # Import the dependency
58
70
  ```Ts
59
71
  import TapCardView from ‘card-react-native’;
60
72
  ```
61
73
 
62
- # Simple integration
74
+ # Step 4: Integrating Card-React-Native[]()
75
+ This integration offers two distinct options: a simple integration designed for rapid development and streamlined merchant requirements, and an advanced integration that adds extra features for a more dynamic payment integration experience.
76
+
77
+ ## Simple Integration[]()
78
+
79
+ Here, you'll discover a comprehensive table featuring the parameters applicable to the simple integration. Additionally, you'll explore the various methods for integrating the SDK, either using storyboard to create the layout and then implementing the controllers functionalities by code, or directly using code. Furthermore, you'll gain insights into card tokenization after the initial payment and learn how to receive the callback notifications.
80
+
81
+ ### Parameters[]()
82
+ Each parameter is linked to the [reference](https://developers.tap.company/docs/card-sdk-ios#reference) section, which provides a more in depth explanation of it.
83
+
84
+
85
+ |Configuration|Description | Required | Type| Sample
86
+ |--|--|--| --|--|
87
+ | operator| This is the `Key` that you will get after registering you bundle id. | True | `String`| `let operator {publicKey: 'pk_test_YhUjg9PNT8oDlKJ1aE2fMRz7'}` |
88
+ | scope| Defines the intention of using the `Card-React-native`. | True | `Scope`| ` let scope = Scope.AuthenticatedToken`|
89
+ | purpose| Defines the intention of using the `Token` after generation. | True | `String`| ` let purpose = "Transaction"` |
90
+ | order| This is the `order id` that you created before or `amount` and `currency` to generate a new order. It will be linked this token. | True | `Order`| ` let order: = { amount: 1, currency: TapCurrencyCode.SAR, description: '', id: '', , reference : ''}` |
91
+
92
+
63
93
  ## Simple widget initialisation
64
94
  ```Ts
65
95
  function MinRequirement() {
@@ -92,7 +122,7 @@ function MinRequirement() {
92
122
  currency: TapCurrencyCode.SAR,
93
123
  },
94
124
  operator: {
95
- publicKey: 'pk_test_YhUjg9PNT8oDlKJ1aE2fMRz7',
125
+ publicKey: 'pk_test_YhUjg9PNT8oDlKJ1aE2fMRz7'
96
126
  },
97
127
  scope: Scope.AuthenticatedToken,
98
128
  customer: {
@@ -126,7 +156,12 @@ function MinRequirement() {
126
156
  );
127
157
  }
128
158
  ```
129
- ## Generate Token
159
+ ### Tokenise the card[]()
160
+
161
+ > 📘
162
+ >
163
+ > A token is like a secret code that stands in for sensitive info, like credit card data. Instead of keeping the actual card info, we use this code. Tokens are hard for anyone to understand if they try to peek, making it a safer way to handle sensitive stuff.
164
+
130
165
  ```Ts
131
166
  const cardSdkRef =
132
167
  React.useRef<ITapCardViewInputRef>() as MutableRefObject<ITapCardViewInputRef>;
@@ -134,6 +169,29 @@ cardSdkRef.current.generateToken();
134
169
  ```
135
170
 
136
171
  # Advanced Integration
172
+ ## Advanced Integration
173
+
174
+ []()
175
+
176
+ The advanced configuration for the Card-iOS integration not only has all the features available in the simple integration but also introduces new capabilities, providing merchants with maximum flexibility. You can find a code below, where you'll discover comprehensive guidance on implementing the advanced flow as well as a complete description of each parameter.
177
+
178
+ ### Parameters[]()
179
+ Each parameter is linked to the [reference]() section, which provides a more in depth explanation of it.
180
+
181
+ |Configuration|Description | Required | Type| Sample
182
+ |--|--|--| --|--|
183
+ | operator| This is the `Key` that you will get after registering you bundle id. | True | `String`| `let operator {publicKey: 'pk_test_YhUjg9PNT8oDlKJ1aE2fMRz7'}` |
184
+ | scope| Defines the intention of using the `Card-React-native`. | True | `Scope`| ` let scope = Scope.AuthenticatedToken`|
185
+ | purpose| Defines the intention of using the `Token` after generation. | True | `String`| ` let purpose = "Transaction"` |
186
+ | order| This is the `order id` that you created before or `amount` and `currency` to generate a new order. It will be linked this token. | True | `Order`| ` let order: = { amount: 1, currency: TapCurrencyCode.SAR, description: '', id: '', , reference : ''}` |
187
+ | invoice| This is the `invoice id` that you want to link this token to if any. | False | `Invoice`| ` let invoice = {"id":""}` |
188
+ | merchant| This is the `Merchant id` that you will get after registering you bundle id. | True | `Merchant`| ` let merchant = {"id":""}` |
189
+ | customer| The customer details you want to attach to this tokenization process. | True | `Customer`| ` let customer = {"id":"", "name":{{"lang":"en","first":"TAP","middle":"","last":"PAYMENTS"}}, "nameOnCard":"TAP PAYMENTS", "editble":true, "contact":{"email":"tap@tap.company", "phone":{"countryCode":"+965","number":"88888888"}}}` |
190
+ | features| Some extra features that you can enable/disable based on the experience you want to provide.. | False | `Features`| ` let features = {"alternativeCardInputs":{ "cardScanner":true,"cardNFC":false}, "acceptanceBadge":true, "customerCards":{"saveCard":false, "autoSaveCard":false}`|
191
+ | acceptance| The acceptance details for the transaction. Including, which card brands and types you want to allow for the customer to tokenize/save. | False | `Acceptance`| ` let acceptance = {"supportedSchemes":{ SupportedBrands.AMEX, SupportedBrands.MASTERCARD, SupportedBrands.VISA, SupportedBrands.MADA,}, "supportedFundSource":{"CREDIT","DEBIT"}, "supportedPaymentAuthentications":["3DS"]}`|
192
+ | fields| Needed to define visibility of the optional fields in the card form. | False | `fieldVisibility`| ` let fieldVisibility ={ "card":{"cardHolder":true}}` |
193
+ | interface| Needed to defines look and feel related configurations. | False | `Interface`| ` let interface = {locale: Locale.en, theme: Theme.dark, edges: Edges.curved, cardDirection: Direction.ltr, colorStyle: 'monochrome', powered: true, "loader": true}` |
194
+ | post| This is the `webhook` for your server, if you want us to update you server to server. | False | `Post`| ` let post = {"url":""}` |
137
195
 
138
196
  ## Advanced configuration initiliasation
139
197
  ```Ts
@@ -158,7 +216,7 @@ const config = React.useMemo(() => {
158
216
  },
159
217
  purpose: Purpose.BillingTransaction,
160
218
  operator: {
161
- publicKey: 'pk_test_YhUjg9PNT8oDlKJ1aE2fMRz7',
219
+ publicKey: 'pk_test_YhUjg9PNT8oDlKJ1aE2fMRz7'
162
220
  },
163
221
  scope: Scope.AuthenticatedToken,
164
222
  customer: {
@@ -246,153 +304,13 @@ const config = React.useMemo(() => {
246
304
  />
247
305
  </View>
248
306
  ```
249
- # Main input documentation
250
- To make our sdk as dynamic as possible, we accept the input in a form of a `dictionary` . We will provide you with a sample full one for reference.
251
- It is always recommended, that you generate this `dictionary` from your server side, so in future if needed you may be able to change the format if we did an update.
252
-
253
- |Configuration|Description | Required | Type| Sample
254
- |--|--|--| --|--|
255
- | operator| This is the `Key` that you will get after registering you bundle id. | True | `String`| `let operator {publicKey: 'pk_test_YhUjg9PNT8oDlKJ1aE2fMRz7'}` |
256
- | scope| Defines the intention of using the `Card-React-native`. | True | `Scope`| ` let scope = Scope.AuthenticatedToken`|
257
- | purpose| Defines the intention of using the `Token` after generation. | True | `String`| ` let purpose = "Transaction"` |
258
- | order| This is the `order id` that you created before or `amount` and `currency` to generate a new order. It will be linked this token. | True | `Order`| ` let order: = { amount: 1, currency: TapCurrencyCode.SAR, description: '', id: '', , reference : ''}` |
259
- | invoice| This is the `invoice id` that you want to link this token to if any. | False | `Invoice`| ` let invoice = {"id":""}` |
260
- | merchant| This is the `Merchant id` that you will get after registering you bundle id. | True | `Merchant`| ` let merchant = {"id":""}` |
261
- | customer| The customer details you want to attach to this tokenization process. | True | `Customer`| ` let customer = {"id":"", "name":{{"lang":"en","first":"TAP","middle":"","last":"PAYMENTS"}}, "nameOnCard":"TAP PAYMENTS", "editble":true, "contact":{"email":"tap@tap.company", "phone":{"countryCode":"+965","number":"88888888"}}}` |
262
- | features| Some extra features that you can enable/disable based on the experience you want to provide.. | False | `Features`| ` let features = {"alternativeCardInputs":{ "cardScanner":true,"cardNFC":false}, "acceptanceBadge":true, "customerCards":{"saveCard":false, "autoSaveCard":false}`|
263
- | acceptance| The acceptance details for the transaction. Including, which card brands and types you want to allow for the customer to tokenize/save. | False | `Acceptance`| ` let acceptance = {"supportedSchemes":{ SupportedBrands.AMEX, SupportedBrands.MASTERCARD, SupportedBrands.VISA, SupportedBrands.MADA,}, "supportedFundSource":{"CREDIT","DEBIT"}, "supportedPaymentAuthentications":["3DS"]}`|
264
- | fields| Needed to define visibility of the optional fields in the card form. | False | `fieldVisibility`| ` let fieldVisibility ={ "card":{"cardHolder":true}}` |
265
- | interface| Needed to defines look and feel related configurations. | False | `Interface`| ` let interface = {locale: Locale.en, theme: Theme.dark, edges: Edges.curved, cardDirection: Direction.ltr, colorStyle: 'monochrome', powered: true, "loader": true}` |
266
- | post| This is the `webhook` for your server, if you want us to update you server to server. | False | `Post`| ` let post = {"url":""}` |
267
-
268
- ## Documentation per variable
269
-
270
- - operator:
271
- - Responsible for passing the data that defines you as a merchant within Tap system.
272
- - operator.publicKey:
273
- - A string, which you get after registering the app bundle id within the Tap system. It is required to correctly identify you as a merchant.
274
- - You will receive a sandbox and a production key. Use, the one that matches your environment at the moment of usage.
275
- - scope:
276
- - Defines the intention of the token you are generating.
277
- - When the token is used afterwards, the usage will be checked against the original purpose to make sure they are a match.
278
- - Possible values:
279
- - `Token` : This means you will get a Tap token to use afterwards.
280
- - `AuthenticatedToken` This means you will get an authenticated Tap token to use in our charge api right away.
281
- - `SaveToken` This means you will get a token to use multiple times with authentication each time.
282
- - `SaveAuthenticatedToken` This means you will get an authenticated token to use in multiple times right away.
283
- - purpose:
284
- - Defines the intention of using the `Token` after generation.
285
- - Possible values:
286
- - `Transaction` Using the token for a single charge.
287
- - `Milestone Transaction` Using the token for paying a part of a bigger order, when reaching a certain milestone.
288
- - `Installment Transaction` Using the token for a charge that is a part of an installement plan.
289
- - `Billing Transaction` Using the token for paying a bill.
290
- - `Subscription Transaction` Using the token for a recurring based transaction.
291
- - `Verify Cardholder` Using the token to verify the ownership of the card.
292
- - `Save Card` Using the token to save this card and link it to a certain customer.
293
- - `Maintain Card` Used to renew a saved card.
294
- - order:
295
- - The details about the order that you will be using the token you are generating within.
296
- - order.id:
297
- - The id of the `order` if you already created it using our apis.
298
- - order.currency:
299
- - The intended currency you will perform the order linked to this token afterwards.
300
- - order.amount:
301
- - The intended amount you will perform the order linked to this token afterwards.
302
- - order.description:
303
- - Optional string to put some clarifications about the order if needed.
304
- - order.reference:
305
- - Optional string to put a reference to link it to your system.
306
- - order.metadata:
307
- - Optional, It is a key-value based parameter. You can pass it to attach any miscellaneous data with this order for your own convenience.
308
- - invoice.id:
309
- - Optional string to pass an invoice id, that you want to link to this token afterwards.
310
- - merchant.id:
311
- - Optional string to pass to define a sub entity registered under your key in Tap. It is the `Merchant id` that you get from our onboarding team.
312
- - customer.id:
313
- - If you have previously have created a customer using our apis and you want to link this token to him. please pass his id.
314
- - customer.name:
315
- - It is a list of localized names. each name will have:
316
- - lang : the 2 iso code for the locale of this name for example `en`
317
- - first : The first name.
318
- - middle: The middle name.
319
- - last : The last name.
320
- - customer.nameOnCard:
321
- - If you want to prefill the card holder's name field.
322
- - customer.editable:
323
- - A boolean that controls whether the customer can edit the card holder's name field or not.
324
- - customer.contact.email:
325
- - An email string for the customer we are creating. At least the email or the phone is required.
326
- - customer.contact.phone:
327
- - The customer's phone:
328
- - countryCode
329
- - number
330
- - features:
331
- - Some extra features/functionalities that can be configured as per your needs.
332
- - features.alternativeCardInputs.cardScanner:
333
- - A boolean to indicate whether or not you want to display the scan card icon.
334
- - Make sure you have access to camera usage, before enabling the scanner function.
335
- - features.acceptanceBadge:
336
- - A boolean to indicate wether or not you want to display the list of supported card brands that appear beneath the card form itself.
337
- - features.customerCards.saveCard:
338
- - A boolean to indicate wether or not you want to display the save card option to the customer.
339
- - Must be used with a combination of these scopes:
340
- - SaveToken
341
- - SaveAuthenticatedToken
342
- - features.customerCards.autoSave:
343
- - A boolean to indicate wether or not you want the save card switch to be on by default.
344
- - acceptance:
345
- - List of configurations that control the payment itself.
346
- - acceptance.supportedSchemes:
347
- - A list to control which card schemes the customer can pay with. For example:
348
- - AMERICAN_EXPRESS
349
- - VISA
350
- - MASTERCARD
351
- - MADA
352
- - OMANNET
353
- - acceptance.supportedFundSource:
354
- - A list to control which card types are allowed by your customer. For example:
355
- - DEBIT
356
- - CREDIT
357
- - acceptance.supportedPaymentAuthentications:
358
- - A list of what authentication techniques you want to enforce and apple. For example:
359
- - 3DS
360
- - fieldVisibility.card.cardHolder:
361
- - A boolean to indicate wether or not you want to show/collect the card holder name.
362
- - interface.loader:
363
- - A boolean to indicate wether or not you want to show a loading view on top of the card form while it is performing api requests.
364
- - interface.locale:
365
- - The language of the card form. Accepted values as of now are:
366
- - en
367
- - ar
368
- - interface.theme:
369
- - The display style of the card form. Accepted values as of now are:
370
- - light
371
- - dark
372
- - dynamic // follow the device's display style
373
- - interface.edges:
374
- - How do you want the edges of the card form to. Accepted values as of now are:
375
- - curved
376
- - flat
377
- - interface.cardDirection:
378
- - The layout of the fields (card logo, number, date & CVV) within the card element itself. Accepted values as of now are:
379
- - ltr // fields will inflate from left to right
380
- - rtl // fields will inflate from right to left
381
- - dynamic // fields will inflate in the locale's direction
382
- - interface.powered:
383
- - A boolean to indicate wether or not you want to show powered by tap.
384
- - Note, that you have to have the permission to hide it from the integration team. Otherwise, you will get an error if you pass it as false.
385
- - interface.colorStyle:
386
- - How do you want the icons rendered inside the card form to. Accepted values as of now are:
387
- - colored
388
- - monochrome
389
307
 
390
308
  # TapCardView Callbacks
391
309
 
392
310
  callbacks that allows integrators to get notified from events fired from the `TapCardView`.
393
311
 
394
312
  ```Ts
395
- @objc public protocol TapCardViewDelegate {
313
+ {
396
314
  /// Will be fired whenever the card is rendered and loaded
397
315
  onReady={() => {}}
398
316
  /// Will be fired once the user focuses any of the card fields
@@ -460,3 +378,628 @@ callbacks that allows integrators to get notified from events fired from the `Ta
460
378
 
461
379
  }
462
380
  ```
381
+
382
+ # Parameters Reference[]()
383
+
384
+ Below you will find more details about each parameter shared in the above tables that will help you easily integrate Card-iOS SDK.
385
+
386
+ ## operator[]()
387
+
388
+ 1. Definition: It links the payment gateway to your merchant account with Tap, in order to know your business name, logo, etc...
389
+ 2. Type: string (_required_)
390
+ 3. Fields:
391
+ - **publicKey**
392
+ _Definition_: This is a unique public key that you will receive after creating an account with Tap which is considered a reference to identify you as a merchant. You will receive 2 public keys, one for sandbox/testing and another one for production.
393
+ 4. Example:
394
+
395
+ ```ts
396
+ let operator = {publicKey:"pk_test_YhUjg9PNT8oDlKJ1aE2fMRz7"}
397
+ ```
398
+ ## scope []()
399
+
400
+ 1. Definition: This is used in order to identify the type of token you want to generate. A token is created in order to save the card details after submitting the form in a more secure way.
401
+ 2. Type: string (_required_)
402
+ 3. Possible Values:
403
+ - **Token**
404
+ _Definition:_ Created before the payment in complete, in order to save the card and do a charge later
405
+ 4. Example: `let scope:String = "Token"`
406
+
407
+ - **AuthenticatedToken**
408
+ _Definition:_ This is a token created and authenticated by the customer. Which means that the customer entered the card information and also passed the Authentication step (3DS) and got the token after.
409
+ _Example:_ `let scope:String = "AuthenticatedToken"`
410
+
411
+ - **SaveToken**
412
+ _Definition:_ This is used in case you want to have the card information saved in a token, however you want the customer to go through the authentication step (receive OTP or PIN) each time the card is used.
413
+ _Example:_ `let scope:String = "SaveToken"`
414
+
415
+
416
+ - **SaveAuthenticatedToken**
417
+ _Definition:_ This means you will get an authenticated token to use in multiple times right away.
418
+ _Example:_ `let scope:String = "SaveAuthenticatedToken"`
419
+
420
+ ## purpose[]()
421
+
422
+ 1. Definition: This will identify the reason of choosing the type of token generated in the scope field, like if it will be used for a single transaction, recurring, saving the token, etc...
423
+ Note: Only choose the option that suits your needs best.
424
+ 2. Type: string (_required_)
425
+ 3. Possible Values:
426
+ - **Transaction**:
427
+ _Definition:_ In case the token will be used only for a single charge request.
428
+ _Example:_ `const purpose:String = "Transaction"`
429
+
430
+ - **Milestone Transaction**:
431
+ _Definition:_ Using the token for paying a part of a bigger order, when reaching a certain milestone.
432
+ _Example:_`const purpose = "Milestone Transaction"`
433
+
434
+ - **Instalment Transaction**:
435
+ _Definition:_ Using the token for a charge that is a part of an instalment plan.
436
+ _Example:_`const purpose = "Instalment Transaction"`
437
+
438
+ - **Billing Transaction**:
439
+ _Definition:_ Using the token for paying a bill.
440
+ _Example:_`const purpose = "Billing Transaction"`
441
+
442
+ - **Subscription Transaction**:
443
+ _Definition:_ Using the token for a recurring based transaction.
444
+ _Example:_`const purpose = "Subscription Transaction"`
445
+
446
+ - **Verify Cardholder**:
447
+ _Definition:_ Using the token to verify the ownership of the card, in other words, making sure of the identity of the cardholder.
448
+ _Example:_`const purpose = "Verify Cardholder*"`
449
+
450
+ - **Save Card**:
451
+ _Definition:_ Using the token to save this card and link it to the customer itself.
452
+ _Example:_`const purpose = "Save Card"`
453
+
454
+ - **Maintain Card**:
455
+ _Definition:_ Used to renew a saved card.
456
+ _Example:_`const purpose = "Maintain Card"`
457
+
458
+
459
+ ## order []()
460
+
461
+ 1. Definition: This defined the details of the order that you are trying to purchase, in which you need to specify some details like the id, amount, currency ...
462
+ 2. Type: Dictionary, (_required_)
463
+ 3. Fields:
464
+ - **id**
465
+ _Definition:_ Pass the order ID created for the order you are trying to purchase, which will be available in your database.
466
+ Note: This field can be empty
467
+ - **currency**
468
+ _Definition:_ The currency which is linked to the order being paid.
469
+ - **amount**
470
+ _Definition:_ The order amount to be paid by the customer.
471
+ Note: Minimum amount to be added is 0.1.
472
+ - **description**
473
+ _Definition:_ Order details, which defines what the customer is paying for or the description of the service you are providing.
474
+ - **reference**
475
+ _Definition:_ This will be the order reference present in your database in which the paying is being done for.
476
+ 4. _Example:_
477
+ ```ts
478
+ let order = {
479
+ reference: '',
480
+ amount: 1,
481
+ currency: TapCurrencyCode.SAR,
482
+ description: '',
483
+ id: '',
484
+ metadata: {},
485
+ }
486
+ ```
487
+
488
+ ##
489
+
490
+ merchant
491
+
492
+ []()
493
+
494
+ 1. Definition: It is the Merchant id that you get from our onboarding team. This will be used as reference for your account in Tap.
495
+ 2. Type: Dictionary (_required_)
496
+ 3. Fields:
497
+ - **id**
498
+ _Definition:_ Generated once your account with Tap is created, which is unique for every merchant.
499
+ _Example:_
500
+ ```swift
501
+ let merchant = {id:""}
502
+ ```
503
+
504
+
505
+ ## invoice []()
506
+
507
+ 1. Definition: After the token is generated, you can use it to pay for any invoice. Each invoice will have an invoice ID which you can add here using the SDK.
508
+ Note: An invoice will first show you a receipt/summary of the order you are going to pay for as well as the amount, currency, and any related field before actually opening the payment form and completing the payment.
509
+ 2. Type: Dictionary (_optional_)
510
+ 3. Fields:
511
+ - **id**
512
+ _Definition:_ Unique Invoice ID which we are trying to pay.
513
+ _Example:_
514
+ ```swift
515
+ let invoice = {id:""}
516
+ ```
517
+
518
+
519
+ ## customer []()
520
+
521
+ 1. Definition: Here, you will collect the information of the customer that is paying using the token generate in the SDK.
522
+
523
+ 2. Type: Dictionary (_required_)
524
+
525
+ 3. Fields:
526
+
527
+ - **id**
528
+ _Definition:_ This is an optional field that you do not have before the token is generated. But, after the token is created once the card details are added, then you will receive the customer ID in the response which can be handled in the onSuccess callback function.
529
+ - **name**
530
+ _Definition:_ Full Name of the customer paying.
531
+ _Fields:_
532
+
533
+ 1. **lang**
534
+ Definition: Language chosen to write the customer name.
535
+ 2. **first**
536
+ Definition: Customer's first name.
537
+ 3. **middle**
538
+ Definition: Customer's middle name.
539
+ 4. **last**
540
+ Definition: Customer's last name.
541
+
542
+ - **editable**
543
+ _Definition:_ The customer's name on the card he is paying with, also known as cardholder name.
544
+ Note: It is of type Boolean, and indicated whether or not the customer can edit the cardholder name already entered when the token got created.
545
+
546
+ - **contact**
547
+ _Definition:_ The customer's contact information like email address and phone number.
548
+ Note: The contact information has to either have the email address or the phone details of the customers or both but it should not be empty.
549
+ _Fields:_
550
+
551
+ 1. **email**
552
+ Definition: Customer's email address
553
+ Note: The email is of type string.
554
+ 2. **phone**
555
+ Definition: Customer's Phone number details
556
+ 1. **countryCode**
557
+ 2. **number**
558
+
559
+ - **nameOnCard**
560
+ _Definition:_ Pre-fill the cardholder name already received once the payment form is submitted.
561
+ 4. _Example:_
562
+ ```ts
563
+ let customer = {
564
+ nameOnCard: 'Tap Payments',
565
+ editable: true,
566
+ id: '',
567
+ name: [
568
+ {
569
+ first: 'Tap',
570
+ lang: Locale.en,
571
+ middle: 'Company',
572
+ last: 'Payments',
573
+ },
574
+ ],
575
+ contact: {
576
+ phone: {
577
+ number: '88888888',
578
+ countryCode: '+965',
579
+ },
580
+ email: 'tappayments@tap.company',
581
+ },
582
+ }
583
+ ```
584
+
585
+
586
+ ## featuresv[]()
587
+
588
+ 1. Definition: Additional functionalities to be added in order to make the payment gateway experience more customisable for your needs, like showing the accepted card brands on the payment form, save card toggle button...
589
+
590
+ 2. Type: Dictionary (optional)
591
+
592
+ 3. Fields:
593
+
594
+ - **acceptanceBadge**
595
+ _Definition:_ A boolean to indicate wether or not you want to display the list of supported card brands that appear beneath the card form itself.
596
+
597
+ - **customerCards**
598
+ _Definition:_ You will have the option to display either the toggle button that allows to save the card or the autosave card.
599
+ _Fields:_
600
+
601
+ 1. **saveCard**
602
+ Definition: A boolean to indicate wether or not you want to display the save card option to the customer.
603
+ Must be used with a combination of these 2 scopes either SaveToken or SaveAuthenticatedToken.
604
+ 2. **autoSave**
605
+ Definition: A boolean to indicate wether or not you want the save card switch to be on by default.
606
+
607
+ - **alternativeCardInput**
608
+ _Definition:_ You can also, either add the card information by scanning the card or by using NFC.
609
+ Note: In order for that to work, you will need to add the Camera usage description to your info.plist file like so
610
+
611
+ _Fields:_
612
+
613
+ 1. **cardScanner**
614
+ Definition: A boolean to indicate whether or not you want to display the scan card icon.
615
+ 4. - _Example:_
616
+ ```ts
617
+ let features = {
618
+ alternativeCardInputs: {
619
+ cardNFC: true,
620
+ cardScanner: true,
621
+ },
622
+ customerCards: {
623
+ saveCard: true,
624
+ autoSaveCard: true,
625
+ },
626
+ acceptanceBadge: true,
627
+ }
628
+ ```
629
+
630
+
631
+
632
+ ## acceptance[]()
633
+
634
+ 1. Definition: This will help in controlling the supported payment schemes, like MasterCard and Visa, and the fund source either being debit or credit card and you will also be able to check if you want the customers to complete the 3DS phase (Authentication) or not.
635
+ 2. Type: Dictionary (_optional_)
636
+ 3. Fields:
637
+ - **supportedSchemes**
638
+ _Definition:_ A list to control which card schemes the customer can pay with, note that he can choose more than one card scheme.
639
+ _Possible Values:_
640
+
641
+ 1. AMERICAN_EXPRESS
642
+ 2. VISA
643
+ 3. MASTERCARD
644
+ 4. MADA
645
+ 5. OMANNET
646
+
647
+ - **supportedFundSource**
648
+ _Definition:_ A list to control which card types are allowed by your customer.
649
+ _Possible Values:_
650
+
651
+ 1. Debit
652
+ 2. Credit
653
+
654
+ - **supportedPaymentAuthentications**
655
+ _Definition:_ A list of what authentication techniques you want to enforce like 3DS authentication
656
+ _Possible Values:_
657
+
658
+ 1. 3DS
659
+ 4. _Example:_
660
+ ```Ts
661
+ let acceptance = acceptance: {
662
+ supportedSchemes: [
663
+ SupportedSchemes.AMEX,
664
+ SupportedSchemes.MASTERCARD,
665
+ SupportedSchemes.VISA,
666
+ SupportedSchemes.MADA,
667
+ ],
668
+ supportedFundSource: [
669
+ SupportedFundSource.Debit,
670
+ SupportedFundSource.Credit,
671
+ ],
672
+ supportedPaymentAuthentications: [
673
+ SupportedPaymentAuthentications.secured,
674
+ ],
675
+ }
676
+ ```
677
+
678
+
679
+ ## fieldVisibility []()
680
+
681
+ 1. Definition: A boolean to indicate wether or not you want to show/collect the card holder name.
682
+ 2. Type: Dictionary (_optional_)
683
+ 3. Fields:
684
+ - **card**
685
+ 1. **cardHolder**
686
+ _Definition:_ The person that is paying using credit or debit card.
687
+ 4. _Example:_
688
+ ```Ts
689
+ let fieldVisibility = {
690
+ card: {
691
+ cardHolder: true,
692
+ cvv: true
693
+ },
694
+ }
695
+ ```
696
+
697
+
698
+ ## interface []()
699
+
700
+ 1. Definition: This will help you control the layout (UI) of the payment form, like changing the theme light to dark, the language used (en or ar), ...
701
+ 2. Type: Dictionary (_optional_)
702
+ 3. Fields:
703
+ - **loader**
704
+ _Definition:_ A boolean to indicate wether or not you want to show a loading view on top of the card form while it is performing api requests.
705
+ - **locale**
706
+ _Definition:_ The language of the card form. Accepted values as of now are:
707
+ _Possible Values:_
708
+
709
+ 1. **en**(for english)
710
+ 2. **ar**(for arabic).
711
+
712
+ - **theme**
713
+ _Definition:_ The display styling of the card form. Accepted values as of now are:
714
+ _Options:_
715
+
716
+ 1. **light**
717
+ 2. **dark**
718
+ 3. **dynamic** ( follow the device's display style )
719
+
720
+ - **edges**
721
+ _Definition:_ Control the edges of the payment form.
722
+ _Possible Values:_
723
+
724
+ 1. **curved**
725
+ 2. **flat**
726
+
727
+ - **cardDirection**
728
+ _Definition:_ The layout of the fields (card logo, number, date & CVV) within the card element itself.
729
+ _Possible Values:_
730
+
731
+ 1. **ltr**
732
+ Definition: The fields will inflate from left to right.
733
+ 2. **rtl
734
+ **Definition: The fields will inflate from right to left.
735
+ 3. **dynamic**
736
+ Definition: The fields will inflate in the locale's direction.
737
+
738
+ - **powered**
739
+ _Definition:_ A boolean to indicate wether or not you want to show powered by tap.
740
+ Note, that you have to have the permission to hide it from the integration team. Otherwise, you will get an error if you pass it as false.
741
+
742
+ - **colorStyle**
743
+ _Definition:_ How do you want the icons rendered inside the card form.
744
+ _Possible Values:_
745
+
746
+ 1. **colored**
747
+ 2. **monochrome**
748
+ 4. _Example:_
749
+ ```Ts
750
+ let interface = interface: {
751
+ loader: true,
752
+ locale: Locale.en,
753
+ theme: Theme.dark,
754
+ edges: Edges.curved,
755
+ cardDirection: Direction.ltr,
756
+ colorStyle: ColorStyle.colored,
757
+ powered: true,
758
+ },
759
+ ```
760
+
761
+
762
+ ## post []()
763
+
764
+ 1. Definition: Here you can pass the webhook URL you have, in order to receive notifications of the results of each Transaction happening on your application.
765
+
766
+ 2. Type: Post (_optional_)
767
+
768
+ 3. Fields:
769
+
770
+ - **url**
771
+ _Definition:_ The webhook server's URL that you want to receive notifications on.
772
+ _Example:_
773
+ ```Ts
774
+ let post:Post = {"url":""}
775
+ ```
776
+ # Expected Callbacks Responses[]()
777
+
778
+ ## onBindIdentification
779
+ ```json
780
+ {
781
+ "bin": "557607",
782
+ "bank": "COMMERCIAL INTERNATIONAL BANK (EGYPT) S.A.E.",
783
+ "card_brand": "MASTERCARD",
784
+ "card_type": "DEBIT",
785
+ "card_category": "PLATINUM",
786
+ "card_scheme": "MASTERCARD",
787
+ "country": "EG",
788
+ "address_required": false,
789
+ "api_version": "V2",
790
+ "issuer_id": "bnk_TS02A1320232208a5O41810531",
791
+ "brand": "MASTERCARD"
792
+ }
793
+ ```
794
+
795
+ ## onSuccess
796
+ The response here will differ based on the scope:
797
+ ### Token
798
+ ```json
799
+ {
800
+ "id": "tok_4WUP3423199C4Vp18rY9y554",
801
+ "created": 1697656174554,
802
+ "object": "token",
803
+ "live_mode": false,
804
+ "type": "CARD",
805
+ "purpose": "Transaction",
806
+ "source": "CARD-ENCRYPTED",
807
+ "used": false,
808
+ "card": {
809
+ "id": "card_U8Wb34231992m7q185g9i558",
810
+ "object": "card",
811
+ "address": {},
812
+ "funding": "CREDIT",
813
+ "fingerprint": "gRkNTnMrJPtVYkFDVU485JtGPdhzQr%2FnmHGhlzLBvuc%3D",
814
+ "brand": "VISA",
815
+ "scheme": "VISA",
816
+ "category": "",
817
+ "exp_month": 2,
818
+ "exp_year": 44,
819
+ "last_four": "4242",
820
+ "first_six": "424242",
821
+ "first_eight": "42424242",
822
+ "name": "AHMED",
823
+ "issuer": {
824
+ "bank": "",
825
+ "country": "GB",
826
+ "id": "bnk_TS05A3420232209Kp2j1810445"
827
+ }
828
+ },
829
+ "save_card": false,
830
+ "url": ""
831
+ }
832
+ ```
833
+
834
+
835
+ ## AuthenticatedToken
836
+ ```json
837
+ {
838
+ "id": "auth_payer_MhIp23231913vYjl18nx94755",
839
+ "object": "Authenticate",
840
+ "live_mode": false,
841
+ "api_version": "V2",
842
+ "status": "AUTHENTICATED",
843
+ "created": "1697656409282",
844
+ "amount": 1,
845
+ "currency": "KWD",
846
+ "save_card": false,
847
+ "provider": {
848
+ "name": "MPGS"
849
+ },
850
+ "transaction": {
851
+ "timezone": "UTCZ",
852
+ "created": "1697656409282"
853
+ },
854
+ "response": {
855
+ "code": "000",
856
+ "message": "Authentication Successful"
857
+ },
858
+ "reference": {
859
+ "transaction": "tck_LV02G1720231634Xj51824647",
860
+ "order": "ord_Tlh924231913OouS18vd9O487"
861
+ },
862
+ "customer": {
863
+ "id": "",
864
+ "name": [
865
+ {
866
+ "first_name": "test",
867
+ "middle_name": "test",
868
+ "last_name": "test",
869
+ "locale": "en"
870
+ }
871
+ ],
872
+ "name_on_card": "Ahmed",
873
+ "email": "test@tap.com",
874
+ "phone": {
875
+ "country_code": "+20",
876
+ "number": "1099137777"
877
+ }
878
+ },
879
+ "source": {
880
+ "id": "tok_RCiU23231913dWqQ18WV9Q18"
881
+ },
882
+ "merchant": {
883
+ "id": "1124340"
884
+ },
885
+ "card": {
886
+ "first_six": "424242",
887
+ "scheme": "VISA",
888
+ "brand": "VISA",
889
+ "category": "",
890
+ "last_four": "4242",
891
+ "name": "AHMED",
892
+ "expiry": {
893
+ "month": "02",
894
+ "year": "44"
895
+ },
896
+ "funding": "CREDIT"
897
+ },
898
+ "authentication": {
899
+ "acsEci": "02",
900
+ "card_enrolled": "Y",
901
+ "authenticationToken": "jHyn+7YFi1EUAREAAAAvNUe6Hv8=",
902
+ "transactionId": "h3q0bQzZNyBueA//+57RcpfPo6s=",
903
+ "version": "3DS1",
904
+ "channel": "PAYER_BROWSER",
905
+ "purpose": "Transaction",
906
+ "url": "https://authenticate.alpha.tap.company/redirect/auth_payer_MhIp23231913vYjl18nx94755",
907
+ "transStatus": "Y",
908
+ "mode": "C"
909
+ },
910
+ "redirect": {
911
+ "url": ""
912
+ }
913
+ }
914
+ ```
915
+
916
+ ## SaveAuthenticatedToken
917
+ If the user didn't enable the save token switch, it will be as the previous scope. Otherwise it will be:
918
+ ```json
919
+ {
920
+ "id": "auth_payer_yhFr59231914mJvN18c79665",
921
+ "object": "Authenticate",
922
+ "live_mode": false,
923
+ "api_version": "V2",
924
+ "status": "AUTHENTICATED",
925
+ "created": "1697656504329",
926
+ "amount": 1,
927
+ "currency": "KWD",
928
+ "save_card": true,
929
+ "provider": {
930
+ "name": "MPGS"
931
+ },
932
+ "transaction": {
933
+ "timezone": "UTCZ",
934
+ "created": "1697656504329"
935
+ },
936
+ "response": {
937
+ "code": "000",
938
+ "message": "Authentication Successful"
939
+ },
940
+ "reference": {
941
+ "transaction": "tck_LV02G1720231634Xj60014708",
942
+ "order": "ord_Zu5d59231914gJa018lJ9b720"
943
+ },
944
+ "customer": {
945
+ "id": "cus_TS01A1520232215Nx3n1810085",
946
+ "name": [
947
+ {
948
+ "first_name": "test",
949
+ "middle_name": "test",
950
+ "last_name": "test",
951
+ "locale": "en"
952
+ }
953
+ ],
954
+ "name_on_card": "Ahmed",
955
+ "email": "test@tap.com",
956
+ "phone": {
957
+ "country_code": "+20",
958
+ "number": "1099137777"
959
+ }
960
+ },
961
+ "source": {
962
+ "id": "tok_2AKI58231914GLWn18V69C147"
963
+ },
964
+ "merchant": {
965
+ "id": "1124340"
966
+ },
967
+ "card": {
968
+ "id": "card_rSWi582319149ys718hD9B151",
969
+ "first_six": "424242",
970
+ "scheme": "VISA",
971
+ "brand": "VISA",
972
+ "category": "",
973
+ "last_four": "4242",
974
+ "name": "AHMED",
975
+ "expiry": {
976
+ "month": "04",
977
+ "year": "44"
978
+ },
979
+ "funding": "CREDIT"
980
+ },
981
+ "authentication": {
982
+ "acsEci": "02",
983
+ "card_enrolled": "Y",
984
+ "authenticationToken": "jHyn+7YFi1EUAREAAAAvNUe6Hv8=",
985
+ "transactionId": "FOdR5lit6PaxiidyOxmjSS9z1ls=",
986
+ "version": "3DS1",
987
+ "channel": "PAYER_BROWSER",
988
+ "purpose": "Transaction",
989
+ "url": "https://authenticate.alpha.tap.company/redirect/auth_payer_yhFr59231914mJvN18c79665",
990
+ "transStatus": "Y",
991
+ "mode": "C"
992
+ },
993
+ "payment_agreement": {
994
+ "id": "payment_agreement_NDL3172319152Gck18109189",
995
+ "type": "UNSCHEDULED",
996
+ "contract": {
997
+ "id": "card_rSWi582319149ys718hD9B151",
998
+ "type": "SAVED_CARD"
999
+ }
1000
+ },
1001
+ "redirect": {
1002
+ "url": ""
1003
+ }
1004
+ }
1005
+ ```
@@ -106,7 +106,7 @@ dependencies {
106
106
  //noinspection GradleDynamicVersion
107
107
  implementation "com.facebook.react:react-native:+"
108
108
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
109
- implementation 'com.github.Tap-Payments:Card-Android:0.0.33'
109
+ implementation 'com.github.Tap-Payments:Card-Android:+'
110
110
  }
111
111
 
112
112
  if (isNewArchitectureEnabled()) {
@@ -21,10 +21,10 @@ Pod::Spec.new do |s|
21
21
  # See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
22
22
  if respond_to?(:install_modules_dependencies, true)
23
23
  install_modules_dependencies(s)
24
- s.dependency 'Card-iOS','0.0.23'
24
+ s.dependency 'Card-iOS'
25
25
  else
26
26
  s.dependency "React-Core"
27
- s.dependency 'Card-iOS','0.0.23'
27
+ s.dependency 'Card-iOS'
28
28
  # Don't install the dependencies when we run `pod install` in the old architecture.
29
29
  if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
30
30
  s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "card-react-native",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "description": "Tap Card SDK Wrapper",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",