@jimrising/easymerchantsdk-react-native 2.4.8 → 2.5.0

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 (88) hide show
  1. package/.yarn/install-state.gz +0 -0
  2. package/ACH_CHARGE_ENDPOINT_TRACE.md +69 -0
  3. package/README.md +1 -1
  4. package/android/.settings/org.eclipse.buildship.core.prefs +2 -2
  5. package/android/build.gradle +3 -4
  6. package/android/config.properties +5 -0
  7. package/android/config.properties.example +5 -0
  8. package/ios/ApiManager/APIHeaders.swift +8 -1
  9. package/ios/ApiManager/APIRequest.swift +8 -6
  10. package/ios/ApiManager/APIService.swift +0 -2
  11. package/ios/Classes/EasyMerchantSdk.h +0 -1
  12. package/ios/Classes/EasyMerchantSdk.m +54 -5
  13. package/ios/Classes/EasyMerchantSdk.swift +1 -15
  14. package/ios/Classes/EasyPayViewController.swift +1 -1
  15. package/ios/EnvironmentConfig.swift +0 -1
  16. package/ios/Example/SceneDelegate.swift +23 -1
  17. package/ios/Example/ViewController.swift +0 -8
  18. package/ios/Extensions/UIFont.swift +0 -1
  19. package/ios/Extensions/UIViewController+Extension.swift +0 -1
  20. package/ios/Helper/GrailPayHelper.swift +146 -58
  21. package/ios/Helper/GrailPayWebViewController.swift +416 -0
  22. package/ios/Helper/JavaScriptBridge.swift +312 -0
  23. package/ios/Helper/WebViewConfig.swift +159 -0
  24. package/ios/Models/Request.swift +48 -204
  25. package/ios/easymerchantsdk.podspec +2 -2
  26. package/package.json +1 -1
  27. package/android/build/generated/source/buildConfig/debug/com/reactlibrary/BuildConfig.java +0 -10
  28. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +0 -7
  29. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +0 -18
  30. package/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +0 -6
  31. package/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +0 -1
  32. package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
  33. package/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
  34. package/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +0 -0
  35. package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +0 -1
  36. package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +0 -2
  37. package/android/build/intermediates/incremental/mergeDebugAssets/merger.xml +0 -2
  38. package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +0 -2
  39. package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +0 -2
  40. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactlibrary/BuildConfig.class +0 -0
  41. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactlibrary/RNEasymerchantsdkModule$1$1.class +0 -0
  42. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactlibrary/RNEasymerchantsdkModule$1.class +0 -0
  43. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactlibrary/RNEasymerchantsdkModule$2.class +0 -0
  44. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactlibrary/RNEasymerchantsdkModule$3.class +0 -0
  45. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactlibrary/RNEasymerchantsdkModule.class +0 -0
  46. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactlibrary/RNEasymerchantsdkPackage.class +0 -0
  47. package/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +0 -2
  48. package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +0 -7
  49. package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +0 -7
  50. package/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +0 -1
  51. package/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +0 -1
  52. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/reactlibrary/BuildConfig.class +0 -0
  53. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/reactlibrary/RNEasymerchantsdkModule$1$1.class +0 -0
  54. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/reactlibrary/RNEasymerchantsdkModule$1.class +0 -0
  55. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/reactlibrary/RNEasymerchantsdkModule$2.class +0 -0
  56. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/reactlibrary/RNEasymerchantsdkModule$3.class +0 -0
  57. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/reactlibrary/RNEasymerchantsdkModule.class +0 -0
  58. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/reactlibrary/RNEasymerchantsdkPackage.class +0 -0
  59. package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
  60. package/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +0 -1
  61. package/android/build/outputs/logs/manifest-merger-debug-report.txt +0 -16
  62. package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  63. package/ios/Pods/UserDefaults/UserStoreSingleton.swift +0 -425
  64. package/ios/Pods/ViewControllers/AdditionalInfoVC.swift +0 -2996
  65. package/ios/Pods/ViewControllers/BaseVC.swift +0 -142
  66. package/ios/Pods/ViewControllers/BillingInfoVC/BillingInfoVC.swift +0 -3807
  67. package/ios/Pods/ViewControllers/BillingInfoVC/Cells/CityListTVC.swift +0 -46
  68. package/ios/Pods/ViewControllers/BillingInfoVC/Cells/CountryListTVC.swift +0 -47
  69. package/ios/Pods/ViewControllers/BillingInfoVC/Cells/StateListTVC.swift +0 -46
  70. package/ios/Pods/ViewControllers/Clean Runner_2025-07-23T14-58-05.txt +0 -13
  71. package/ios/Pods/ViewControllers/CountryListVC.swift +0 -435
  72. package/ios/Pods/ViewControllers/EmailVerificationVC.swift +0 -300
  73. package/ios/Pods/ViewControllers/GrailPayVC.swift +0 -492
  74. package/ios/Pods/ViewControllers/OTPVerificationVC.swift +0 -2278
  75. package/ios/Pods/ViewControllers/PaymentDoneVC.swift +0 -287
  76. package/ios/Pods/ViewControllers/PaymentErrorVC.swift +0 -85
  77. package/ios/Pods/ViewControllers/PaymentInformation/AccountTypeTVC.swift +0 -41
  78. package/ios/Pods/ViewControllers/PaymentInformation/PaymentInfoVC.swift +0 -13115
  79. package/ios/Pods/ViewControllers/PaymentInformation/PaymentInformationCVC.swift +0 -35
  80. package/ios/Pods/ViewControllers/PaymentInformation/RecurringTVC.swift +0 -40
  81. package/ios/Pods/ViewControllers/PaymentInformation/SavedAccountsTVC/SavedAccountTVC.swift +0 -80
  82. package/ios/Pods/ViewControllers/PaymentInformation/SavedAccountsTVC/SavedAccountTVC.xib +0 -163
  83. package/ios/Pods/ViewControllers/PaymentInformation/SavedCardsTVC/SavedCardsTVC.swift +0 -81
  84. package/ios/Pods/ViewControllers/PaymentInformation/SavedCardsTVC/SavedCardsTVC.xib +0 -188
  85. package/ios/Pods/ViewControllers/PaymentStatusWebViewVC.swift +0 -167
  86. package/ios/Pods/ViewControllers/TermAndConditionsVC.swift +0 -63
  87. package/ios/Pods/ViewControllers/ThreeDSecurePaymentDoneVC.swift +0 -1254
  88. package/ios/easymerchantsdk.storyboard +0 -9089
