@jimrising/easymerchantsdk-react-native 1.5.8 → 1.5.9

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 (28) hide show
  1. package/README.md +1 -1
  2. package/android/build/.transforms/20e1216b87bd06eaab3c9e5c68d4267a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/RNEasymerchantsdkModule$1.dex +0 -0
  3. package/android/build/.transforms/20e1216b87bd06eaab3c9e5c68d4267a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/RNEasymerchantsdkModule$2.dex +0 -0
  4. package/android/build/.transforms/20e1216b87bd06eaab3c9e5c68d4267a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/RNEasymerchantsdkModule.dex +0 -0
  5. package/android/build/.transforms/20e1216b87bd06eaab3c9e5c68d4267a/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
  6. package/android/build/.transforms/e9a664a11ce12edf79cd87b1e07aa243/transformed/classes/classes_dex/classes.dex +0 -0
  7. package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
  8. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactlibrary/RNEasymerchantsdkModule$1.class +0 -0
  9. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactlibrary/RNEasymerchantsdkModule$2.class +0 -0
  10. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactlibrary/RNEasymerchantsdkModule.class +0 -0
  11. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/reactlibrary/RNEasymerchantsdkModule$1.class +0 -0
  12. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/reactlibrary/RNEasymerchantsdkModule$2.class +0 -0
  13. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/reactlibrary/RNEasymerchantsdkModule.class +0 -0
  14. package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
  15. package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/RNEasymerchantsdkModule$1.class.uniqueId2 +0 -0
  16. package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/RNEasymerchantsdkModule$2.class.uniqueId0 +0 -0
  17. package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/RNEasymerchantsdkModule.class.uniqueId3 +0 -0
  18. package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  19. package/android/build.gradle +1 -4
  20. package/android/src/main/java/com/reactlibrary/RNEasymerchantsdkModule.java +197 -86
  21. package/ios/Classes/EasyMerchantSdk.m +2 -2
  22. package/ios/Pods/ViewControllers/AdditionalInfoVC.swift +7 -2
  23. package/ios/Pods/ViewControllers/BillingInfoVC/BillingInfoVC.swift +7 -2
  24. package/ios/Pods/ViewControllers/OTPVerificationVC.swift +1 -1
  25. package/ios/Pods/ViewControllers/PaymentInformation/PaymentInfoVC.swift +36 -8
  26. package/ios/easymerchantsdk.podspec +1 -1
  27. package/ios/easymerchantsdk.storyboard +89 -207
  28. 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.5.8"
10
+ "@jimrising/easymerchantsdk-react-native": "^1.5.9"
11
11
  },
