@jimrising/easymerchantsdk-react-native 1.4.1 → 1.4.2

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.
Files changed (61) hide show
  1. package/README.md +1 -1
  2. package/android/build/.transforms/20e1216b87bd06eaab3c9e5c68d4267a/results.bin +1 -0
  3. package/android/build/.transforms/20e1216b87bd06eaab3c9e5c68d4267a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/BuildConfig.dex +0 -0
  4. package/android/build/.transforms/20e1216b87bd06eaab3c9e5c68d4267a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/RNEasymerchantsdkModule$1.dex +0 -0
  5. package/android/build/.transforms/20e1216b87bd06eaab3c9e5c68d4267a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/RNEasymerchantsdkModule$2.dex +0 -0
  6. package/android/build/.transforms/20e1216b87bd06eaab3c9e5c68d4267a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/RNEasymerchantsdkModule.dex +0 -0
  7. package/android/build/.transforms/20e1216b87bd06eaab3c9e5c68d4267a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/RNEasymerchantsdkPackage.dex +0 -0
  8. package/android/build/.transforms/20e1216b87bd06eaab3c9e5c68d4267a/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
  9. package/android/build/.transforms/e9a664a11ce12edf79cd87b1e07aa243/results.bin +1 -0
  10. package/android/build/.transforms/e9a664a11ce12edf79cd87b1e07aa243/transformed/classes/classes_dex/classes.dex +0 -0
  11. package/android/build/generated/source/buildConfig/debug/com/reactlibrary/BuildConfig.java +10 -0
  12. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +7 -0
  13. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +18 -0
  14. package/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +6 -0
  15. package/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +1 -0
  16. package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
  17. package/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
  18. package/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +0 -0
  19. package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +1 -0
  20. package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +2 -0
  21. package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
  22. package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
  23. package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +2 -0
  24. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactlibrary/BuildConfig.class +0 -0
  25. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactlibrary/RNEasymerchantsdkModule$1.class +0 -0
  26. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactlibrary/RNEasymerchantsdkModule$2.class +0 -0
  27. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactlibrary/RNEasymerchantsdkModule.class +0 -0
  28. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactlibrary/RNEasymerchantsdkPackage.class +0 -0
  29. package/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +2 -0
  30. package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +7 -0
  31. package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +7 -0
  32. package/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +1 -0
  33. package/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +1 -0
  34. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/reactlibrary/BuildConfig.class +0 -0
  35. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/reactlibrary/RNEasymerchantsdkModule$1.class +0 -0
  36. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/reactlibrary/RNEasymerchantsdkModule$2.class +0 -0
  37. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/reactlibrary/RNEasymerchantsdkModule.class +0 -0
  38. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/reactlibrary/RNEasymerchantsdkPackage.class +0 -0
  39. package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
  40. package/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +1 -0
  41. package/android/build/outputs/logs/manifest-merger-debug-report.txt +17 -0
  42. package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/RNEasymerchantsdkModule$1.class.uniqueId2 +0 -0
  43. package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/RNEasymerchantsdkModule$2.class.uniqueId0 +0 -0
  44. package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/RNEasymerchantsdkModule.class.uniqueId3 +0 -0
  45. package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/RNEasymerchantsdkPackage.class.uniqueId1 +0 -0
  46. package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  47. package/android/build.gradle +4 -1
  48. package/android/src/main/java/com/reactlibrary/RNEasymerchantsdkModule.java +158 -36
  49. package/android/src/main/java/com/reactlibrary/RNEasymerchantsdkPackage.java +45 -13
  50. package/ios/Classes/EasyMerchantSdk.m +2 -2
  51. package/ios/Pods/ViewControllers/AdditionalInfoVC.swift +10 -8
  52. package/ios/Pods/ViewControllers/BaseVC.swift +17 -6
  53. package/ios/Pods/ViewControllers/BillingInfoVC/BillingInfoVC.swift +10 -8
  54. package/ios/Pods/ViewControllers/CountryListVC.swift +20 -0
  55. package/ios/Pods/ViewControllers/CustomOverlay.swift +199 -0
  56. package/ios/Pods/ViewControllers/PaymentDoneVC.swift +30 -30
  57. package/ios/Pods/ViewControllers/PaymentInformation/PaymentInfoVC.swift +3 -32
  58. package/ios/Pods/ViewControllers/ThreeDSecurePaymentDoneVC.swift +548 -57
  59. package/ios/easymerchantsdk.podspec +1 -1
  60. package/ios/easymerchantsdk.storyboard +954 -786
  61. package/package.json +1 -1