Binary file
@@ -0,0 +1,69 @@
1
+ # Back-trace: `/api/v1/ach/charge` → PaymentInfoVC only (ignore billing/additional)
2
+
3
+ Endpoint: **`/api/v1/ach/charge`**
4
+ Built as: `EnvironmentConfig.baseURL + EnvironmentConfig.Endpoints.achCharge.path()`
5
+ File: **`em-MobileCheckoutSDK-ReactNative/ios/Pods/ViewControllers/PaymentInformation/PaymentInfoVC.swift`**
6
+
7
+ Billing and Additional Info flows (BillingInfoVC / AdditionalInfoVC) are ignored here; only direct ACH charge from PaymentInfoVC is listed.
8
+
9
+ ---
10
+
11
+ ## 1. Manual bank form (bank fields) — **Next** button
12
+
13
+ - **Action:** `actionBtnNext`
14
+ - **When:** Bank selected, manual bank fields form, **no billing/additional** (or nil `request.fields`).
15
+ - **Direct ACH call:**
16
+ - **`accountBankChargeApi()`** (~line 9023)
17
+ - **`accountChargeApi()`** (no-arg, ~line 8816)
18
+
19
+ ---
20
+
21
+ ## 2. New manual ACH (add new bank account) — **Pay** button
22
+
23
+ - **Action:** `actionBtnPayNowNewAccountView`
24
+ - **When:** Add-new-bank-account form, **no billing/additional** (and no OTP needed, or billing nil).
25
+ - **Direct ACH call:**
26
+ - **`accountBankChargeAddNewAccountApi()`** (~line 9926) — when no billing/additional and no OTP
27
+ - **`accountChargeAddNewAccountApi()`** (~line 9724) — when `request.fields` is nil and not saving
28
+ - **`accountChargeApi(customerId:)`** (~line 10183) — when `request.fields` is nil and saving (has customerId)
29
+
30
+ ---
31
+
32
+ ## 3. Saved bank (single saved account) — **Pay** button
33
+
34
+ - **Action:** `actionBtnPayNowSingleAccountView`
35
+ - **When:** Saved bank selected, **no billing/additional**.
36
+ - **Direct ACH call:**
37
+ - **`grailPayAaccountChargeSingleSavedAccountApi()`** (~line 4830)
38
+ - (In other branch when not authenticated ACH: **`accountBankChargeSavedBankAccountApi()`** — in PaymentInfoVC; if present it also hits ach/charge.)
39
+
40
+ ---
41
+
42
+ ## 4. GrailPay — existing linked account
43
+
44
+ - **Action:** Same **Next**-button flow when GrailPay + existing account, **no billing/additional**.
45
+ - **Direct ACH call:**
46
+ - **`grailPayAccountChargeApi()`** (~line 4149) — no save
47
+ - **`grailPayAccountChargeWithSaveApi()`** (~line 4365) — with save
48
+
49
+ ---
50
+
51
+ ## 5. GrailPay — new account
52
+
53
+ - **Action:** New GrailPay account flow, **no billing/additional**.
54
+ - **Direct ACH call:**
55
+ - **`grailPayNewAccountChargeApi()`** (~line 4598)
56
+
57
+ ---
58
+
59
+ ## Summary (PaymentInfoVC only, no billing/additional)
60
+
61
+ | Button / flow | API method that calls ach/charge |
62
+ |----------------------------------|-----------------------------------------------------|
63
+ | **actionBtnNext** (manual bank) | `accountBankChargeApi`, `accountChargeApi()` |
64
+ | **actionBtnPayNowNewAccountView**| `accountBankChargeAddNewAccountApi`, `accountChargeAddNewAccountApi`, `accountChargeApi(customerId:)` |
65
+ | **actionBtnPayNowSingleAccountView** | `grailPayAaccountChargeSingleSavedAccountApi` (and `accountBankChargeSavedBankAccountApi` in another branch) |
66
+ | GrailPay existing (Next) | `grailPayAccountChargeApi`, `grailPayAccountChargeWithSaveApi` |
67
+ | GrailPay new | `grailPayNewAccountChargeApi` |
68
+
69
+ All of the above use **`EnvironmentConfig.Endpoints.achCharge.path()`** → **`/api/v1/ach/charge`**.
package/README.md CHANGED
@@ -19,7 +19,7 @@ Add the EasyMerchant SDK to your `package.json` under `dependencies`:
19
19
 