12
12
  ```
13
13
 
@@ -39,14 +39,11 @@ repositories {
39
39
  }
40
40
 
41
41
  dependencies {
42
- implementation 'com.app:paysdk:1.2.8'
42
+ implementation 'com.app:paysdk:1.2.9'
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
- // }
50
47
  implementation 'androidx.appcompat:appcompat:1.6.1'
51
48
  implementation 'com.google.android.material:material:1.8.0'
52
49
  implementation 'com.facebook.react:react-native:+'
@@ -4,14 +4,14 @@ import android.app.Activity;
4
4
  import androidx.annotation.NonNull;
5
5
  import com.app.paysdk.init.EasyPaymentFactory;
6
6
  import com.app.paysdk.service.EasyPaymentService;
7
- import com.facebook.react.bridge.ReactApplicationContext;
8
- import com.facebook.react.bridge.ReactContextBaseJavaModule;
9
- import com.facebook.react.bridge.ReactMethod;
10
- import com.facebook.react.bridge.Promise;
11
- import com.facebook.react.bridge.ReadableMap;
12
- import com.facebook.react.bridge.WritableMap;
13
- import com.facebook.react.bridge.Arguments;
14
- import org.json.JSONObject;
7
+ import com.facebook.react.bridge.*;
8
+ import org.json.*;
9
+ import java.util.Map;
10
+
11
+ import java.io.File;
12
+ import java.io.FileInputStream;
13
+ import java.io.IOException;
14
+ import java.util.Properties;
15
15
 
16
16
  public class RNEasymerchantsdkModule extends ReactContextBaseJavaModule {
17
17
  private final ReactApplicationContext reactContext;
@@ -27,14 +27,16 @@ public class RNEasymerchantsdkModule extends ReactContextBaseJavaModule {
27
27
  return "RNEasymerchantsdk";
28
28
  }
29
29
 
30
- @ReactMethod
31
- public void platformVersion(Promise promise) {
30
+ private Properties loadConfigProperties() {
31
+ Properties properties = new Properties();
32
32
  try {
33
- String platformVersion = "Android " + android.os.Build.VERSION.RELEASE;
34
- promise.resolve(platformVersion);
35
- } catch (Exception e) {
36
- promise.reject("PLATFORM_ERROR", "Failed to get platform version: " + e.getMessage());
33
+ FileInputStream fis = new FileInputStream(new File(reactContext.getFilesDir(), "../config.properties"));
34
+ properties.load(fis);
35
+ fis.close();
36
+ } catch (IOException e) {
37
+ android.util.Log.e("RNEasymerchantsdk", "Failed to load config.properties: " + e.getMessage());
37
38
  }
39
+ return properties;
38
40
  }
39
41
 
40
42
  @ReactMethod
@@ -45,65 +47,171 @@ public class RNEasymerchantsdkModule extends ReactContextBaseJavaModule {
45
47
  return;
46
48
  }
47
49
 
48
- try {
49
- // Validate required fields
50
- if (!configMap.hasKey("amount") || configMap.getString("amount") == null || configMap.getString("amount").isEmpty() || Float.parseFloat(configMap.getString("amount")) <= 0) {
51
- promise.reject("VALIDATION_ERROR", "Invalid or missing amount.");
52
- return;
53
- }
54
- if (!configMap.hasKey("apiKey") || configMap.getString("apiKey") == null || configMap.getString("apiKey").isEmpty()) {
55
- promise.reject("VALIDATION_ERROR", "Missing or empty apiKey.");
56
- return;
57
- }
58
- if (!configMap.hasKey("secretKey") || configMap.getString("secretKey") == null || configMap.getString("secretKey").isEmpty()) {
59
- promise.reject("VALIDATION_ERROR", "Missing or empty secretKey.");
60
- return;
61
- }
62
- if (!configMap.hasKey("jsonConfig") || configMap.getMap("jsonConfig") == null) {
63
- promise.reject("VALIDATION_ERROR", "Missing jsonConfig.");
64
- return;
65
- }
50
+ new android.os.Handler(android.os.Looper.getMainLooper()).post(() -> {
51
+ try {
52
+ Properties configProps = loadConfigProperties();
53
+ String defaultApiKey = configProps.getProperty("SDK_API_KEY");
54
+ String defaultSecretKey = configProps.getProperty("SDK_SECRET_KEY");
66
55
 
67
- String amount = configMap.getString("amount");
68
- String apiKey = configMap.getString("apiKey");
69
- String secretKey = configMap.getString("secretKey");
70
- JSONObject jsonConfig = new JSONObject(configMap.getMap("jsonConfig").toHashMap());
56
+ String amount = configMap.getString("amount");
57
+ String apiKey = configMap.hasKey("apiKey") ? configMap.getString("apiKey") : defaultApiKey;
58
+ String secretKey = configMap.hasKey("secretKey") ? configMap.getString("secretKey") : defaultSecretKey;
71
59
 
72
- String environment = jsonConfig.optString("environment", "sandbox").toLowerCase();
73
- if (!environment.equals("staging") && !environment.equals("sandbox") && !environment.equals("production")) {
74
- promise.reject("CONFIG_ERROR", "Invalid environment: " + environment);
75
- return;
76
- }
60
+ ReadableMap jsonConfigMap = configMap.getMap("jsonConfig");
61
+ JSONObject jsonConfig = new JSONObject();
62
+ jsonConfig.put("environment",
63
+ jsonConfigMap.hasKey("environment") ? jsonConfigMap.getString("environment") : "sandbox"
64
+ );
65
+ jsonConfig.put("amount", amount);
66
+ jsonConfig.put("tokenOnly",
67
+ jsonConfigMap.hasKey("tokenOnly") ? jsonConfigMap.getBoolean("tokenOnly") : false
68
+ );
69
+ jsonConfig.put("currency",
70
+ jsonConfigMap.hasKey("currency") ? jsonConfigMap.getString("currency") : "usd"
71
+ );
72
+ jsonConfig.put("saveCard",
73
+ jsonConfigMap.hasKey("saveCard") ? jsonConfigMap.getBoolean("saveCard") : false
74
+ );
75
+ jsonConfig.put("saveAccount",
76
+ jsonConfigMap.hasKey("saveAccount") ? jsonConfigMap.getBoolean("saveAccount") : false
77
+ );
78
+ jsonConfig.put("authenticatedACH",
79
+ jsonConfigMap.hasKey("authenticatedACH") ? jsonConfigMap.getBoolean("authenticatedACH") : false
80
+ );
81
+ jsonConfig.put("secureAuthentication",
82
+ jsonConfigMap.hasKey("secureAuthentication") && !jsonConfigMap.isNull("secureAuthentication")
83
+ ? jsonConfigMap.getBoolean("secureAuthentication")
84
+ : false
85
+ );
77
86
 
78
- EasyPaymentFactory easyPaymentFactory = EasyPaymentFactory.INSTANCE;
79
- EasyPaymentService easyPaymentService = easyPaymentFactory.create(
80
- currentActivity,
81
- environment,
82
- apiKey,
83
- secretKey
84
- );
85
-
86
- easyPaymentService.makePayment(
87
- jsonConfig,
88
- new EasyPaymentFactory.OnTransactionListener() {
89
- @Override
90
- public void onSuccess(String response) {
91
- WritableMap result = Arguments.createMap();
92
- result.putString("response", response);
93
- promise.resolve(result);
94
- }
87
+ jsonConfig.put("showReceipt",
88
+ jsonConfigMap.hasKey("showReceipt") ? jsonConfigMap.getBoolean("showReceipt") : true
89
+ );
90
+ jsonConfig.put("showDonate",
91
+ jsonConfigMap.hasKey("showDonate") ? jsonConfigMap.getBoolean("showDonate") : false
92
+ );
93
+ jsonConfig.put("showTotal",
94
+ jsonConfigMap.hasKey("showTotal") ? jsonConfigMap.getBoolean("showTotal") : true
95
+ );
96
+ jsonConfig.put("showSubmitButton",
97
+ jsonConfigMap.hasKey("showSubmitButton") ? jsonConfigMap.getBoolean("showSubmitButton") : true
98
+ );
99
+ jsonConfig.put("email",
100
+ jsonConfigMap.hasKey("email") ? jsonConfigMap.getString("email") : ""
101
+ );
102
+ jsonConfig.put("name",
103
+ jsonConfigMap.hasKey("name") ? jsonConfigMap.getString("name") : ""
104
+ );
95
105
 
96
- @Override
97
- public void onError(String error) {
98
- promise.reject("PAYMENT_ERROR", error);
106
+
107
+ JSONArray paymentMethods = new JSONArray();
108
+ ReadableArray methods = jsonConfigMap.getArray("paymentMethod");
109
+ for (int i = 0; i < methods.size(); i++) {
110
+ paymentMethods.put(methods.getString(i));
111
+ }
112
+ jsonConfig.put("paymentMethod", paymentMethods);
113
+
114
+ // Recurring
115
+ if (jsonConfigMap.hasKey("recurring")) {
116
+ ReadableMap recurringMap = jsonConfigMap.getMap("recurring");
117
+ JSONObject recurring = new JSONObject();
118
+ recurring.put("enableRecurring", recurringMap.getBoolean("enableRecurring"));
119
+ if (recurringMap.hasKey("recurringData")) {
120
+ ReadableMap data = recurringMap.getMap("recurringData");
121
+ JSONObject recurringData = new JSONObject();
122
+ recurringData.put("allowCycles", data.getInt("allowCycles"));
123
+ JSONArray intervals = new JSONArray();
124
+ ReadableArray intervalArray = data.getArray("intervals");
125
+ for (int i = 0; i < intervalArray.size(); i++) {
126
+ intervals.put(intervalArray.getString(i));
99
127
  }
128
+ recurringData.put("intervals", intervals);
129
+ recurringData.put("recurringStartType", data.getString("recurringStartType"));
130
+ recurringData.put("recurringStartDate", data.getString("recurringStartDate"));
131
+ recurring.put("recurringData", recurringData);
100
132
  }
101
- );
102
- } catch (NumberFormatException ex) {
103
- promise.reject("VALIDATION_ERROR", "Invalid amount format: " + ex.getMessage());
104
- } catch (Exception ex) {
105
- promise.reject("ERROR", "Payment failed: " + ex.getMessage());
106
- }
133
+ jsonConfig.put("recurring", recurring);
134
+ }
135
+
136
+ // Fields
137
+ if (jsonConfigMap.hasKey("fields")) {
138
+ ReadableMap fieldsMap = jsonConfigMap.getMap("fields");
139
+ JSONObject fields = new JSONObject();
140
+ JSONObject visibility = new JSONObject();
141
+ ReadableMap vis = fieldsMap.getMap("visibility");
142
+ visibility.put("billing", vis.getBoolean("billing"));
143
+ visibility.put("additional", vis.getBoolean("additional"));
144
+ fields.put("visibility", visibility);
145
+
146
+ JSONArray billing = new JSONArray();
147
+ ReadableArray billingArray = fieldsMap.getArray("billing");
148
+ for (int i = 0; i < billingArray.size(); i++) {
149
+ ReadableMap item = billingArray.getMap(i);
150
+ JSONObject obj = new JSONObject();
151
+ obj.put("name", item.getString("name"));
152
+ obj.put("required", item.getBoolean("required"));
153
+ obj.put("value", item.getString("value"));
154
+ billing.put(obj);
155
+ }
156
+ fields.put("billing", billing);
157
+
158
+ JSONArray additional = new JSONArray();
159
+ ReadableArray additionalArray = fieldsMap.getArray("additional");
160
+ for (int i = 0; i < additionalArray.size(); i++) {
161
+ ReadableMap item = additionalArray.getMap(i);
162
+ JSONObject obj = new JSONObject();
163
+ obj.put("name", item.getString("name"));
164
+ obj.put("required", item.getBoolean("required"));
165
+ obj.put("value", item.getString("value"));
166
+ additional.put(obj);
167
+ }
168
+ fields.put("additional", additional);
169
+ jsonConfig.put("fields", fields);
170
+ }
171
+
172
+ // GrailPay Params
173
+ if (jsonConfigMap.hasKey("grailPayParams")) {
174
+ ReadableMap gp = jsonConfigMap.getMap("grailPayParams");
175
+ JSONObject grail = new JSONObject();
176
+ grail.put("role", gp.getString("role"));
177
+ grail.put("timeout", gp.getInt("timeout"));
178
+ grail.put("isSandbox", gp.getBoolean("isSandbox"));
179
+ grail.put("brandingName", gp.getString("brandingName"));
180
+ grail.put("finderSubtitle", gp.getString("finderSubtitle"));
181
+ grail.put("searchPlaceholder", gp.getString("searchPlaceholder"));
182
+ jsonConfig.put("grailPayParams", grail);
183
+ }
184
+
185
+ // Appearance Settings
186
+ if (jsonConfigMap.hasKey("appearanceSettings")) {
187
+ ReadableMap a = jsonConfigMap.getMap("appearanceSettings");
188
+ JSONObject appearance = new JSONObject();
189
+ for (Map.Entry<String, Object> entry : a.toHashMap().entrySet()) {
190
+ appearance.put(entry.getKey(), entry.getValue());
191
+ }
192
+ jsonConfig.put("appearanceSettings", appearance);
193
+ }
194
+
195
+ EasyPaymentFactory factory = EasyPaymentFactory.INSTANCE;
196
+ EasyPaymentService service = factory.create(currentActivity, jsonConfig.getString("environment"), apiKey, secretKey);
197
+
198
+ service.makePayment(jsonConfig, new EasyPaymentFactory.OnTransactionListener() {
199
+ @Override
200
+ public void onSuccess(String response) {
201
+ WritableMap result = Arguments.createMap();
202
+ result.putString("response", response);
203
+ promise.resolve(result);
204
+ }
205
+
206
+ @Override
207
+ public void onError(String error) {
208
+ promise.reject("PAYMENT_ERROR", error);
209
+ }
210
+ });
211
+ } catch (Exception e) {
212
+ promise.reject("ERROR", e.getMessage());
213
+ }
214
+ });
107
215
  }
108
216
 
109
217
  @ReactMethod
@@ -114,26 +222,29 @@ public class RNEasymerchantsdkModule extends ReactContextBaseJavaModule {
114
222
  return;
115
223
  }
116
224
 
117
- try {
118
- EasyPaymentFactory easyPaymentFactory = EasyPaymentFactory.INSTANCE;
119
- easyPaymentFactory.checkPaymentStatus(
120
- currentActivity,
121
- new EasyPaymentFactory.OnPaymentStatusCheckListener() {
122
- @Override
123
- public void onSuccess(JSONObject response) {
124
- WritableMap result = Arguments.createMap();
125
- result.putString("response", response.toString());
126
- promise.resolve(result);
127
- }
225
+ new android.os.Handler(android.os.Looper.getMainLooper()).post(() -> {
226
+ try {
227
+ EasyPaymentFactory.INSTANCE.checkPaymentStatus(currentActivity, new EasyPaymentFactory.OnPaymentStatusCheckListener() {
228
+ @Override
229
+ public void onSuccess(JSONObject response) {
230
+ WritableMap result = Arguments.createMap();
231
+ result.putString("response", response.toString());
232
+ promise.resolve(result);
233
+ }
128
234
 
129
- @Override
130
- public void onFailure(JSONObject error) {
131
- promise.reject("STATUS_CHECK_ERROR", error.toString());
132
- }
235
+ @Override
236
+ public void onFailure(JSONObject error) {
237
+ promise.reject("STATUS_CHECK_ERROR", error.toString());
133
238
  }
134
- );
135
- } catch (Exception ex) {
136
- promise.reject("ERROR", "Failed to check payment status: " + ex.getMessage());
137
- }
239
+ });
240
+ } catch (Exception e) {
241
+ promise.reject("ERROR", "Failed to check payment status: " + e.getMessage());
242
+ }
243
+ });
244
+ }
245
+
246
+ @ReactMethod
247
+ public void paymentReference(String referenceToken, Promise promise) {
248
+ promise.reject("UNSUPPORTED_ERROR", "Payment reference is not supported on Android.");
138
249
  }
139
250
  }
@@ -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;
@@ -633,7 +633,9 @@ class AdditionalInfoVC: BaseVC {
633
633
  "customer" : selectedCard?.customerId ?? "",
634
634
  "customer_id" : selectedCard?.customerId ?? "",
635
635
  "card_id" : selectedCard?.cardId ?? "",
636
- "cvc" : cvvText ?? ""
636
+ "cvc" : cvvText ?? "",
637
+ "name": UserStoreSingleton.shared.merchantName ?? "",
638
+ "email": UserStoreSingleton.shared.verificationEmail ?? ""
637
639
  ]
638
640
 
639
641
  // Conditionally add billing info
@@ -710,6 +712,8 @@ class AdditionalInfoVC: BaseVC {
710
712
  params["interval"] = chosenPlan?.lowercased()
711
713
  }
712
714
 
715
+ print(params)
716
+
713
717
  do {
714
718
  let jsonData = try JSONSerialization.data(withJSONObject: params, options: .prettyPrinted)
715
719
  uRLRequest.httpBody = jsonData
@@ -834,7 +838,7 @@ class AdditionalInfoVC: BaseVC {
834
838
 
835
839
  var params: [String: Any] = [
836
840
  "name": nameOnCard ?? "",
837
- "email": userEmail ?? "",
841
+ "email": UserStoreSingleton.shared.verificationEmail ?? "",
838
842
  "card_number": cardNumber?.replacingOccurrences(of: " ", with: "") ?? "",
839
843
  "cardholder_name": nameOnCard ?? "",
840
844
  "exp_month": expiryDate?.components(separatedBy: "/").first ?? "",
@@ -1214,6 +1218,7 @@ class AdditionalInfoVC: BaseVC {
1214
1218
  "payment_method": "ach",
1215
1219
  "customer": customerID ?? "",
1216
1220
  "currency": "usd",
1221
+ "email": UserStoreSingleton.shared.verificationEmail ?? ""
1217
1222
  ]
1218
1223
 
1219
1224
  // Conditionally add billing info
@@ -1606,7 +1606,9 @@ class BillingInfoVC: BaseVC {
1606
1606
  "customer" : selectedCard?.customerId ?? "",
1607
1607
  "customer_id" : selectedCard?.customerId ?? "",
1608
1608
  "card_id" : selectedCard?.cardId ?? "",
1609
- "cvc" : cvvText ?? ""
1609
+ "cvc" : cvvText ?? "",
1610
+ "name": UserStoreSingleton.shared.merchantName ?? "",
1611
+ "email": UserStoreSingleton.shared.verificationEmail ?? ""
1610
1612
  ]
1611
1613
 
1612
1614
  // Conditionally add billing info
@@ -1668,6 +1670,8 @@ class BillingInfoVC: BaseVC {
1668
1670
  params["interval"] = chosenPlan?.lowercased()
1669
1671
  }
1670
1672
 
1673
+ print(params)
1674
+
1671
1675
  do {
1672
1676
  let jsonData = try JSONSerialization.data(withJSONObject: params, options: .prettyPrinted)
1673
1677
  uRLRequest.httpBody = jsonData
@@ -1777,11 +1781,12 @@ class BillingInfoVC: BaseVC {
1777
1781
  uRLRequest.addValue(token ?? "", forHTTPHeaderField: "Client-Token")
1778
1782
 
1779
1783
  var params: [String: Any] = [
1780
- "name": nameOnCard ?? "",
1784
+ "name": UserStoreSingleton.shared.merchantName ?? "",
1781
1785
  "account_id": accountID ?? "",
1782
1786
  "payment_method": "ach",
1783
1787
  "customer": customerID ?? "",
1784
1788
  "currency": "usd",
1789
+ "email": UserStoreSingleton.shared.verificationEmail ?? ""
1785
1790
  ]
1786
1791
 
1787
1792
  // Conditionally add billing info
@@ -550,7 +550,7 @@ class OTPVerificationVC: BaseVC {
550
550
  "cvc": cvv ?? "",
551
551
  "currency": "usd",
552
552
  // "payment_method": selectedPaymentMethod ?? "",
553
- "save_card": 1,
553
+ "save_card": "1",
554
554
  "is_default": "1",
555
555
  // "create_customer": "1"
556
556
  "email": userEmail ?? ""
@@ -3065,7 +3065,7 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
3065
3065
  "account_type": self.selectedGrailPayAccountType ?? "",
3066
3066
  "name": self.selectedGrailPayAccountName ?? "",
3067
3067
  "description": "payment checkout",
3068
- "email": UserStoreSingleton.shared.merchantEmail ?? ""
3068
+ "email": txtFieldEmailGrailPayView.text
3069
3069
  ]
3070
3070
 
3071
3071
  if let billingInfoData = request.billingInfoData {
@@ -3273,7 +3273,8 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
3273
3273
  "name": self.selectedNewGrailPayAccountName ?? "",
3274
3274
  "description": "payment checkout",
3275
3275
  "customer_id": self.grailPayNewAccountCustomerID ?? "",
3276
- "save_account": isSavedForFuture ? 1 : 0
3276
+ "save_account": isSavedForFuture ? 1 : 0,
3277
+ "email": UserStoreSingleton.shared.verificationEmail ?? ""
3277
3278
  ]
3278
3279
 
3279
3280
  // Add is_default parameter if save_card is 1
@@ -3487,6 +3488,7 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
3487
3488
  "customer": selectedbankAccounts?.customer_id ?? "",
3488
3489
  "description": "payment checkout",
3489
3490
  "currency": "usd",
3491
+ "email": UserStoreSingleton.shared.verificationEmail ?? "",
3490
3492
  ]
3491
3493
 
3492
3494
  if let billingInfoData = request.billingInfoData {
@@ -4020,7 +4022,22 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
4020
4022
 
4021
4023
  // Navigate to EmailVerificationVC if isSavedForFuture is true, else call paymentIntentApi
4022
4024
  if isSavedForFuture {
4023
- navigateCardDataToEmailVerificationVC()
4025
+ if let vc = storyboard?.instantiateViewController(withIdentifier: "OTPVerificationVC") as? OTPVerificationVC {
4026
+ vc.cardNumber = self.cardNumberTextField.text
4027
+ vc.expiryDate = self.cardExpiryTextField.text
4028
+ vc.cvv = self.cardCvvTextField.text
4029
+ vc.nameOnCard = self.cardNameTextField.text
4030
+ vc.selectedPaymentMethod = self.selectedPaymentMethod
4031
+ vc.isSavedForFuture = isSavedForFuture
4032
+ vc.easyPayDelegate = self.easyPayDelegate // Pass delegate if needed
4033
+ vc.request = self.request
4034
+ vc.chosenPlan = self.txtFieldChosePlanCard.text
4035
+ vc.startDate = self.txtFieldStartDateCard.text
4036
+ vc.userEmail = self.txtFieldEmailCardView.text
4037
+ vc.email = self.txtFieldEmailCardView.text
4038
+ vc.amount = self.amount
4039
+ self.navigationController?.pushViewController(vc, animated: true)
4040
+ }
4024
4041
  } else {
4025
4042
  if request.secureAuthentication == true {
4026
4043
  threeDSecurePaymentApi()
@@ -5988,7 +6005,9 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
5988
6005
  "currency": "usd",
5989
6006
  "card_id": selectedCard?.cardId ?? "",
5990
6007
  "cvc": txtFieldCVVSingleSavedCard.text?.trimmingCharacters(in: .whitespacesAndNewlines) ?? "",
5991
- "customer_id": selectedCard?.customerId ?? ""
6008
+ "customer_id": selectedCard?.customerId ?? "",
6009
+ "name": UserStoreSingleton.shared.merchantName ?? "",
6010
+ "email": UserStoreSingleton.shared.verificationEmail ?? ""
5992
6011
  ]
5993
6012
 
5994
6013
  // Add these if recurring is enabled
@@ -6140,6 +6159,7 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
6140
6159
  "customer_id" : selectedCard?.customerId ?? "",
6141
6160
  "card_id" : selectedCard?.cardId ?? "",
6142
6161
  "cvc" : txtFieldCVVSingleSavedCard.text?.trimmingCharacters(in: .whitespacesAndNewlines) ?? "",
6162
+ "email": UserStoreSingleton.shared.verificationEmail ?? ""
6143
6163
  ]
6144
6164
 
6145
6165
  if let billingInfoData = request.billingInfoData {
@@ -6227,6 +6247,8 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
6227
6247
  params["interval"] = txtFieldSelectPlanSingleSavedCard.text.lowercased()
6228
6248
  }
6229
6249
 
6250
+ print(params)
6251
+
6230
6252
  do {
6231
6253
  let jsonData = try JSONSerialization.data(withJSONObject: params, options: .prettyPrinted)
6232
6254
  uRLRequest.httpBody = jsonData
@@ -7336,7 +7358,7 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
7336
7358
 
7337
7359
  var params: [String: Any] = [
7338
7360
  "name": txtFieldAccountName.text ?? "",
7339
- "email": "test@gmail.com",
7361
+ "email": txtFieldEmailAccountView.text,
7340
7362
  "description": "TestDescription",
7341
7363
  "currency": "usd",
7342
7364
  "account_type": txtFieldAccountType.text?.lowercased() ?? "",
@@ -7370,6 +7392,8 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
7370
7392
  params["interval"] = txtFieldSelectPlanViewBankFields.text.lowercased()
7371
7393
  }
7372
7394
 
7395
+ print(params)
7396
+
7373
7397
  do {
7374
7398
  let jsonData = try JSONSerialization.data(withJSONObject: params, options: .prettyPrinted)
7375
7399
  uRLRequest.httpBody = jsonData
@@ -7495,7 +7519,7 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
7495
7519
 
7496
7520
  var params: [String: Any] = [
7497
7521
  "name": txtFieldAccountName.text ?? "",
7498
- "email": "test@gmail.com",
7522
+ "email": txtFieldEmailAccountView.text,
7499
7523
  "description": "TestDescription",
7500
7524
  "currency": "usd",
7501
7525
  "account_type": txtFieldAccountType.text?.lowercased() ?? "",
@@ -7591,6 +7615,8 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
7591
7615
  params["interval"] = txtFieldSelectPlanViewBankFields.text.lowercased()
7592
7616
  }
7593
7617
 
7618
+ print(params)
7619
+
7594
7620
  do {
7595
7621
  let jsonData = try JSONSerialization.data(withJSONObject: params, options: .prettyPrinted)
7596
7622
  uRLRequest.httpBody = jsonData
@@ -7714,6 +7740,7 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
7714
7740
  "payment_method": "ach",
7715
7741
  "description": "Test Description",
7716
7742
  "currency": "usd",
7743
+ "email": UserStoreSingleton.shared.verificationEmail ?? ""
7717
7744
  ]
7718
7745
 
7719
7746
  // Add these if recurring is enabled
@@ -7871,6 +7898,7 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
7871
7898
  "payment_method": "ach",
7872
7899
  "description": "Test Description",
7873
7900
  "currency": "usd",
7901
+ "email": UserStoreSingleton.shared.verificationEmail ?? ""
7874
7902
  ]
7875
7903
 
7876
7904
  if let billingInfoData = request.billingInfoData {
@@ -9228,7 +9256,7 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
9228
9256
 
9229
9257
  var params: [String: Any] = [
9230
9258
  "name": nameText,
9231
- "email": txtFieldEmail.text ?? "",
9259
+ "email": UserStoreSingleton.shared.verificationEmail ?? "",
9232
9260
  "card_number": cardNumberText,
9233
9261
  "cardholder_name": nameText,
9234
9262
  "exp_month": expiryText.components(separatedBy: "/").first ?? "",
@@ -9459,7 +9487,7 @@ extension PaymentInfoVC: UICollectionViewDelegate, UICollectionViewDataSource, U
9459
9487
  cell.lblPayment.textColor = uiColor
9460
9488
  }
9461
9489
  } else {
9462
- if let primaryFontColor = UserStoreSingleton.shared.primary_font_col,
9490
+ if let primaryFontColor = UserStoreSingleton.shared.secondary_font_col,
9463
9491
  let uiColor = UIColor(hex: primaryFontColor) {
9464
9492
  cell.vwMain.layer.borderColor = uiColor.cgColor
9465
9493
  cell.imgVwPayments.tintColor = uiColor
@@ -1,6 +1,6 @@
1
1
  Pod::Spec.new do |s|
2
2
  s.name = 'easymerchantsdk'
3
- s.version = '1.5.8'
3
+ s.version = '1.5.9'
4
4
  s.summary = 'A React Native SDK for Easy Merchant.'
5
5
  s.description = <<-DESC
6
6
  A React Native SDK to enable Easy Merchant functionality in mobile applications.