@jimrising/easymerchantsdk-react-native 1.4.1 → 1.4.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/README.md +1 -1
- package/android/build/.transforms/20e1216b87bd06eaab3c9e5c68d4267a/results.bin +1 -0
- package/android/build/.transforms/20e1216b87bd06eaab3c9e5c68d4267a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/BuildConfig.dex +0 -0
- package/android/build/.transforms/20e1216b87bd06eaab3c9e5c68d4267a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/RNEasymerchantsdkModule$1.dex +0 -0
- package/android/build/.transforms/20e1216b87bd06eaab3c9e5c68d4267a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/RNEasymerchantsdkModule$2.dex +0 -0
- package/android/build/.transforms/20e1216b87bd06eaab3c9e5c68d4267a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/RNEasymerchantsdkModule.dex +0 -0
- package/android/build/.transforms/20e1216b87bd06eaab3c9e5c68d4267a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/RNEasymerchantsdkPackage.dex +0 -0
- package/android/build/.transforms/20e1216b87bd06eaab3c9e5c68d4267a/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
- package/android/build/.transforms/e9a664a11ce12edf79cd87b1e07aa243/results.bin +1 -0
- package/android/build/.transforms/e9a664a11ce12edf79cd87b1e07aa243/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/generated/source/buildConfig/debug/com/reactlibrary/BuildConfig.java +10 -0
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +7 -0
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +18 -0
- package/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +6 -0
- package/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +1 -0
- package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
- package/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +0 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +1 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +2 -0
- package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
- package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
- package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +2 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactlibrary/BuildConfig.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactlibrary/RNEasymerchantsdkModule$1.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactlibrary/RNEasymerchantsdkModule$2.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactlibrary/RNEasymerchantsdkModule.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactlibrary/RNEasymerchantsdkPackage.class +0 -0
- package/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +2 -0
- package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +7 -0
- package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +7 -0
- package/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +1 -0
- package/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +1 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/reactlibrary/BuildConfig.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/reactlibrary/RNEasymerchantsdkModule$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/reactlibrary/RNEasymerchantsdkModule$2.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/reactlibrary/RNEasymerchantsdkModule.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/reactlibrary/RNEasymerchantsdkPackage.class +0 -0
- package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +1 -0
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +17 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/RNEasymerchantsdkModule$1.class.uniqueId2 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/RNEasymerchantsdkModule$2.class.uniqueId0 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/RNEasymerchantsdkModule.class.uniqueId3 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/RNEasymerchantsdkPackage.class.uniqueId1 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/build.gradle +4 -1
- package/android/src/main/java/com/reactlibrary/RNEasymerchantsdkModule.java +157 -36
- package/android/src/main/java/com/reactlibrary/RNEasymerchantsdkPackage.java +45 -13
- package/ios/Classes/EasyMerchantSdk.m +2 -2
- package/ios/Pods/ViewControllers/AdditionalInfoVC.swift +52 -53
- package/ios/Pods/ViewControllers/BaseVC.swift +17 -6
- package/ios/Pods/ViewControllers/BillingInfoVC/BillingInfoVC.swift +84 -53
- package/ios/Pods/ViewControllers/CountryListVC.swift +20 -0
- package/ios/Pods/ViewControllers/CustomOverlay.swift +199 -0
- package/ios/Pods/ViewControllers/OTPVerificationVC.swift +109 -33
- package/ios/Pods/ViewControllers/PaymentDoneVC.swift +30 -30
- package/ios/Pods/ViewControllers/PaymentInformation/PaymentInfoVC.swift +1006 -145
- package/ios/Pods/ViewControllers/ThreeDSecurePaymentDoneVC.swift +300 -57
- package/ios/easymerchantsdk.podspec +1 -1
- package/ios/easymerchantsdk.storyboard +1235 -868
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
o/bundleLibRuntimeToDirDebug
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
o/classes
|
|
Binary file
|
|
@@ -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,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 @@
|
|
|
1
|
+
{}
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#Wed Jun 11 11:27:07 IST 2025
|
|
@@ -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:.*:<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:.*:<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:.*:<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:.*:<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:.*:<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:.*:<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:.*:<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:.*:<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:.*:<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:.*:<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:.*:<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:.*:<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:.*:<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>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0 Warning/Error
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
com.reactlibrary
|
|
@@ -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
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/android/build.gradle
CHANGED
|
@@ -39,11 +39,14 @@ repositories {
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
dependencies {
|
|
42
|
-
implementation 'com.app:paysdk:1.
|
|
42
|
+
implementation 'com.app:paysdk:1.2.3'
|
|
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
|
|
9
|
-
import
|
|
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
|
|
19
|
-
import
|
|
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
|
-
|
|
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,156 @@ 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
|
|
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
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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
|
+
hashMap.put("authenticateBank", hashMapConfig.getBoolean("authenticateBank"));
|
|
106
|
+
|
|
107
|
+
// Handle GrailPayParams
|
|
108
|
+
ReadableMap grailPayParamsMap = hashMapConfig.getMap("grailPayParams");
|
|
109
|
+
JSONObject grailPayParamsJson = new JSONObject();
|
|
110
|
+
grailPayParamsJson.put("accessToken", grailPayParamsMap.getString("accessToken"));
|
|
111
|
+
grailPayParamsJson.put("vendorId", grailPayParamsMap.getString("vendorId"));
|
|
112
|
+
grailPayParamsJson.put("role", grailPayParamsMap.getString("role"));
|
|
113
|
+
grailPayParamsJson.put("timeout", grailPayParamsMap.getInt("timeout"));
|
|
114
|
+
grailPayParamsJson.put("isSandbox", grailPayParamsMap.getBoolean("isSandbox"));
|
|
115
|
+
grailPayParamsJson.put("brandingName", grailPayParamsMap.getString("brandingName"));
|
|
116
|
+
grailPayParamsJson.put("finderSubtitle", grailPayParamsMap.getString("finderSubtitle"));
|
|
117
|
+
grailPayParamsJson.put("searchPlaceholder", grailPayParamsMap.getString("searchPlaceholder"));
|
|
118
|
+
hashMap.put("grailPayParams", grailPayParamsJson);
|
|
119
|
+
|
|
120
|
+
hashMap.put("is3DSecureEnable", hashMapConfig.getBoolean("is3DSecureEnable"));
|
|
121
|
+
hashMap.put("showPrice", hashMapConfig.getBoolean("showPrice"));
|
|
122
|
+
|
|
123
|
+
// Handle billing info
|
|
124
|
+
if (hashMapConfig.hasKey("billingInfo")) {
|
|
125
|
+
JSONObject billingInfo = new JSONObject(hashMapConfig.getMap("billingInfo").toHashMap());
|
|
126
|
+
hashMap.put("billingInfo", billingInfo);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
EasyPaymentFactory easyPaymentFactory = EasyPaymentFactory.INSTANCE;
|
|
132
|
+
EasyPaymentService easyPaymentService = easyPaymentFactory.create(
|
|
133
|
+
currentActivity,
|
|
134
|
+
jsonConfig.getString("environment"),
|
|
135
|
+
apiKey,
|
|
136
|
+
secretKey);
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
// Make payment
|
|
140
|
+
easyPaymentService.makePayment(
|
|
141
|
+
jsonConfig,
|
|
142
|
+
hashMap,
|
|
143
|
+
new EasyPaymentFactory.OnTransactionListener() {
|
|
144
|
+
@Override
|
|
145
|
+
public void onSuccess(String response) {
|
|
146
|
+
WritableMap result = Arguments.createMap();
|
|
147
|
+
result.putString("response", response);
|
|
148
|
+
promise.resolve(result);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
@Override
|
|
152
|
+
public void onError(String error) {
|
|
153
|
+
promise.reject("PAYMENT_ERROR", error);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
);
|
|
157
|
+
} catch (JSONException ex) {
|
|
158
|
+
promise.reject("JSON_ERROR", "Invalid JSON configuration: " + ex.getMessage());
|
|
159
|
+
} catch (Exception ex) {
|
|
160
|
+
promise.reject("ERROR", "Payment failed: " + ex.getMessage());
|
|
65
161
|
}
|
|
162
|
+
}
|
|
66
163
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
164
|
+
@ReactMethod
|
|
165
|
+
public void checkPaymentStatus(Promise promise) {
|
|
166
|
+
Activity currentActivity = getCurrentActivity();
|
|
167
|
+
if (currentActivity == null) {
|
|
168
|
+
promise.reject("ERROR", "Activity is not initialized.");
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
try {
|
|
173
|
+
EasyPaymentFactory easyPaymentFactory = EasyPaymentFactory.INSTANCE;
|
|
174
|
+
easyPaymentFactory.checkPaymentStatus(
|
|
175
|
+
currentActivity,
|
|
176
|
+
new EasyPaymentFactory.OnPaymentStatusCheckListener() {
|
|
177
|
+
@Override
|
|
178
|
+
public void onSuccess(JSONObject response) {
|
|
179
|
+
WritableMap result = Arguments.createMap();
|
|
180
|
+
result.putString("response", response.toString());
|
|
181
|
+
promise.resolve(result);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
@Override
|
|
185
|
+
public void onFailure(JSONObject error) {
|
|
186
|
+
promise.reject("STATUS_CHECK_ERROR", error.toString());
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
);
|
|
190
|
+
} catch (Exception ex) {
|
|
191
|
+
promise.reject("ERROR", "Failed to check payment status: " + ex.getMessage());
|
|
192
|
+
}
|
|
72
193
|
}
|
|
73
|
-
}
|
|
194
|
+
}
|
|
@@ -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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
6
|
-
|
|
5
|
+
#import <easymerchantsdk-Swift.h>
|
|
6
|
+
//#import <easymerchantsdk/easymerchantsdk-Swift.h>
|
|
7
7
|
|
|
8
8
|
@interface EasyMerchantSdk ()
|
|
9
9
|
@property (nonatomic, strong) EasyMerchantSdkPlugin *sdkPluginInstance;
|