20
20
  ```json
21
21
  "dependencies": {
22
- "@jimrising/easymerchantsdk-react-native": "^2.4.8"
22
+ "@jimrising/easymerchantsdk-react-native": "^2.3.9"
23
23
  }
24
24
  ```
25
25
 
@@ -1,11 +1,11 @@
1
- arguments=--init-script /var/folders/n2/0cwbnhxj2fnfrvxj2l226njc0000gn/T/db3b08fc4a9ef609cb16b96b200fa13e563f396e9bb1ed0905fdab7bc3bc513b.gradle --init-script /var/folders/n2/0cwbnhxj2fnfrvxj2l226njc0000gn/T/52cde0cfcf3e28b8b7510e992210d9614505e0911af0c190bd590d7158574963.gradle
1
+ arguments=--init-script /var/folders/7t/r_0xdprj4qqdnkmccbx458sr0000gn/T/db3b08fc4a9ef609cb16b96b200fa13e563f396e9bb1ed0905fdab7bc3bc513b.gradle --init-script /var/folders/7t/r_0xdprj4qqdnkmccbx458sr0000gn/T/52cde0cfcf3e28b8b7510e992210d9614505e0911af0c190bd590d7158574963.gradle
2
2
  auto.sync=false
3
3
  build.scans.enabled=false
4
4
  connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(8.9))
5
5
  connection.project.dir=
6
6
  eclipse.preferences.version=1
7
7
  gradle.user.home=
8
- java.home=/opt/homebrew/Cellar/openjdk@17/17.0.15/libexec/openjdk.jdk/Contents/Home
8
+ java.home=/opt/homebrew/Cellar/openjdk@17/17.0.16/libexec/openjdk.jdk/Contents/Home
9
9
  jvm.arguments=
