@jimrising/easymerchantsdk-react-native 1.1.1 → 1.1.3
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/.idea/caches/deviceStreaming.xml +132 -0
- package/.idea/modules.xml +0 -8
- package/.idea/workspace.xml +142 -3
- package/README.md +10 -8
- package/ios/Bundle/EasyPayBundle.swift +0 -1
- package/ios/Classes/EasyMerchantSdk.m +17 -4
- package/ios/Classes/EasyMerchantSdk.swift +12 -5
- package/ios/Classes/EasyPayViewController.swift +11 -15
- package/ios/CustomComponents/CheckboxButton.swift +40 -3
- package/ios/CustomComponents/FilledButton.swift +31 -3
- package/ios/CustomComponents/TextFieldStackView.swift +57 -17
- package/ios/Example/Base.lproj/Main.storyboard +4 -3
- package/ios/Example/ViewController.swift +19 -8
- package/ios/Extensions/UIColor.swift +17 -0
- package/ios/Extensions/UIFont.swift +1 -0
- package/ios/Models/PaymentInfo.swift +1 -2
- package/ios/Models/Request.swift +1 -1
- package/ios/Pods/UserDefaults/UserStoreSingleton.swift +0 -3
- package/ios/Pods/ViewControllers/AdditionalInfoVC.swift +127 -73
- package/ios/Pods/ViewControllers/BaseVC.swift +9 -0
- package/ios/Pods/ViewControllers/BillingInfoVC/BillingInfoVC.swift +215 -145
- package/ios/Pods/ViewControllers/BillingInfoVC/Cells/CityListTVC.swift +21 -0
- package/ios/Pods/ViewControllers/BillingInfoVC/Cells/CountryListTVC.swift +23 -1
- package/ios/Pods/ViewControllers/BillingInfoVC/Cells/StateListTVC.swift +21 -0
- package/ios/Pods/ViewControllers/CountryListVC.swift +25 -0
- package/ios/Pods/ViewControllers/EmailVerificationVC.swift +48 -12
- package/ios/Pods/ViewControllers/OTPVerificationVC.swift +176 -68
- package/ios/Pods/ViewControllers/PaymentDoneVC.swift +52 -0
- package/ios/Pods/ViewControllers/PaymentErrorVC.swift +40 -0
- package/ios/Pods/ViewControllers/PaymentInformation/AccountTypeTVC.swift +18 -2
- package/ios/Pods/ViewControllers/PaymentInformation/PaymentInfoVC.swift +1024 -252
- package/ios/Pods/ViewControllers/PaymentInformation/PaymentInformationCVC.swift +13 -4
- package/ios/Pods/ViewControllers/PaymentInformation/SavedAccountsTVC/SavedAccountTVC.swift +32 -0
- package/ios/Pods/ViewControllers/PaymentInformation/SavedAccountsTVC/SavedAccountTVC.xib +5 -5
- package/ios/Pods/ViewControllers/PaymentInformation/SavedCardsTVC/SavedCardsTVC.swift +27 -1
- package/ios/Pods/ViewControllers/PaymentInformation/SavedCardsTVC/SavedCardsTVC.xib +5 -5
- package/ios/Pods/ViewControllers/TermAndConditionsVC.swift +33 -3
- package/ios/Resources/Assets.xcassets/Card/MasterCard.imageset/Contents.json +392 -2
- package/ios/ThirdParty/Keyboad Handling/KeyboardObserver.swift +1 -1
- package/ios/easymerchantsdk.podspec +3 -3
- package/package.json +1 -4
- package/src/index.js +4 -4
- package/.idea/easymerchantsdk-react-native.iml +0 -9
- package/ios/easymerchantsdk.storyboard +0 -5885
|
@@ -14,6 +14,17 @@
|
|
|
14
14
|
<option name="screenX" value="720" />
|
|
15
15
|
<option name="screenY" value="1280" />
|
|
16
16
|
</PersistentDeviceSelectionData>
|
|
17
|
+
<PersistentDeviceSelectionData>
|
|
18
|
+
<option name="api" value="34" />
|
|
19
|
+
<option name="brand" value="OnePlus" />
|
|
20
|
+
<option name="codename" value="OP5552L1" />
|
|
21
|
+
<option name="id" value="OP5552L1" />
|
|
22
|
+
<option name="manufacturer" value="OnePlus" />
|
|
23
|
+
<option name="name" value="CPH2415" />
|
|
24
|
+
<option name="screenDensity" value="480" />
|
|
25
|
+
<option name="screenX" value="1080" />
|
|
26
|
+
<option name="screenY" value="2412" />
|
|
27
|
+
</PersistentDeviceSelectionData>
|
|
17
28
|
<PersistentDeviceSelectionData>
|
|
18
29
|
<option name="api" value="34" />
|
|
19
30
|
<option name="brand" value="OPPO" />
|
|
@@ -47,6 +58,28 @@
|
|
|
47
58
|
<option name="screenX" value="1840" />
|
|
48
59
|
<option name="screenY" value="2944" />
|
|
49
60
|
</PersistentDeviceSelectionData>
|
|
61
|
+
<PersistentDeviceSelectionData>
|
|
62
|
+
<option name="api" value="34" />
|
|
63
|
+
<option name="brand" value="samsung" />
|
|
64
|
+
<option name="codename" value="a15" />
|
|
65
|
+
<option name="id" value="a15" />
|
|
66
|
+
<option name="manufacturer" value="Samsung" />
|
|
67
|
+
<option name="name" value="A15" />
|
|
68
|
+
<option name="screenDensity" value="450" />
|
|
69
|
+
<option name="screenX" value="1080" />
|
|
70
|
+
<option name="screenY" value="2340" />
|
|
71
|
+
</PersistentDeviceSelectionData>
|
|
72
|
+
<PersistentDeviceSelectionData>
|
|
73
|
+
<option name="api" value="34" />
|
|
74
|
+
<option name="brand" value="samsung" />
|
|
75
|
+
<option name="codename" value="a35x" />
|
|
76
|
+
<option name="id" value="a35x" />
|
|
77
|
+
<option name="manufacturer" value="Samsung" />
|
|
78
|
+
<option name="name" value="A35" />
|
|
79
|
+
<option name="screenDensity" value="450" />
|
|
80
|
+
<option name="screenX" value="1080" />
|
|
81
|
+
<option name="screenY" value="2340" />
|
|
82
|
+
</PersistentDeviceSelectionData>
|
|
50
83
|
<PersistentDeviceSelectionData>
|
|
51
84
|
<option name="api" value="31" />
|
|
52
85
|
<option name="brand" value="samsung" />
|
|
@@ -80,6 +113,17 @@
|
|
|
80
113
|
<option name="screenX" value="1080" />
|
|
81
114
|
<option name="screenY" value="1272" />
|
|
82
115
|
</PersistentDeviceSelectionData>
|
|
116
|
+
<PersistentDeviceSelectionData>
|
|
117
|
+
<option name="api" value="33" />
|
|
118
|
+
<option name="brand" value="motorola" />
|
|
119
|
+
<option name="codename" value="austin" />
|
|
120
|
+
<option name="id" value="austin" />
|
|
121
|
+
<option name="manufacturer" value="Motorola" />
|
|
122
|
+
<option name="name" value="moto g 5G (2022)" />
|
|
123
|
+
<option name="screenDensity" value="280" />
|
|
124
|
+
<option name="screenX" value="720" />
|
|
125
|
+
<option name="screenY" value="1600" />
|
|
126
|
+
</PersistentDeviceSelectionData>
|
|
83
127
|
<PersistentDeviceSelectionData>
|
|
84
128
|
<option name="api" value="33" />
|
|
85
129
|
<option name="brand" value="samsung" />
|
|
@@ -245,6 +289,28 @@
|
|
|
245
289
|
<option name="screenX" value="1080" />
|
|
246
290
|
<option name="screenY" value="2340" />
|
|
247
291
|
</PersistentDeviceSelectionData>
|
|
292
|
+
<PersistentDeviceSelectionData>
|
|
293
|
+
<option name="api" value="34" />
|
|
294
|
+
<option name="brand" value="samsung" />
|
|
295
|
+
<option name="codename" value="gta9pwifi" />
|
|
296
|
+
<option name="id" value="gta9pwifi" />
|
|
297
|
+
<option name="manufacturer" value="Samsung" />
|
|
298
|
+
<option name="name" value="SM-X210" />
|
|
299
|
+
<option name="screenDensity" value="240" />
|
|
300
|
+
<option name="screenX" value="1200" />
|
|
301
|
+
<option name="screenY" value="1920" />
|
|
302
|
+
</PersistentDeviceSelectionData>
|
|
303
|
+
<PersistentDeviceSelectionData>
|
|
304
|
+
<option name="api" value="34" />
|
|
305
|
+
<option name="brand" value="samsung" />
|
|
306
|
+
<option name="codename" value="gts7xllite" />
|
|
307
|
+
<option name="id" value="gts7xllite" />
|
|
308
|
+
<option name="manufacturer" value="Samsung" />
|
|
309
|
+
<option name="name" value="SM-T738U" />
|
|
310
|
+
<option name="screenDensity" value="340" />
|
|
311
|
+
<option name="screenX" value="1600" />
|
|
312
|
+
<option name="screenY" value="2560" />
|
|
313
|
+
</PersistentDeviceSelectionData>
|
|
248
314
|
<PersistentDeviceSelectionData>
|
|
249
315
|
<option name="api" value="33" />
|
|
250
316
|
<option name="brand" value="samsung" />
|
|
@@ -256,6 +322,28 @@
|
|
|
256
322
|
<option name="screenX" value="1848" />
|
|
257
323
|
<option name="screenY" value="2960" />
|
|
258
324
|
</PersistentDeviceSelectionData>
|
|
325
|
+
<PersistentDeviceSelectionData>
|
|
326
|
+
<option name="api" value="34" />
|
|
327
|
+
<option name="brand" value="samsung" />
|
|
328
|
+
<option name="codename" value="gts8wifi" />
|
|
329
|
+
<option name="id" value="gts8wifi" />
|
|
330
|
+
<option name="manufacturer" value="Samsung" />
|
|
331
|
+
<option name="name" value="Galaxy Tab S8" />
|
|
332
|
+
<option name="screenDensity" value="274" />
|
|
333
|
+
<option name="screenX" value="1600" />
|
|
334
|
+
<option name="screenY" value="2560" />
|
|
335
|
+
</PersistentDeviceSelectionData>
|
|
336
|
+
<PersistentDeviceSelectionData>
|
|
337
|
+
<option name="api" value="34" />
|
|
338
|
+
<option name="brand" value="samsung" />
|
|
339
|
+
<option name="codename" value="gts9fe" />
|
|
340
|
+
<option name="id" value="gts9fe" />
|
|
341
|
+
<option name="manufacturer" value="Samsung" />
|
|
342
|
+
<option name="name" value="Galaxy Tab S9 FE 5G" />
|
|
343
|
+
<option name="screenDensity" value="280" />
|
|
344
|
+
<option name="screenX" value="1440" />
|
|
345
|
+
<option name="screenY" value="2304" />
|
|
346
|
+
</PersistentDeviceSelectionData>
|
|
259
347
|
<PersistentDeviceSelectionData>
|
|
260
348
|
<option name="api" value="34" />
|
|
261
349
|
<option name="brand" value="google" />
|
|
@@ -311,6 +399,17 @@
|
|
|
311
399
|
<option name="screenX" value="720" />
|
|
312
400
|
<option name="screenY" value="1600" />
|
|
313
401
|
</PersistentDeviceSelectionData>
|
|
402
|
+
<PersistentDeviceSelectionData>
|
|
403
|
+
<option name="api" value="34" />
|
|
404
|
+
<option name="brand" value="samsung" />
|
|
405
|
+
<option name="codename" value="o1q" />
|
|
406
|
+
<option name="id" value="o1q" />
|
|
407
|
+
<option name="manufacturer" value="Samsung" />
|
|
408
|
+
<option name="name" value="Galaxy S21" />
|
|
409
|
+
<option name="screenDensity" value="421" />
|
|
410
|
+
<option name="screenX" value="1080" />
|
|
411
|
+
<option name="screenY" value="2400" />
|
|
412
|
+
</PersistentDeviceSelectionData>
|
|
314
413
|
<PersistentDeviceSelectionData>
|
|
315
414
|
<option name="api" value="31" />
|
|
316
415
|
<option name="brand" value="google" />
|
|
@@ -367,6 +466,17 @@
|
|
|
367
466
|
<option name="screenY" value="384" />
|
|
368
467
|
<option name="type" value="WEAR_OS" />
|
|
369
468
|
</PersistentDeviceSelectionData>
|
|
469
|
+
<PersistentDeviceSelectionData>
|
|
470
|
+
<option name="api" value="34" />
|
|
471
|
+
<option name="brand" value="samsung" />
|
|
472
|
+
<option name="codename" value="r11q" />
|
|
473
|
+
<option name="id" value="r11q" />
|
|
474
|
+
<option name="manufacturer" value="Samsung" />
|
|
475
|
+
<option name="name" value="SM-S711U" />
|
|
476
|
+
<option name="screenDensity" value="450" />
|
|
477
|
+
<option name="screenX" value="1080" />
|
|
478
|
+
<option name="screenY" value="2340" />
|
|
479
|
+
</PersistentDeviceSelectionData>
|
|
370
480
|
<PersistentDeviceSelectionData>
|
|
371
481
|
<option name="api" value="30" />
|
|
372
482
|
<option name="brand" value="google" />
|
|
@@ -389,6 +499,17 @@
|
|
|
389
499
|
<option name="screenX" value="1080" />
|
|
390
500
|
<option name="screenY" value="2400" />
|
|
391
501
|
</PersistentDeviceSelectionData>
|
|
502
|
+
<PersistentDeviceSelectionData>
|
|
503
|
+
<option name="api" value="34" />
|
|
504
|
+
<option name="brand" value="samsung" />
|
|
505
|
+
<option name="codename" value="t2q" />
|
|
506
|
+
<option name="id" value="t2q" />
|
|
507
|
+
<option name="manufacturer" value="Samsung" />
|
|
508
|
+
<option name="name" value="Galaxy S21 Plus" />
|
|
509
|
+
<option name="screenDensity" value="394" />
|
|
510
|
+
<option name="screenX" value="1080" />
|
|
511
|
+
<option name="screenY" value="2400" />
|
|
512
|
+
</PersistentDeviceSelectionData>
|
|
392
513
|
<PersistentDeviceSelectionData>
|
|
393
514
|
<option name="api" value="33" />
|
|
394
515
|
<option name="brand" value="google" />
|
|
@@ -411,6 +532,17 @@
|
|
|
411
532
|
<option name="screenX" value="1080" />
|
|
412
533
|
<option name="screenY" value="2424" />
|
|
413
534
|
</PersistentDeviceSelectionData>
|
|
535
|
+
<PersistentDeviceSelectionData>
|
|
536
|
+
<option name="api" value="35" />
|
|
537
|
+
<option name="brand" value="google" />
|
|
538
|
+
<option name="codename" value="tokay" />
|
|
539
|
+
<option name="id" value="tokay" />
|
|
540
|
+
<option name="manufacturer" value="Google" />
|
|
541
|
+
<option name="name" value="Pixel 9" />
|
|
542
|
+
<option name="screenDensity" value="420" />
|
|
543
|
+
<option name="screenX" value="1080" />
|
|
544
|
+
<option name="screenY" value="2424" />
|
|
545
|
+
</PersistentDeviceSelectionData>
|
|
414
546
|
</list>
|
|
415
547
|
</option>
|
|
416
548
|
</component>
|
package/.idea/modules.xml
CHANGED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="ProjectModuleManager">
|
|
4
|
-
<modules>
|
|
5
|
-
<module fileurl="file://$PROJECT_DIR$/.idea/easymerchantsdk-react-native.iml" filepath="$PROJECT_DIR$/.idea/easymerchantsdk-react-native.iml" />
|
|
6
|
-
</modules>
|
|
7
|
-
</component>
|
|
8
|
-
</project>
|
package/.idea/workspace.xml
CHANGED
|
@@ -4,7 +4,134 @@
|
|
|
4
4
|
<option name="autoReloadType" value="NONE" />
|
|
5
5
|
</component>
|
|
6
6
|
<component name="ChangeListManager">
|
|
7
|
-
<list default="true" id="3e2fa6c1-ea79-4c71-afdb-28176876a8c4" name="Changes" comment=""
|
|
7
|
+
<list default="true" id="3e2fa6c1-ea79-4c71-afdb-28176876a8c4" name="Changes" comment="">
|
|
8
|
+
<change beforePath="$PROJECT_DIR$/.idea/.gitignore" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.gitignore" afterDir="false" />
|
|
9
|
+
<change beforePath="$PROJECT_DIR$/.idea/caches/deviceStreaming.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/caches/deviceStreaming.xml" afterDir="false" />
|
|
10
|
+
<change beforePath="$PROJECT_DIR$/.idea/em-MobileCheckoutSDK-ReactNative.iml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/em-MobileCheckoutSDK-ReactNative.iml" afterDir="false" />
|
|
11
|
+
<change beforePath="$PROJECT_DIR$/.idea/modules.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/modules.xml" afterDir="false" />
|
|
12
|
+
<change beforePath="$PROJECT_DIR$/.npmrc" beforeDir="false" afterPath="$PROJECT_DIR$/.npmrc" afterDir="false" />
|
|
13
|
+
<change beforePath="$PROJECT_DIR$/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/README.md" afterDir="false" />
|
|
14
|
+
<change beforePath="$PROJECT_DIR$/android/build.gradle" beforeDir="false" afterPath="$PROJECT_DIR$/android/build.gradle" afterDir="false" />
|
|
15
|
+
<change beforePath="$PROJECT_DIR$/android/src/main/java/com/reactlibrary/RNEasymerchantsdkModule.java" beforeDir="false" afterPath="$PROJECT_DIR$/android/src/main/java/com/reactlibrary/RNEasymerchantsdkModule.java" afterDir="false" />
|
|
16
|
+
<change beforePath="$PROJECT_DIR$/ios/Bundle/EasyPayBundle.swift" beforeDir="false" />
|
|
17
|
+
<change beforePath="$PROJECT_DIR$/ios/Classes/EasyMerchantSdk.m" beforeDir="false" afterPath="$PROJECT_DIR$/ios/Classes/EasyMerchantSdk.m" afterDir="false" />
|
|
18
|
+
<change beforePath="$PROJECT_DIR$/ios/Classes/EasyMerchantSdk.swift" beforeDir="false" afterPath="$PROJECT_DIR$/ios/Classes/EasyMerchantSdk.swift" afterDir="false" />
|
|
19
|
+
<change beforePath="$PROJECT_DIR$/ios/Classes/EasyPayViewController.swift" beforeDir="false" afterPath="$PROJECT_DIR$/ios/Classes/EasyPayViewController.swift" afterDir="false" />
|
|
20
|
+
<change beforePath="$PROJECT_DIR$/ios/CustomComponents/CheckboxButton.swift" beforeDir="false" />
|
|
21
|
+
<change beforePath="$PROJECT_DIR$/ios/CustomComponents/FilledButton.swift" beforeDir="false" />
|
|
22
|
+
<change beforePath="$PROJECT_DIR$/ios/CustomComponents/OutlineButton.swift" beforeDir="false" />
|
|
23
|
+
<change beforePath="$PROJECT_DIR$/ios/CustomComponents/TextFieldStackView.swift" beforeDir="false" />
|
|
24
|
+
<change beforePath="$PROJECT_DIR$/ios/Example/Assets.xcassets/AccentColor.colorset/Contents.json" beforeDir="false" />
|
|
25
|
+
<change beforePath="$PROJECT_DIR$/ios/Example/Assets.xcassets/AppIcon.appiconset/Contents.json" beforeDir="false" />
|
|
26
|
+
<change beforePath="$PROJECT_DIR$/ios/Example/Assets.xcassets/Contents.json" beforeDir="false" />
|
|
27
|
+
<change beforePath="$PROJECT_DIR$/ios/Example/Base.lproj/LaunchScreen.storyboard" beforeDir="false" />
|
|
28
|
+
<change beforePath="$PROJECT_DIR$/ios/Example/Base.lproj/Main.storyboard" beforeDir="false" />
|
|
29
|
+
<change beforePath="$PROJECT_DIR$/ios/Example/ViewController.swift" beforeDir="false" afterPath="$PROJECT_DIR$/ios/Example/ViewController.swift" afterDir="false" />
|
|
30
|
+
<change beforePath="$PROJECT_DIR$/ios/Extensions/UIColor.swift" beforeDir="false" />
|
|
31
|
+
<change beforePath="$PROJECT_DIR$/ios/Extensions/UIFont.swift" beforeDir="false" />
|
|
32
|
+
<change beforePath="$PROJECT_DIR$/ios/Extensions/UIViewController+Extension.swift" beforeDir="false" />
|
|
33
|
+
<change beforePath="$PROJECT_DIR$/ios/Models/AdditionalInfo.swift" beforeDir="false" />
|
|
34
|
+
<change beforePath="$PROJECT_DIR$/ios/Models/BankAccountModel.swift" beforeDir="false" />
|
|
35
|
+
<change beforePath="$PROJECT_DIR$/ios/Models/BillingInfo.swift" beforeDir="false" />
|
|
36
|
+
<change beforePath="$PROJECT_DIR$/ios/Models/CardModel.swift" beforeDir="false" />
|
|
37
|
+
<change beforePath="$PROJECT_DIR$/ios/Models/Country.swift" beforeDir="false" />
|
|
38
|
+
<change beforePath="$PROJECT_DIR$/ios/Models/PaymentInfo.swift" beforeDir="false" />
|
|
39
|
+
<change beforePath="$PROJECT_DIR$/ios/Models/Request.swift" beforeDir="false" />
|
|
40
|
+
<change beforePath="$PROJECT_DIR$/ios/Models/Result.swift" beforeDir="false" />
|
|
41
|
+
<change beforePath="$PROJECT_DIR$/ios/Pods/UserDefaults/UserStoreSingleton.swift" beforeDir="false" />
|
|
42
|
+
<change beforePath="$PROJECT_DIR$/ios/Pods/ViewControllers/AdditionalInfoVC.swift" beforeDir="false" />
|
|
43
|
+
<change beforePath="$PROJECT_DIR$/ios/Pods/ViewControllers/BaseVC.swift" beforeDir="false" />
|
|
44
|
+
<change beforePath="$PROJECT_DIR$/ios/Pods/ViewControllers/BillingInfoVC/BillingInfoVC.swift" beforeDir="false" />
|
|
45
|
+
<change beforePath="$PROJECT_DIR$/ios/Pods/ViewControllers/BillingInfoVC/Cells/CityListTVC.swift" beforeDir="false" />
|
|
46
|
+
<change beforePath="$PROJECT_DIR$/ios/Pods/ViewControllers/BillingInfoVC/Cells/CountryListTVC.swift" beforeDir="false" />
|
|
47
|
+
<change beforePath="$PROJECT_DIR$/ios/Pods/ViewControllers/BillingInfoVC/Cells/StateListTVC.swift" beforeDir="false" />
|
|
48
|
+
<change beforePath="$PROJECT_DIR$/ios/Pods/ViewControllers/CountryListVC.swift" beforeDir="false" />
|
|
49
|
+
<change beforePath="$PROJECT_DIR$/ios/Pods/ViewControllers/EmailVerificationVC.swift" beforeDir="false" />
|
|
50
|
+
<change beforePath="$PROJECT_DIR$/ios/Pods/ViewControllers/OTPVerificationVC.swift" beforeDir="false" />
|
|
51
|
+
<change beforePath="$PROJECT_DIR$/ios/Pods/ViewControllers/PaymentDoneVC.swift" beforeDir="false" />
|
|
52
|
+
<change beforePath="$PROJECT_DIR$/ios/Pods/ViewControllers/PaymentErrorVC.swift" beforeDir="false" />
|
|
53
|
+
<change beforePath="$PROJECT_DIR$/ios/Pods/ViewControllers/PaymentInformation/AccountTypeTVC.swift" beforeDir="false" />
|
|
54
|
+
<change beforePath="$PROJECT_DIR$/ios/Pods/ViewControllers/PaymentInformation/PaymentInfoVC.swift" beforeDir="false" />
|
|
55
|
+
<change beforePath="$PROJECT_DIR$/ios/Pods/ViewControllers/PaymentInformation/PaymentInformationCVC.swift" beforeDir="false" />
|
|
56
|
+
<change beforePath="$PROJECT_DIR$/ios/Pods/ViewControllers/PaymentInformation/SavedAccountsTVC/SavedAccountTVC.swift" beforeDir="false" />
|
|
57
|
+
<change beforePath="$PROJECT_DIR$/ios/Pods/ViewControllers/PaymentInformation/SavedAccountsTVC/SavedAccountTVC.xib" beforeDir="false" />
|
|
58
|
+
<change beforePath="$PROJECT_DIR$/ios/Pods/ViewControllers/PaymentInformation/SavedCardsTVC/SavedCardsTVC.swift" beforeDir="false" />
|
|
59
|
+
<change beforePath="$PROJECT_DIR$/ios/Pods/ViewControllers/PaymentInformation/SavedCardsTVC/SavedCardsTVC.xib" beforeDir="false" />
|
|
60
|
+
<change beforePath="$PROJECT_DIR$/ios/Pods/ViewControllers/TermAndConditionsVC.swift" beforeDir="false" />
|
|
61
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/Card/Amex.imageset/206682_american_express_method_card_payment_icon.svg" beforeDir="false" />
|
|
62
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/Card/Amex.imageset/Contents.json" beforeDir="false" />
|
|
63
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/Card/Contents.json" beforeDir="false" />
|
|
64
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/Card/DinersClub.imageset/472318_card_club_diners_dinner_payment_icon.svg" beforeDir="false" />
|
|
65
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/Card/DinersClub.imageset/Contents.json" beforeDir="false" />
|
|
66
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/Card/Discover.imageset/206686_network_payment_discover_card_method_icon.svg" beforeDir="false" />
|
|
67
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/Card/Discover.imageset/Contents.json" beforeDir="false" />
|
|
68
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/Card/JCB.imageset/358102_card_jcb_payment_icon.svg" beforeDir="false" />
|
|
69
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/Card/JCB.imageset/Contents.json" beforeDir="false" />
|
|
70
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/Card/MasterCard.imageset/206680_master_method_card_payment_icon.svg" beforeDir="false" />
|
|
71
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/Card/MasterCard.imageset/Contents.json" beforeDir="false" />
|
|
72
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/Card/UnionPay.imageset/1468976_card_payment_unionpay_icon.svg" beforeDir="false" />
|
|
73
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/Card/UnionPay.imageset/Contents.json" beforeDir="false" />
|
|
74
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/Card/Visa.imageset/206684_visa_method_card_payment_icon.svg" beforeDir="false" />
|
|
75
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/Card/Visa.imageset/Contents.json" beforeDir="false" />
|
|
76
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/Card/maestro.imageset/Contents.json" beforeDir="false" />
|
|
77
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/Card/maestro.imageset/maestro.svg" beforeDir="false" />
|
|
78
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/Card/paypal.imageset/206675_paypal_method_payment_icon.svg" beforeDir="false" />
|
|
79
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/Card/paypal.imageset/Contents.json" beforeDir="false" />
|
|
80
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/Card/rupay.imageset/Contents.json" beforeDir="false" />
|
|
81
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/Card/rupay.imageset/rupay.svg" beforeDir="false" />
|
|
82
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/Card/unknown_card.imageset/4635000_card_credit_digital_money_icon.svg" beforeDir="false" />
|
|
83
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/Card/unknown_card.imageset/Contents.json" beforeDir="false" />
|
|
84
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/Card/worldpay.imageset/Contents.json" beforeDir="false" />
|
|
85
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/Card/worldpay.imageset/worldpay.svg" beforeDir="false" />
|
|
86
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/Contents.json" beforeDir="false" />
|
|
87
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/Ellipsis.imageset/Contents.json" beforeDir="false" />
|
|
88
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/Ellipsis.imageset/icons8-menu-30.png" beforeDir="false" />
|
|
89
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/Ellipsis.imageset/icons8-menu-60.png" beforeDir="false" />
|
|
90
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/Ellipsis.imageset/icons8-menu-90.png" beforeDir="false" />
|
|
91
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/Rotate.imageset/Contents.json" beforeDir="false" />
|
|
92
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/Rotate.imageset/refresh-cw-2.png" beforeDir="false" />
|
|
93
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/Rotate.imageset/refresh-cw-3.png" beforeDir="false" />
|
|
94
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/Rotate.imageset/refresh-cw.png" beforeDir="false" />
|
|
95
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/amexCvc.imageset/Contents.json" beforeDir="false" />
|
|
96
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/amexCvc.imageset/Group-1.png" beforeDir="false" />
|
|
97
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/amexCvc.imageset/Group.png" beforeDir="false" />
|
|
98
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/check.imageset/Contents.json" beforeDir="false" />
|
|
99
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/check.imageset/check-circle-4.png" beforeDir="false" />
|
|
100
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/check.imageset/check-circle-5.png" beforeDir="false" />
|
|
101
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/check.imageset/check-circle-6.png" beforeDir="false" />
|
|
102
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/chip.imageset/Contents.json" beforeDir="false" />
|
|
103
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/chip.imageset/chip.png" beforeDir="false" />
|
|
104
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/loaderImage.imageset/Contents.json" beforeDir="false" />
|
|
105
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/loaderImage.imageset/check-circle-2.png" beforeDir="false" />
|
|
106
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/loaderImage.imageset/check-circle-3.png" beforeDir="false" />
|
|
107
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/loaderImage.imageset/check-circle.png" beforeDir="false" />
|
|
108
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/payment_done_icon.imageset/Contents.json" beforeDir="false" />
|
|
109
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/payment_done_icon.imageset/payment_done_icon 1.png" beforeDir="false" />
|
|
110
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/payment_done_icon.imageset/payment_done_icon 2.png" beforeDir="false" />
|
|
111
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/payment_done_icon.imageset/payment_done_icon.png" beforeDir="false" />
|
|
112
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/payment_error_icon.imageset/Contents.json" beforeDir="false" />
|
|
113
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/payment_error_icon.imageset/payment_error_icon 1.png" beforeDir="false" />
|
|
114
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/payment_error_icon.imageset/payment_error_icon 2.png" beforeDir="false" />
|
|
115
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/payment_error_icon.imageset/payment_error_icon.png" beforeDir="false" />
|
|
116
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/wallet.imageset/Contents.json" beforeDir="false" />
|
|
117
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/wallet.imageset/icons8-wallet-24(@1×).png" beforeDir="false" />
|
|
118
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/wallet.imageset/icons8-wallet-48(@2×).png" beforeDir="false" />
|
|
119
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Assets.xcassets/wallet.imageset/icons8-wallet-72(@3×).png" beforeDir="false" />
|
|
120
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Colors.xcassets/00000008.colorset/Contents.json" beforeDir="false" />
|
|
121
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Colors.xcassets/00000016.colorset/Contents.json" beforeDir="false" />
|
|
122
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Colors.xcassets/00000038.colorset/Contents.json" beforeDir="false" />
|
|
123
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Colors.xcassets/00000060.colorset/Contents.json" beforeDir="false" />
|
|
124
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Colors.xcassets/1757D9.colorset/Contents.json" beforeDir="false" />
|
|
125
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Colors.xcassets/Contents.json" beforeDir="false" />
|
|
126
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/Colors.xcassets/E93939.colorset/Contents.json" beforeDir="false" />
|
|
127
|
+
<change beforePath="$PROJECT_DIR$/ios/Resources/PrivacyInfo.xcprivacy" beforeDir="false" />
|
|
128
|
+
<change beforePath="$PROJECT_DIR$/ios/ThirdParty/Keyboad Handling/KeyboardObserver.swift" beforeDir="false" />
|
|
129
|
+
<change beforePath="$PROJECT_DIR$/ios/easymerchantsdk.podspec" beforeDir="false" afterPath="$PROJECT_DIR$/ios/easymerchantsdk.podspec" afterDir="false" />
|
|
130
|
+
<change beforePath="$PROJECT_DIR$/ios/easymerchantsdk.storyboard" beforeDir="false" />
|
|
131
|
+
<change beforePath="$PROJECT_DIR$/package-lock.json" beforeDir="false" afterPath="$PROJECT_DIR$/package-lock.json" afterDir="false" />
|
|
132
|
+
<change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />
|
|
133
|
+
<change beforePath="$PROJECT_DIR$/src/index.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/index.js" afterDir="false" />
|
|
134
|
+
</list>
|
|
8
135
|
<option name="SHOW_DIALOG" value="false" />
|
|
9
136
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
10
137
|
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
|
@@ -35,10 +162,22 @@
|
|
|
35
162
|
"dart.analysis.tool.window.visible": "false",
|
|
36
163
|
"git-widget-placeholder": "dev-branch",
|
|
37
164
|
"kotlin-language-version-configured": "true",
|
|
38
|
-
"last_opened_file_path": "/Users/appdev/
|
|
39
|
-
"show.migrate.to.gradle.popup": "false"
|
|
165
|
+
"last_opened_file_path": "/Users/appdev/Documents/em-MobileCheckoutSDK-ReactNative/ios/Example",
|
|
166
|
+
"show.migrate.to.gradle.popup": "false",
|
|
167
|
+
"structure.view.defaults.are.configured": "true"
|
|
40
168
|
}
|
|
41
169
|
}]]></component>
|
|
170
|
+
<component name="RecentsManager">
|
|
171
|
+
<key name="CopyFile.RECENT_KEYS">
|
|
172
|
+
<recent name="$PROJECT_DIR$/ios/Example" />
|
|
173
|
+
<recent name="$PROJECT_DIR$/ios" />
|
|
174
|
+
</key>
|
|
175
|
+
<key name="MoveFile.RECENT_KEYS">
|
|
176
|
+
<recent name="$PROJECT_DIR$/ios" />
|
|
177
|
+
<recent name="$PROJECT_DIR$/ios/Pods" />
|
|
178
|
+
<recent name="$PROJECT_DIR$/ios/Example" />
|
|
179
|
+
</key>
|
|
180
|
+
</component>
|
|
42
181
|
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
|
43
182
|
<component name="SwiftWorkspaceSettings">
|
|
44
183
|
<option name="detectedToolchain" value="true" />
|
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ To add the path of sdk in your project. Open your `package.json` file and inside
|
|
|
8
8
|
```json
|
|
9
9
|
"dependencies": {
|
|
10
10
|
...
|
|
11
|
-
"@jimrising/easymerchantsdk-react-native": "^1.1.
|
|
11
|
+
"@jimrising/easymerchantsdk-react-native": "^1.1.3"
|
|
12
12
|
},
|
|
13
13
|
```
|
|
14
14
|
or using command
|
|
@@ -52,7 +52,6 @@ Now add below settings in AndroidManifest.xml file.
|
|
|
52
52
|
android:roundIcon="@mipmap/ic_launcher_round"
|
|
53
53
|
android:supportsRtl="true"
|
|
54
54
|
android:theme="@style/AppTheme">
|
|
55
|
-
.....
|
|
56
55
|
```
|
|
57
56
|
|
|
58
57
|
## Changes in IOS side.
|
|
@@ -183,6 +182,7 @@ const App = () => {
|
|
|
183
182
|
const [paymentResponse, setPaymentResponse] = useState('');
|
|
184
183
|
const [billingResult, setBillingResult] = useState('');
|
|
185
184
|
|
|
185
|
+
// Get the platform version of the device
|
|
186
186
|
const getPlatformVersion = async () => {
|
|
187
187
|
try {
|
|
188
188
|
if (Platform.OS === 'android') {
|
|
@@ -197,6 +197,7 @@ const App = () => {
|
|
|
197
197
|
}
|
|
198
198
|
};
|
|
199
199
|
|
|
200
|
+
// Handle billing (payment process)
|
|
200
201
|
const handleBilling = async () => {
|
|
201
202
|
const amount = '100';
|
|
202
203
|
const additionalInfoRequest = {
|
|
@@ -220,14 +221,12 @@ const App = () => {
|
|
|
220
221
|
|
|
221
222
|
try {
|
|
222
223
|
if (Platform.OS === 'android') {
|
|
223
|
-
//
|
|
224
|
-
const response = await RNEasymerchantsdk.billing(amount,
|
|
225
|
-
// const response = await RNEasymerchantsdk.billing(amount, null,'production','apiKey','secretKey');
|
|
224
|
+
// Calling Android billing method with environment and keys
|
|
225
|
+
const response = await RNEasymerchantsdk.billing(amount, jsonString, 'sandbox', 'apiKey', 'secretKey');
|
|
226
226
|
setPaymentResponse(`Payment Success: ${response}`);
|
|
227
227
|
} else if (Platform.OS === 'ios') {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
// const result = await EasyMerchantSdk.billing(amount, jsonString,'production','apiKey','secretKey');
|
|
228
|
+
// Calling iOS billing method with environment and keys
|
|
229
|
+
const result = await EasyMerchantSdk.billing(amount, jsonString, 'sandbox', 'apiKey', 'secretKey');
|
|
231
230
|
setBillingResult(`Billing Success: ${result}`);
|
|
232
231
|
}
|
|
233
232
|
} catch (error) {
|
|
@@ -239,11 +238,13 @@ const App = () => {
|
|
|
239
238
|
}
|
|
240
239
|
};
|
|
241
240
|
|
|
241
|
+
// Set the ViewController for iOS (needs to be called once during app initialization)
|
|
242
242
|
useEffect(() => {
|
|
243
243
|
if (Platform.OS === 'ios') {
|
|
244
244
|
const initializeViewController = async () => {
|
|
245
245
|
if (EasyMerchantSdk && EasyMerchantSdk.setViewController) {
|
|
246
246
|
try {
|
|
247
|
+
// Assuming you want to pass the current view controller
|
|
247
248
|
await EasyMerchantSdk.setViewController();
|
|
248
249
|
console.log('ViewController set successfully');
|
|
249
250
|
} catch (error) {
|
|
@@ -283,6 +284,7 @@ const styles = StyleSheet.create({
|
|
|
283
284
|
export default App;
|
|
284
285
|
|
|
285
286
|
|
|
287
|
+
|
|
286
288
|
```
|
|
287
289
|
|
|
288
290
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
RCT_EXPORT_MODULE()
|
|
9
9
|
|
|
10
|
-
//
|
|
10
|
+
// Method to handle the billing process
|
|
11
11
|
RCT_EXPORT_METHOD(billing:(NSString *)amount
|
|
12
12
|
billingInfo:(NSString *)billingInfo
|
|
13
13
|
environment:(NSString *)environment
|
|
@@ -16,27 +16,40 @@ RCT_EXPORT_METHOD(billing:(NSString *)amount
|
|
|
16
16
|
resolve:(RCTPromiseResolveBlock)resolve
|
|
17
17
|
reject:(RCTPromiseRejectBlock)reject)
|
|
18
18
|
{
|
|
19
|
+
// Create an instance of EasyMerchantSdkPlugin to interact with the SDK
|
|
19
20
|
EasyMerchantSdkPlugin *sdkPlugin = [[EasyMerchantSdkPlugin alloc] init];
|
|
20
21
|
|
|
21
|
-
// Configure SDK with provided
|
|
22
|
+
// Configure the SDK with provided environment, API key, and API secret
|
|
22
23
|
[sdkPlugin configureEnvironment:environment apiKey:apiKey apiSecret:apiSecret];
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
// Call the billing method of the SDK
|
|
26
|
+
// [sdkPlugin billing:amount billinginfo:billingInfo resolver:resolve rejecter:reject];
|
|
25
27
|
}
|
|
26
28
|
|
|
29
|
+
// Method to set the view controller for presenting the payment UI
|
|
27
30
|
RCT_EXPORT_METHOD(setViewController:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject)
|
|
28
31
|
{
|
|
32
|
+
// Get the root view controller from the app delegate
|
|
29
33
|
UIViewController *rootViewController = [UIApplication sharedApplication].delegate.window.rootViewController;
|
|
34
|
+
|
|
35
|
+
// Create an instance of EasyMerchantSdkPlugin to interact with the SDK
|
|
30
36
|
EasyMerchantSdkPlugin *sdkPlugin = [[EasyMerchantSdkPlugin alloc] init];
|
|
37
|
+
|
|
38
|
+
// Set the view controller for the SDK
|
|
31
39
|
[sdkPlugin setViewController:rootViewController];
|
|
40
|
+
|
|
41
|
+
// Resolve the promise after setting the view controller
|
|
32
42
|
resolve(@"ViewController set successfully");
|
|
33
43
|
}
|
|
34
44
|
|
|
35
|
-
//
|
|
45
|
+
// Method to return the platform version (iOS version)
|
|
36
46
|
RCT_EXPORT_METHOD(getPlatformVersion:(RCTPromiseResolveBlock)resolve
|
|
37
47
|
rejecter:(RCTPromiseRejectBlock)reject)
|
|
38
48
|
{
|
|
49
|
+
// Get the iOS system version
|
|
39
50
|
NSString *platformVersion = [NSString stringWithFormat:@"iOS %@", [[UIDevice currentDevice] systemVersion]];
|
|
51
|
+
|
|
52
|
+
// Resolve the promise with the platform version
|
|
40
53
|
resolve(platformVersion);
|
|
41
54
|
}
|
|
42
55
|
|
|
@@ -11,7 +11,7 @@ public class EasyMerchantSdkPlugin: NSObject {
|
|
|
11
11
|
// Configure SDK environment and keys
|
|
12
12
|
@objc public func configureEnvironment(_ environment: String, apiKey: String, apiSecret: String) {
|
|
13
13
|
let selectedEnvironment: EnvironmentConfig.Environment
|
|
14
|
-
|
|
14
|
+
|
|
15
15
|
switch environment.lowercased() {
|
|
16
16
|
case "production":
|
|
17
17
|
selectedEnvironment = .production
|
|
@@ -20,13 +20,13 @@ public class EasyMerchantSdkPlugin: NSObject {
|
|
|
20
20
|
case "staging":
|
|
21
21
|
selectedEnvironment = .staging
|
|
22
22
|
default:
|
|
23
|
-
selectedEnvironment = .staging
|
|
23
|
+
selectedEnvironment = .staging
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
// Configure EnvironmentConfig
|
|
27
27
|
EnvironmentConfig.setEnvironment(selectedEnvironment)
|
|
28
28
|
EnvironmentConfig.configure(apiKey: apiKey, apiSecret: apiSecret)
|
|
29
|
-
|
|
29
|
+
|
|
30
30
|
// Optionally, print the base URL to confirm the correct environment is set
|
|
31
31
|
print("Configured environment: \(selectedEnvironment), Base URL: \(EnvironmentConfig.baseURL)")
|
|
32
32
|
}
|
|
@@ -40,17 +40,19 @@ public class EasyMerchantSdkPlugin: NSObject {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
// Billing method: Handles payment request
|
|
43
|
-
@objc public func
|
|
44
|
-
|
|
43
|
+
@objc public func startPaymentProcess(
|
|
44
|
+
amount: String,
|
|
45
45
|
billinginfo: String,
|
|
46
46
|
resolver: @escaping RCTPromiseResolveBlock,
|
|
47
47
|
rejecter: @escaping RCTPromiseRejectBlock
|
|
48
48
|
) {
|
|
49
|
+
// Validate the amount
|
|
49
50
|
guard let amountValue = Double(amount), amountValue > 0 else {
|
|
50
51
|
rejecter("INVALID_AMOUNT", "Amount must be a positive number", nil)
|
|
51
52
|
return
|
|
52
53
|
}
|
|
53
54
|
|
|
55
|
+
// Parse billing info
|
|
54
56
|
guard !billinginfo.isEmpty,
|
|
55
57
|
let billingInfoData = billinginfo.data(using: .utf8),
|
|
56
58
|
let billingInfoJSON = try? JSONSerialization.jsonObject(with: billingInfoData, options: []) as? [String: Any] else {
|
|
@@ -58,7 +60,10 @@ public class EasyMerchantSdkPlugin: NSObject {
|
|
|
58
60
|
return
|
|
59
61
|
}
|
|
60
62
|
|
|
63
|
+
// Create the payment request
|
|
61
64
|
let request = Request(amount: amountValue, billingInfoData: billingInfoData)
|
|
65
|
+
|
|
66
|
+
// Create the payment controller
|
|
62
67
|
let paymentController = EasyPayViewController(request: request, delegate: self)
|
|
63
68
|
|
|
64
69
|
DispatchQueue.main.async {
|
|
@@ -84,6 +89,7 @@ public class EasyMerchantSdkPlugin: NSObject {
|
|
|
84
89
|
}
|
|
85
90
|
}
|
|
86
91
|
|
|
92
|
+
// Conform to RCTBridgeModule
|
|
87
93
|
@objc(EasyMerchantSdkPlugin)
|
|
88
94
|
extension EasyMerchantSdkPlugin: RCTBridgeModule {
|
|
89
95
|
public static func moduleName() -> String {
|
|
@@ -95,6 +101,7 @@ extension EasyMerchantSdkPlugin: RCTBridgeModule {
|
|
|
95
101
|
}
|
|
96
102
|
}
|
|
97
103
|
|
|
104
|
+
// Conform to EasyPayViewControllerDelegate
|
|
98
105
|
extension EasyMerchantSdkPlugin: EasyPayViewControllerDelegate {
|
|
99
106
|
public func easyPayController(_ controller: EasyPayViewController, didFinishWith result: Result) {
|
|
100
107
|
DispatchQueue.main.async {
|
|
@@ -7,13 +7,11 @@
|
|
|
7
7
|
|
|
8
8
|
import UIKit
|
|
9
9
|
|
|
10
|
-
@available(iOS 16.0, *)
|
|
11
10
|
@objc
|
|
12
11
|
public protocol EasyPayViewControllerDelegate {
|
|
13
12
|
func easyPayController(_ controller: EasyPayViewController, didFinishWith result: Result)
|
|
14
13
|
}
|
|
15
14
|
|
|
16
|
-
@available(iOS 16.0, *)
|
|
17
15
|
@objc
|
|
18
16
|
public final class EasyPayViewController: UINavigationController {
|
|
19
17
|
|
|
@@ -60,25 +58,23 @@ public final class EasyPayViewController: UINavigationController {
|
|
|
60
58
|
vc.modalPresentationStyle = .overFullScreen
|
|
61
59
|
vc.configureWith(request: request, delegate: easyPayDelegate)
|
|
62
60
|
vc.amount = Int(request.amount) // Set the amount here
|
|
63
|
-
|
|
64
61
|
self.navigationBar.isHidden = true
|
|
65
62
|
self.setViewControllers([vc], animated: false)
|
|
66
63
|
}
|
|
67
64
|
|
|
68
65
|
}
|
|
69
66
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
detents
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
67
|
+
//private extension EasyPayViewController {
|
|
68
|
+
//
|
|
69
|
+
// func setupDetents() {
|
|
70
|
+
// if let sheetController = self.sheetPresentationController {
|
|
71
|
+
// sheetController.prefersGrabberVisible = false
|
|
72
|
+
// var detents: [UISheetPresentationController.Detent] = []
|
|
73
|
+
// detents.append(.large())
|
|
74
|
+
// sheetController.detents = detents
|
|
75
|
+
// }
|
|
76
|
+
// }
|
|
77
|
+
//}
|
|
82
78
|
|
|
83
79
|
private extension EasyPayViewController {
|
|
84
80
|
|