package/README.md CHANGED
@@ -7,7 +7,7 @@ To add the path of sdk in your project. Open your `package.json` file and inside
7
7
 
8
8
  ```json
9
9
  "dependencies": {
10
- "@jimrising/easymerchantsdk-react-native": "^1.4.1"
10
+ "@jimrising/easymerchantsdk-react-native": "^1.4.2"
11
11
  },
12
12
  ```
13
13
 
@@ -0,0 +1 @@
1
+ o/bundleLibRuntimeToDirDebug
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Automatically generated file. DO NOT MODIFY
3
+ */
4
+ package com.reactlibrary;
5
+
6
+ public final class BuildConfig {
7
+ public static final boolean DEBUG = Boolean.parseBoolean("true");
8
+ public static final String LIBRARY_PACKAGE_NAME = "com.reactlibrary";
9
+ public static final String BUILD_TYPE = "debug";
10
+ }
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
+ package="com.reactlibrary" >
4
+
5
+ <uses-sdk android:minSdkVersion="16" />
6
+
7
+ </manifest>
@@ -0,0 +1,18 @@
1
+ {
2
+ "version": 3,
3
+ "artifactType": {
4
+ "type": "AAPT_FRIENDLY_MERGED_MANIFESTS",
5
+ "kind": "Directory"
6
+ },
7
+ "applicationId": "com.reactlibrary",
8
+ "variantName": "debug",
9
+ "elements": [
10
+ {
11
+ "type": "SINGLE",
12
+ "filters": [],
13
+ "attributes": [],
14
+ "outputFile": "AndroidManifest.xml"
15
+ }
16
+ ],
17
+ "elementType": "File"
18
+ }
@@ -0,0 +1,6 @@
1
+ aarFormatVersion=1.0
2
+ aarMetadataVersion=1.0
3
+ minCompileSdk=1
4
+ minCompileSdkExtension=0
5
+ minAndroidGradlePluginVersion=1.0.0
6
+ coreLibraryDesugaringEnabled=false
@@ -0,0 +1,2 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <merger version="3"><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/appdev/Documents/GitHub/lyfecycle-sample-RN-sdk/node_modules/@jimrising/easymerchantsdk-react-native/android/src/main/res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main" generated-set="main$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/appdev/Documents/GitHub/lyfecycle-sample-RN-sdk/node_modules/@jimrising/easymerchantsdk-react-native/android/src/main/res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="debug$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/appdev/Documents/GitHub/lyfecycle-sample-RN-sdk/node_modules/@jimrising/easymerchantsdk-react-native/android/src/debug/res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="debug" generated-set="debug$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/appdev/Documents/GitHub/lyfecycle-sample-RN-sdk/node_modules/@jimrising/easymerchantsdk-react-native/android/src/debug/res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="generated$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/appdev/Documents/GitHub/lyfecycle-sample-RN-sdk/node_modules/@jimrising/easymerchantsdk-react-native/android/build/generated/res/resValues/debug"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="generated" generated-set="generated$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/appdev/Documents/GitHub/lyfecycle-sample-RN-sdk/node_modules/@jimrising/easymerchantsdk-react-native/android/build/generated/res/resValues/debug"/></dataSet><mergedItems/></merger>
@@ -0,0 +1,2 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/appdev/Documents/GitHub/lyfecycle-sample-RN-sdk/node_modules/@jimrising/easymerchantsdk-react-native/android/src/main/jniLibs"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/appdev/Documents/GitHub/lyfecycle-sample-RN-sdk/node_modules/@jimrising/easymerchantsdk-react-native/android/src/debug/jniLibs"/></dataSet></merger>
@@ -0,0 +1,2 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/appdev/Documents/GitHub/lyfecycle-sample-RN-sdk/node_modules/@jimrising/easymerchantsdk-react-native/android/src/main/shaders"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/appdev/Documents/GitHub/lyfecycle-sample-RN-sdk/node_modules/@jimrising/easymerchantsdk-react-native/android/src/debug/shaders"/></dataSet></merger>
@@ -0,0 +1,2 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/appdev/Documents/GitHub/lyfecycle-sample-RN-sdk/node_modules/@jimrising/easymerchantsdk-react-native/android/src/main/assets"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/appdev/Documents/GitHub/lyfecycle-sample-RN-sdk/node_modules/@jimrising/easymerchantsdk-react-native/android/src/debug/assets"/></dataSet><dataSet config="generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/appdev/Documents/GitHub/lyfecycle-sample-RN-sdk/node_modules/@jimrising/easymerchantsdk-react-native/android/build/intermediates/shader_assets/debug/compileDebugShaders/out"/></dataSet></merger>
@@ -0,0 +1,2 @@
1
+ R_DEF: Internal format may change without notice
2
+ local
@@ -0,0 +1,7 @@
1
+ 1<?xml version="1.0" encoding="utf-8"?>
2
+ 2<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
+ 3 package="com.reactlibrary" >
4
+ 4
5
+ 5 <uses-sdk android:minSdkVersion="16" />
6
+ 6
7
+ 7</manifest>
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
+ package="com.reactlibrary" >
4
+
5
+ <uses-sdk android:minSdkVersion="16" />
6
+
7
+ </manifest>
@@ -0,0 +1,17 @@
1
+ -- Merging decision tree log ---
2
+ manifest
3
+ ADDED from /Users/appdev/Documents/GitHub/lyfecycle-sample-RN-sdk/node_modules/@jimrising/easymerchantsdk-react-native/android/src/main/AndroidManifest.xml:2:1-4:12
4
+ INJECTED from /Users/appdev/Documents/GitHub/lyfecycle-sample-RN-sdk/node_modules/@jimrising/easymerchantsdk-react-native/android/src/main/AndroidManifest.xml:2:1-4:12
5
+ package
6
+ ADDED from /Users/appdev/Documents/GitHub/lyfecycle-sample-RN-sdk/node_modules/@jimrising/easymerchantsdk-react-native/android/src/main/AndroidManifest.xml:3:11-37
7
+ INJECTED from /Users/appdev/Documents/GitHub/lyfecycle-sample-RN-sdk/node_modules/@jimrising/easymerchantsdk-react-native/android/src/main/AndroidManifest.xml
8
+ xmlns:android
9
+ ADDED from /Users/appdev/Documents/GitHub/lyfecycle-sample-RN-sdk/node_modules/@jimrising/easymerchantsdk-react-native/android/src/main/AndroidManifest.xml:2:11-69
10
+ uses-sdk
11
+ INJECTED from /Users/appdev/Documents/GitHub/lyfecycle-sample-RN-sdk/node_modules/@jimrising/easymerchantsdk-react-native/android/src/main/AndroidManifest.xml reason: use-sdk injection requested
12
+ INJECTED from /Users/appdev/Documents/GitHub/lyfecycle-sample-RN-sdk/node_modules/@jimrising/easymerchantsdk-react-native/android/src/main/AndroidManifest.xml
13
+ INJECTED from /Users/appdev/Documents/GitHub/lyfecycle-sample-RN-sdk/node_modules/@jimrising/easymerchantsdk-react-native/android/src/main/AndroidManifest.xml
14
+ android:targetSdkVersion
15
+ INJECTED from /Users/appdev/Documents/GitHub/lyfecycle-sample-RN-sdk/node_modules/@jimrising/easymerchantsdk-react-native/android/src/main/AndroidManifest.xml
16
+ android:minSdkVersion
17
+ INJECTED from /Users/appdev/Documents/GitHub/lyfecycle-sample-RN-sdk/node_modules/@jimrising/easymerchantsdk-react-native/android/src/main/AndroidManifest.xml
@@ -39,11 +39,14 @@ repositories {
39
39
  }