10
10
  offline.mode=false
11
11
  override.workspace.settings=true
@@ -64,8 +64,8 @@ repositories {
64
64
  maven {
65
65
  url = uri("https://maven.pkg.github.com/EasyMerchant/em-MobileCheckoutSDK-Android")
66
66
  credentials {
67
- username = "jim-easymerchant"
68
- password = "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"
67
+ username = project.findProperty("GITHUB_USERNAME") ?: System.getenv("GITHUB_USERNAME") ?: ""
68
+ password = project.findProperty("GITHUB_PASSWORD") ?: System.getenv("GITHUB_PASSWORD") ?: ""
69
69
  }
70
70
  }
71
71
  }
@@ -88,8 +88,7 @@ dependencies {
88
88
  implementation 'com.google.android.material:material:1.13.0'
89
89
 
90
90
  // Third-party libs
91
- implementation 'androidx.browser:browser:1.8.0'
92
- implementation 'com.app:paysdk:1.6.3.6'
91
+ implementation 'com.app:paysdk:1.6.6.3'
93
92
  implementation 'com.hbb20:ccp:2.7.3'
94
93
  implementation 'com.github.bumptech.glide:glide:5.0.4'
95
94
  implementation 'com.github.androidmads:QRGenerator:1.0.5'
@@ -0,0 +1,5 @@
1
+ # GitHub Packages credentials (only needed if resolving the Android SDK from GitHub Packages)
2
+ # Set your own values. Do not commit real credentials.
3
+ GITHUB_USERNAME=
4
+ GITHUB_PASSWORD=
5
+ GITHUB_URL=https://maven.pkg.github.com/EasyMerchant/em-MobileCheckoutSDK-Android
@@ -0,0 +1,5 @@
1
+ # GitHub Packages credentials (only needed if resolving the Android SDK from GitHub Packages)
2
+ # Copy to config.properties and set your values. Do not commit config.properties with real credentials.
3
+ GITHUB_USERNAME=your_github_username
4
+ GITHUB_PASSWORD=your_github_token
5
+ GITHUB_URL=https://maven.pkg.github.com/EasyMerchant/em-MobileCheckoutSDK-Android
@@ -22,10 +22,17 @@ struct APIHeaders {
22
22
  return ["Customer-Token": token]
23
23
  }
24
24
 
25
+ /// For verify_otp only: match Android — header "Customer-Token" (Pascal case), no Client-Token, no X-Api-Key/Secret
26
+ static func verifyOtpHeaders() -> [String: String] {
27
+ guard let token = UserStoreSingleton.shared.customerToken else { return [:] }
28
+ return ["Customer-Token": token]
29
+ }
30
+
31
+ /// API key/secret headers (match Android SDK: X-Api-Key, X-Api-Secret)
25
32
  static func apiAuthHeaders() -> [String: String] {
26
33
  guard let key = EnvironmentConfig.apiKey,
27
34
  let secret = EnvironmentConfig.apiSecret else { return [:] }
28
- return ["x-api-key": key, "x-api-secret": secret]
35
+ return ["X-Api-Key": key, "X-Api-Secret": secret]
29
36
  }
30
37
  }
31
38
 
@@ -21,7 +21,6 @@ struct APIRequest {
21
21
  func buildURLRequest() -> URLRequest? {
22
22
  let fullURL = EnvironmentConfig.baseURL + endpoint.path()
23
23
  guard let url = URL(string: fullURL) else {
24
- print("Invalid URL: \(fullURL)")
25
24
  return nil
26
25
  }
27
26
 
@@ -30,9 +29,14 @@ struct APIRequest {
30
29
 
31
30
  // Combine default headers with passed-in headers
32
31
  var allHeaders = APIHeaders.commonHeaders()
33
- allHeaders.merge(APIHeaders.clientTokenHeader(), uniquingKeysWith: { $1 })
34
- allHeaders.merge(APIHeaders.customerTokenHeader(), uniquingKeysWith: { $1 })
35
- allHeaders.merge(APIHeaders.apiAuthHeaders(), uniquingKeysWith: { $1 })
32
+ if endpoint == .verifyOtp {
33
+ // verify_otp: match Android — only Customer-Token + Content-Type (no Client-Token, no X-Api-Key/Secret)
34
+ allHeaders.merge(APIHeaders.verifyOtpHeaders(), uniquingKeysWith: { $1 })
35
+ } else {
36
+ allHeaders.merge(APIHeaders.clientTokenHeader(), uniquingKeysWith: { $1 })
37
+ allHeaders.merge(APIHeaders.customerTokenHeader(), uniquingKeysWith: { $1 })
38
+ allHeaders.merge(APIHeaders.apiAuthHeaders(), uniquingKeysWith: { $1 })
39
+ }
36
40
  allHeaders.merge(headers, uniquingKeysWith: { $1 }) // override if needed
37
41
 
38
42
  // Apply to request
@@ -47,10 +51,8 @@ struct APIRequest {
47
51
  request.httpBody = jsonData
48
52
  // Debug
49
53
  if let jsonString = String(data: jsonData, encoding: .utf8) {
50
- print("JSON Payload Sent:\n\(jsonString)")
51
54
  }
52
55
  } catch {
53
- print("Failed to serialize request body: \(error)")
54
56
  return nil
55
57
  }
56
58
  }
@@ -28,7 +28,6 @@ class APIService {
28
28
 
29
29
  // Debug print
30
30
  if let data = data, let rawString = String(data: data, encoding: .utf8) {
31
- print("🧾 Raw Response:\n\(rawString)")
32
31
  }
33
32
 
34
33
  if let error = error {
@@ -87,7 +86,6 @@ class APIService {
87
86
 
88
87
  // Debug: optional - print raw response
89
88
  if let rawString = String(data: data, encoding: .utf8) {
90
- print("🧾 Raw Response:\n\(rawString)")
91
89
  }
92
90
 
93
91
  // Attempt decoding
@@ -2,7 +2,6 @@
2
2
 
3
3
  @interface EasyMerchantSdk : NSObject <RCTBridgeModule>
4
4
 
5
- // Deep link handling for GrailPay
6
5
  + (BOOL)handleDeepLink:(NSURL *)url;
7
6
 
8
7
  @end
@@ -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
 
9
9
  @interface EasyMerchantSdk ()
@@ -123,6 +123,27 @@ RCT_EXPORT_METHOD(getPlatformVersion:(RCTPromiseResolveBlock)resolve
123
123
  });
124
124
  }
125
125
 
126
+ RCT_EXPORT_METHOD(handleDeepLink:(NSString *)url
127
+ resolver:(RCTPromiseResolveBlock)resolve
128
+ rejecter:(RCTPromiseRejectBlock)reject)
129
+ {
130
+ dispatch_async(dispatch_get_main_queue(), ^{
131
+ if (!url || [url length] == 0) {
132
+ reject(@"INVALID_URL", @"URL is required", nil);
133
+ return;
134
+ }
135
+
136
+ NSURL *deepLinkURL = [NSURL URLWithString:url];
137
+ if (!deepLinkURL) {
138
+ reject(@"INVALID_URL", @"Invalid URL format", nil);
139
+ return;
140
+ }
141
+
142
+ [GrailPayHelper handleDeepLinkCallbackWithUrl:deepLinkURL];
143
+ resolve(@"Deep link handled successfully");
144
+ });
145
+ }
146
+
126
147
  // Helper method to find the top-most view controller
127
148
  - (UIViewController *)topMostViewController {
128
149
  UIWindow *keyWindow = nil;
@@ -164,10 +185,38 @@ RCT_EXPORT_METHOD(getPlatformVersion:(RCTPromiseResolveBlock)resolve
164
185
  return base;
165
186
  }
166
187
 
167
- // MARK: - Deep Link Handling
168
-
169
188
  + (BOOL)handleDeepLink:(NSURL *)url {
170
- return [EasyMerchantSdkPlugin handleDeepLinkWithUrl:url];
189
+ if (!url || !url.scheme) {
190
+ return NO;
191
+ }
192
+
193
+ NSString *scheme = url.scheme.lowercaseString;
194
+ NSString *host = url.host ? url.host.lowercaseString : @"";
195
+ NSString *urlString = url.absoluteString;
196
+
197
+ // GrailPay backend OAuth callback (intercepted from bank app)
198
+ if (([scheme isEqualToString:@"https"] || [scheme isEqualToString:@"http"]) &&
199
+ [host isEqualToString:@"bank-link-sdk-api.grailpay.com"]) {
200
+ [GrailPayHelper handleGrailPayOAuthCallbackWithUrl:url];
201
+ return YES;
202
+ }
203
+
204
+ // Expediter/expeditor schemes
205
+ if ([scheme isEqualToString:@"expediter"] || [scheme isEqualToString:@"expeditor"]) {
206
+ [GrailPayHelper handleDeepLinkCallbackWithUrl:url];
207
+ return YES;
208
+ }
209
+
210
+ // grailpay deep link or app-specific scheme
211
+ if ([scheme isEqualToString:@"grailpay"] ||
212
+ [scheme hasPrefix:@"com."] ||
213
+ [scheme hasPrefix:@"org."] ||
214
+ [urlString containsString:@"callback"]) {
215
+ [GrailPayHelper handleDeepLinkCallbackWithUrl:url];
216
+ return YES;
217
+ }
218
+
219
+ return NO;
171
220
  }
172
221
 
173
222
  @end
@@ -143,20 +143,6 @@ public class EasyMerchantSdkPlugin: NSObject, RCTBridgeModule {
143
143
  resolve("iOS \(UIDevice.current.systemVersion)")
144
144
  }
145
145
 
146
- // MARK: - Deep Link Handling for GrailPay
147
-
148
- @objc public static func handleDeepLink(url: URL) -> Bool {
149
- print("🔗 SDK: Deep link received: \(url)")
150
-
151
- if url.scheme == "grailpay" && url.host == "callback" {
152
- print("✅ SDK: GrailPay callback detected")
153
- GrailPayHelper.handleDeepLinkCallback(url: url)
154
- return true
155
- }
156
-
157
- return false
158
- }
159
-
160
146
  // MARK: - Helpers
161
147
 
162
148
  private func getTopViewController() -> UIViewController? {
@@ -230,7 +216,7 @@ public class EasyMerchantSdkPlugin: NSObject, RCTBridgeModule {
230
216
  let grailPay = (json["grailPayParams"] as? [String: Any]).flatMap {
231
217
  GrailPayRequest(
232
218
  role: $0["role"] as? String ?? "",
233
- timeout: $0["timeout"] as? Int ?? 0,
219
+ timeout: max($0["timeout"] as? Int ?? 11, 11),
234
220
  brandingName: $0["brandingName"] as? String ?? "",
235
221
  finderSubtitle: $0["finderSubtitle"] as? String ?? "",
236
222
  searchPlaceholder: $0["searchPlaceholder"] as? String ?? ""
@@ -58,7 +58,7 @@ public final class EasyPayViewController: UINavigationController {
58
58
  // Disable interactive pop gesture to prevent dismissal by sliding from left
59
59
  self.interactivePopGestureRecognizer?.isEnabled = false
60
60
 
61
- let vc = UIStoryboard(name: "easymerchantsdk", bundle: Bundle.easyPayBundle).instantiateViewController(withIdentifier: "PaymentInfoVC") as! PaymentInfoVC
61
+ let vc = UIStoryboard(name: "EasyPaySdk", bundle: Bundle.easyPayBundle).instantiateViewController(withIdentifier: "PaymentInfoVC") as! PaymentInfoVC
62
62
  vc.modalPresentationStyle = .overFullScreen
63
63
  vc.configureWith(request: request, delegate: easyPayDelegate)
64
64
  // For API key/secret flow, pass amount immediately. For clientToken flow,
@@ -75,7 +75,6 @@ public class EnvironmentConfig {
75
75
  case .hostedCheckouts: return "/api/v1/hostedcheckouts"
76
76
  case .emailVerification: return "/api/v1/customer/send_otp"
77
77
  case .verifyOtp: return "/api/v1/customer/verify_otp"
78
- // case .getCards: return "/api/v1/customer/card"
79
78
  case .getCards: return "/api/v1/card"
80
79
  case .creditCharges: return "/api/v1/customer/charges"
81
80
  case .account: return "/api/v1/ach/account"
@@ -1,6 +1,6 @@
1
1
  //
2
2
  // SceneDelegate.swift
3
- // easymerchantsdkDemo
3
+ // EasyPaySDKDemo
4
4
  //
5
5
  // Created by iftekhar on 13/07/24.
6
6
  //
@@ -17,6 +17,28 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
17
17
  // If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
18
18
  // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
19
19
  guard let _ = (scene as? UIWindowScene) else { return }
20
+
21
+ // Handle deep links on app launch
22
+ if let urlContext = connectionOptions.urlContexts.first {
23
+ handleDeepLink(url: urlContext.url)
24
+ }
25
+ }
26
+
27
+ // MARK: - Deep Link Handling for GrailPay
28
+
29
+ func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
30
+ if let url = URLContexts.first?.url {
31
+ handleDeepLink(url: url)
32
+ }
33
+ }
34
+
35
+ private func handleDeepLink(url: URL) {
36
+
37
+ if url.scheme == "grailpay" && url.host == "callback" {
38
+
39
+ // Handle deep link via GrailPayHelper (no more GrailPayVC lookup)
40
+ //GrailPayHelper.handleDeepLinkCallback(url: url)
41
+ }
20
42
  }
21
43
 
22
44
  func sceneDidDisconnect(_ scene: UIScene) {
@@ -85,7 +85,6 @@
85
85
  // )
86
86
  //
87
87
  // guard let billingData = try? JSONEncoder().encode(fields) else {
88
- // print("Failed to encode fields")
89
88
  // return
90
89
  // }
91
90
  //
@@ -192,7 +191,6 @@
192
191
  // )
193
192
  //
194
193
  // guard let billingData = try? JSONEncoder().encode(fields) else {
195
- // print("Failed to encode fields")
196
194
  // return
197
195
  // }
198
196
  //
@@ -304,7 +302,6 @@
304
302
  // // Combine into one string for the label
305
303
  // lblResponseShow.text = "Status: \(status), Message: \(message)"
306
304
  //
307
- // print("Cancel Data:", chargeData) // Debug print
308
305
  // }
309
306
  //
310
307
  // case .success:
@@ -336,7 +333,6 @@
336
333
  // do {
337
334
  // let jsonData = try JSONSerialization.data(withJSONObject: fullResponse, options: .prettyPrinted)
338
335
  // if let jsonString = String(data: jsonData, encoding: .utf8) {
339
- // print(jsonString)
340
336
  // lblResponseShow.text = jsonString
341
337
  // }
342
338
  // } catch {
@@ -351,7 +347,6 @@
351
347
  // lblResponseShow.isHidden = false
352
348
  // lblResponseShow.text = "Status: \(status), Message: \(message)"
353
349
  //
354
- // print("Error Data:", chargeData) // Debugging
355
350
  // } else {
356
351
  // lblResponseShow.isHidden = false
357
352
  // lblResponseShow.text = "An unknown error occurred."
@@ -446,7 +441,6 @@
446
441
  //// )
447
442
  ////
448
443
  //// guard let billingData = try? JSONEncoder().encode(fields) else {
449
- //// print("Failed to encode fields")
450
444
  //// return
451
445
  //// }
452
446
  ////
@@ -606,10 +600,8 @@
606
600
  ////
607
601
  //// let jsonData = try JSONSerialization.data(withJSONObject: requestDict, options: [.prettyPrinted])
608
602
  //// if let jsonString = String(data: jsonData, encoding: .utf8) {
609
- //// print("Request Configuration JSON:\n\(jsonString)")
610
603
  //// }
611
604
  //// } catch {
612
- //// print("Failed to serialize request to JSON: \(error)")
613
605
  //// }
614
606
  ////
615
607
  //// if request.initializationErrorMessage == nil {
@@ -21,7 +21,6 @@ extension UIFont {
21
21
  var error: Unmanaged<CFError>?
22
22
  let success = CTFontManagerRegisterGraphicsFont(font, &error)
23
23
  if !success {
24
- print("Error registering font: maybe it was already registered.")
25
24
  }
26
25
  } else {
27
26
  fatalError("Couldn't find font \(fontPath)")
@@ -28,7 +28,6 @@ extension UIViewController {
28
28
 
29
29
  func debugPrintLog(_ log: String) {
30
30
  #if DEBUG
31
- print("Debug - \(log)")
32
31
  #endif
33
32
  }
34
33