40
40
 
41
41
  dependencies {
42
- implementation 'com.app:paysdk:1.1.7'
42
+ implementation 'com.app:paysdk:1.2.2'
43
43
  implementation 'com.hbb20:ccp:2.7.3'
44
44
  implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.1"
45
45
  implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.1"
46
46
  implementation 'com.github.androidmads:QRGenerator:1.0.1'
47
+ implementation('com.microblink:blinkcard:2.10.0@aar') {
48
+ transitive = true
49
+ }
47
50
  implementation 'androidx.appcompat:appcompat:1.6.1'
48
51
  implementation 'com.google.android.material:material:1.8.0'
49
52
  implementation 'com.facebook.react:react-native:+'
@@ -1,28 +1,33 @@
1
1
  package com.reactlibrary;
2
2
 
3
+ import android.app.Activity;
4
+ import androidx.annotation.NonNull;
5
+ import com.app.paysdk.init.EasyPaymentFactory;
6
+ import com.app.paysdk.service.EasyPaymentService;
3
7
  import com.facebook.react.bridge.ReactApplicationContext;
4
8
  import com.facebook.react.bridge.ReactContextBaseJavaModule;
5
9
  import com.facebook.react.bridge.ReactMethod;
6
10
  import com.facebook.react.bridge.Promise;
7
-
8
- import java.util.concurrent.ExecutorService;
9
- import java.util.concurrent.Executors;
10
-
11
- import android.app.Activity;
12
-
13
- import com.facebook.react.bridge.Callback;
14
-
11
+ import com.facebook.react.bridge.ReadableMap;
12
+ import com.facebook.react.bridge.ReadableArray;
13
+ import com.facebook.react.bridge.WritableMap;
14
+ import com.facebook.react.bridge.Arguments;
15
15
  import org.json.JSONObject;
16
-
17
-
18
- import com.app.paysdk.init.EasyPaymentFactory;
19
- import com.app.paysdk.service.EasyPaymentService;
16
+ import org.json.JSONArray;
17
+ import org.json.JSONException;
18
+ import java.util.HashMap;
19
+ import java.util.ArrayList;
20
+ import java.util.List;
20
21
 
21
22
  public class RNEasymerchantsdkModule extends ReactContextBaseJavaModule {
22
- RNEasymerchantsdkModule(ReactApplicationContext context) {
23
+ private final ReactApplicationContext reactContext;
24
+
25
+ public RNEasymerchantsdkModule(ReactApplicationContext context) {
23
26
  super(context);
27
+ this.reactContext = context;
24
28
  }
25
29
 
30
+ @NonNull
26
31
  @Override
27
32
  public String getName() {
28
33
  return "RNEasymerchantsdk";
@@ -34,40 +39,157 @@ public class RNEasymerchantsdkModule extends ReactContextBaseJavaModule {
34
39
  String platformVersion = "Android " + android.os.Build.VERSION.RELEASE;
35
40
  promise.resolve(platformVersion);
36
41
  } catch (Exception e) {
37
- promise.reject("ERROR", e.getMessage());
42
+ promise.reject("ERROR", "Failed to get platform version: " + e.getMessage());
38
43
  }
39
44
  }
40
45
 
41
46
  @ReactMethod
42
- public void billing(String amount, String billinginfo, Promise promise) {
47
+ public void makePayment(ReadableMap configMap, Promise promise) {
43
48
  Activity currentActivity = getCurrentActivity();
44
49
  if (currentActivity == null) {
45
- promise.reject("ERROR", "Activity is not initialized");
50
+ promise.reject("ERROR", "Activity is not initialized.");
46
51
  return;
47
52
  }
48
53
 
49
54
  try {
55
+ // Validate required fields
56
+ if (!configMap.hasKey("amount") || configMap.getString("amount").isEmpty() || Float.parseFloat(configMap.getString("amount")) <= 0) {
57
+ promise.reject("ERROR", "Invalid or missing amount.");
58
+ return;
59
+ }
50
60
 
51
- // Making the payment call
52
- new EasyPaymentService(currentActivity).makePayment(amount, (billinginfo == null) ? null : new JSONObject(billinginfo), new EasyPaymentFactory.OnTransactionListener() {
53
- @Override
54
- public void onSuccess(String response) {
55
- promise.resolve(response); // Resolve the promise on success
56
- }
57
-
58
- @Override
59
- public void onError(String error) {
60
- promise.reject("ERROR", error); // Reject the promise on error
61
- }
62
- });
63
- } catch (Exception e) {
64
- promise.reject("ERROR", e.getMessage());
61
+ if (!configMap.hasKey("apiKey") || !configMap.hasKey("secretKey")) {
62
+ promise.reject("ERROR", "Missing apiKey or secretKey.");
63
+ return;
64
+ }
65
+
66
+ // Extract configurations
67
+ String amountStr = configMap.getString("amount");
68
+ String apiKey = configMap.getString("apiKey");
69
+ String secretKey = configMap.getString("secretKey");
70
+ JSONObject jsonConfig = new JSONObject(configMap.getMap("jsonConfig").toHashMap());
71
+ ReadableMap hashMapConfig = configMap.getMap("hashMapConfig");
72
+
73
+ // Build hashMap configuration
74
+ HashMap<String, Object> hashMap = new HashMap<>();
75
+ hashMap.put("amount", hashMapConfig.getString("amount"));
76
+ hashMap.put("currency", hashMapConfig.getString("currency"));
77
+ hashMap.put("tokenOnly", hashMapConfig.getBoolean("tokenOnly"));
78
+ hashMap.put("saveCard", hashMapConfig.getBoolean("saveCard"));
79
+ hashMap.put("saveAccount", hashMapConfig.getBoolean("saveAccount"));
80
+
81
+ // Handle payment methods
82
+ ReadableArray paymentMethodsArray = hashMapConfig.getArray("paymentMethods");
83
+ List<String> paymentMethods = new ArrayList<>();
84
+ for (int i = 0; i < paymentMethodsArray.size(); i++) {
85
+ paymentMethods.add(paymentMethodsArray.getString(i));
86
+ }
87
+ hashMap.put("paymentMethods", paymentMethods);
88
+
89
+ hashMap.put("fontSize", (float) hashMapConfig.getDouble("fontSize"));
90
+ hashMap.put("showDonate", hashMapConfig.getBoolean("showDonate"));
91
+ hashMap.put("enableRecurring", hashMapConfig.getBoolean("enableRecurring"));
92
+
93
+ // Handle recurring data
94
+ ReadableMap recurringDataMap = hashMapConfig.getMap("recurringData");
95
+ JSONObject recurringInfo = new JSONObject();
96
+ recurringInfo.put("allowCycles", recurringDataMap.getInt("allowCycles"));
97
+ ReadableArray intervalsArray = recurringDataMap.getArray("intervals");
98
+ JSONArray intervals = new JSONArray();
99
+ for (int i = 0; i < intervalsArray.size(); i++) {
100
+ intervals.put(intervalsArray.getString(i));
101
+ }
102
+ recurringInfo.put("intervals", intervals);
103
+ recurringInfo.put("recurringStartType", recurringDataMap.getString("recurringStartType"));
104
+ hashMap.put("recurringData", recurringInfo);
105
+
106
+ hashMap.put("authenticateBank", hashMapConfig.getBoolean("authenticateBank"));
107
+
108
+ // Handle GrailPayParams
109
+ ReadableMap grailPayParamsMap = hashMapConfig.getMap("grailPayParams");
110
+ JSONObject grailPayParamsJson = new JSONObject();
111
+ grailPayParamsJson.put("accessToken", grailPayParamsMap.getString("accessToken"));
112
+ grailPayParamsJson.put("vendorId", grailPayParamsMap.getString("vendorId"));
113
+ grailPayParamsJson.put("role", grailPayParamsMap.getString("role"));
114
+ grailPayParamsJson.put("timeout", grailPayParamsMap.getInt("timeout"));
115
+ grailPayParamsJson.put("isSandbox", grailPayParamsMap.getBoolean("isSandbox"));
116
+ grailPayParamsJson.put("brandingName", grailPayParamsMap.getString("brandingName"));
117
+ grailPayParamsJson.put("finderSubtitle", grailPayParamsMap.getString("finderSubtitle"));
118
+ grailPayParamsJson.put("searchPlaceholder", grailPayParamsMap.getString("searchPlaceholder"));
119
+ hashMap.put("grailPayParams", grailPayParamsJson);
120
+
121
+ hashMap.put("is3DSecureEnable", hashMapConfig.getBoolean("is3DSecureEnable"));
122
+ hashMap.put("showPrice", hashMapConfig.getBoolean("showPrice"));
123
+
124
+ // Handle billing info
125
+ if (hashMapConfig.hasKey("billingInfo")) {
126
+ JSONObject billingInfo = new JSONObject(hashMapConfig.getMap("billingInfo").toHashMap());
127
+ hashMap.put("billingInfo", billingInfo);
128
+ }
129
+
130
+
131
+
132
+ EasyPaymentFactory easyPaymentFactory = EasyPaymentFactory.INSTANCE;
133
+ EasyPaymentService easyPaymentService = easyPaymentFactory.create(
134
+ currentActivity,
135
+ jsonConfig.getString("environment"),
136
+ apiKey,
137
+ secretKey);
138
+
139
+
140
+ // Make payment
141
+ easyPaymentService.makePayment(
142
+ jsonConfig,
143
+ hashMap,
144
+ new EasyPaymentFactory.OnTransactionListener() {
145
+ @Override
146
+ public void onSuccess(String response) {
147
+ WritableMap result = Arguments.createMap();
148
+ result.putString("response", response);
149
+ promise.resolve(result);
150
+ }
151
+
152
+ @Override
153
+ public void onError(String error) {
154
+ promise.reject("PAYMENT_ERROR", error);
155
+ }
156
+ }
157
+ );
158
+ } catch (JSONException ex) {
159
+ promise.reject("JSON_ERROR", "Invalid JSON configuration: " + ex.getMessage());
160
+ } catch (Exception ex) {
161
+ promise.reject("ERROR", "Payment failed: " + ex.getMessage());
65
162
  }
163
+ }
66
164
 
67
- // } catch (Exception e) {
68
- // promise.reject("ERROR", e.getMessage() != null ? e.getMessage() : "Unknown error");
69
- // }
70
- // }
71
- // });
165
+ @ReactMethod
166
+ public void checkPaymentStatus(Promise promise) {
167
+ Activity currentActivity = getCurrentActivity();
168
+ if (currentActivity == null) {
169
+ promise.reject("ERROR", "Activity is not initialized.");
170
+ return;
171
+ }
172
+
173
+ try {
174
+ EasyPaymentFactory easyPaymentFactory = EasyPaymentFactory.INSTANCE;
175
+ easyPaymentFactory.checkPaymentStatus(
176
+ currentActivity,
177
+ new EasyPaymentFactory.OnPaymentStatusCheckListener() {
178
+ @Override
179
+ public void onSuccess(JSONObject response) {
180
+ WritableMap result = Arguments.createMap();
181
+ result.putString("response", response.toString());
182
+ promise.resolve(result);
183
+ }
184
+
185
+ @Override
186
+ public void onFailure(JSONObject error) {
187
+ promise.reject("STATUS_CHECK_ERROR", error.toString());
188
+ }
189
+ }
190
+ );
191
+ } catch (Exception ex) {
192
+ promise.reject("ERROR", "Failed to check payment status: " + ex.getMessage());
193
+ }
72
194
  }
73
- }
195
+ }
@@ -1,28 +1,60 @@
1
- package com.reactlibrary;
1
+ //package com.reactlibrary;
2
+ //
3
+ //import java.util.Arrays;
4
+ //import java.util.Collections;
5
+ //import java.util.List;
6
+ //
7
+ //import com.facebook.react.ReactPackage;
8
+ //import com.facebook.react.bridge.NativeModule;
9
+ //import com.facebook.react.bridge.ReactApplicationContext;
10
+ //import com.facebook.react.uimanager.ViewManager;
11
+ //import com.facebook.react.bridge.JavaScriptModule;
12
+ //
13
+ //public class RNEasymerchantsdkPackage implements ReactPackage {
14
+ // @Override
15
+ // public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
16
+ // return Arrays.<NativeModule>asList(new RNEasymerchantsdkModule(reactContext));
17
+ // }
18
+ //
19
+ // // Deprecated from RN 0.47
20
+ // public List<Class<? extends JavaScriptModule>> createJSModules() {
21
+ // return Collections.emptyList();
22
+ // }
23
+ //
24
+ // @Override
25
+ // public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
26
+ // return Collections.emptyList();
27
+ // }
28
+ //}
2
29
 
3
- import java.util.Arrays;
4
- import java.util.Collections;
5
- import java.util.List;
30
+
31
+
32
+
33
+
34
+ package com.reactlibrary;
6
35
 
7
36
  import com.facebook.react.ReactPackage;
8
37
  import com.facebook.react.bridge.NativeModule;
9
38
  import com.facebook.react.bridge.ReactApplicationContext;
10
39
  import com.facebook.react.uimanager.ViewManager;
11
- import com.facebook.react.bridge.JavaScriptModule;
40
+
41
+ import java.util.ArrayList;
42
+ import java.util.Collections;
43
+ import java.util.List;
12
44
 
13
45
  public class RNEasymerchantsdkPackage implements ReactPackage {
14
46
  @Override
15
47
  public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
16
- return Arrays.<NativeModule>asList(new RNEasymerchantsdkModule(reactContext));
17
- }
18
-
19
- // Deprecated from RN 0.47
20
- public List<Class<? extends JavaScriptModule>> createJSModules() {
21
- return Collections.emptyList();
48
+ List<NativeModule> modules = new ArrayList<>();
49
+ modules.add(new RNEasymerchantsdkModule(reactContext));
50
+ return modules;
22
51
  }
23
52
 
24
53
  @Override
25
54
  public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
26
- return Collections.emptyList();
55
+ return Collections.emptyList();
27
56
  }
28
- }
57
+ }
58
+
59
+
60
+
@@ -2,8 +2,8 @@
2
2
  #import <React/RCTLog.h>
3
3
  #import <React/RCTBridgeModule.h>
4
4
 
5
- //#import <easymerchantsdk-Swift.h>
6
- #import <easymerchantsdk/easymerchantsdk-Swift.h>
5
+ #import <easymerchantsdk-Swift.h>
6
+ //#import <easymerchantsdk/easymerchantsdk-Swift.h>
7
7
 
8
8
  @interface EasyMerchantSdk ()
9
9
  @property (nonatomic, strong) EasyMerchantSdkPlugin *sdkPluginInstance;
@@ -10,7 +10,7 @@ import UIKit
10
10
  @available(iOS 16.0, *)
11
11
  class AdditionalInfoVC: BaseVC {
12
12
 
13
- @IBOutlet weak var viewAdditionalInfo: UIView!
13
+ // @IBOutlet weak var viewAdditionalInfo: UIView!
14
14
  @IBOutlet weak var txtFieldName: UITextField!
15
15
  @IBOutlet weak var txtFieldEmail: UITextField!
16
16
  @IBOutlet weak var txtFieldPhoneNumber: UITextField!
@@ -201,10 +201,10 @@ class AdditionalInfoVC: BaseVC {
201
201
  if let secondaryFontColor = UserStoreSingleton.shared.secondary_font_col,
202
202
  let placeholderColor = UIColor(hex: secondaryFontColor) {
203
203
  lblEasyMerchant.textColor = placeholderColor
204
- viewAdditionalInfo.layer.borderColor = placeholderColor.cgColor
204
+ // viewAdditionalInfo.layer.borderColor = placeholderColor.cgColor
205
205
  }
206
206
  else {
207
- viewAdditionalInfo.layer.borderColor = UIColor.systemGray.cgColor
207
+ // viewAdditionalInfo.layer.borderColor = UIColor.systemGray.cgColor
208
208
  }
209
209
 
210
210
  if let borderRadiusString = UserStoreSingleton.shared.border_radious,
@@ -212,17 +212,17 @@ class AdditionalInfoVC: BaseVC {
212
212
  btnPayNow.layer.cornerRadius = CGFloat(borderRadius) // Set corner radius
213
213
  btnPrevious.layer.cornerRadius = CGFloat(borderRadius)
214
214
  btnPrevious.layer.borderWidth = 1
215
- viewAdditionalInfo.layer.cornerRadius = CGFloat(borderRadius)
216
- viewAdditionalInfo.layer.borderWidth = 1
215
+ // viewAdditionalInfo.layer.cornerRadius = CGFloat(borderRadius)
216
+ // viewAdditionalInfo.layer.borderWidth = 1
217
217
  } else {
218
218
  btnPayNow.layer.cornerRadius = 8 // Default value
219
219
  btnPrevious.layer.cornerRadius = 8
220
- viewAdditionalInfo.layer.borderWidth = 1
221
- viewAdditionalInfo.layer.cornerRadius = 8
220
+ // viewAdditionalInfo.layer.borderWidth = 1
221
+ // viewAdditionalInfo.layer.cornerRadius = 8
222
222
  }
223
223
  btnPayNow.layer.masksToBounds = true // Ensure the corners are clipped properly
224
224
  btnPrevious.layer.masksToBounds = true
225
- viewAdditionalInfo.layer.masksToBounds = true
225
+ // viewAdditionalInfo.layer.masksToBounds = true
226
226
 
227
227
  if let primaryFontColor = UserStoreSingleton.shared.primary_font_col,
228
228
  let uiColor = UIColor(hex: primaryFontColor) {
@@ -1701,6 +1701,7 @@ class AdditionalInfoVC: BaseVC {
1701
1701
  // Pass billing and additional info
1702
1702
  // Conditionally pass raw FieldItem array
1703
1703
  paymentDoneVC.visibility = self.visibility
1704
+ paymentDoneVC.amount = self.amount
1704
1705
 
1705
1706
  if self.visibility?.billing == true {
1706
1707
  paymentDoneVC.billingInfoData = self.billingInfo
@@ -1897,6 +1898,7 @@ class AdditionalInfoVC: BaseVC {
1897
1898
  // Pass billing and additional info
1898
1899
  // Conditionally pass raw FieldItem array
1899
1900
  paymentDoneVC.visibility = self.visibility
1901
+ paymentDoneVC.amount = self.amount
1900
1902
 
1901
1903
  if self.visibility?.billing == true {
1902
1904
  paymentDoneVC.billingInfoData = self.billingInfo