@jimrising/easymerchantsdk-react-native 2.4.9 → 2.5.1

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.
Binary file
package/.yarnrc.yml ADDED
@@ -0,0 +1 @@
1
+ nodeLinker: node-modules
@@ -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`**.
@@ -1,3 +1,11 @@
1
+ // Load config.properties for GitHub Packages credentials (GITHUB_USERNAME, GITHUB_PASSWORD)
2
+ def configFile = file("config.properties")
3
+ if (configFile.exists()) {
4
+ def config = new Properties()
5
+ configFile.withInputStream { config.load(it) }
6
+ config.each { key, value -> project.ext.set(key, value) }
7
+ }
8
+
1
9
  buildscript {
2
10
  ext.kotlinVersion = "1.9.10"
3
11
 
@@ -1,5 +1,5 @@
1
1
  # GitHub Packages credentials (only needed if resolving the Android SDK from GitHub Packages)
2
2
  # Set your own values. Do not commit real credentials.
3
- GITHUB_USERNAME=
4
- GITHUB_PASSWORD=
5
3
  GITHUB_URL=https://maven.pkg.github.com/EasyMerchant/em-MobileCheckoutSDK-Android
4
+ GITHUB_USERNAME=devpavany7
5
+ GITHUB_PASSWORD=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
@@ -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
 
@@ -29,9 +29,14 @@ struct APIRequest {
29
29
 
30
30
  // Combine default headers with passed-in headers
31
31
  var allHeaders = APIHeaders.commonHeaders()
32
- allHeaders.merge(APIHeaders.clientTokenHeader(), uniquingKeysWith: { $1 })
33
- allHeaders.merge(APIHeaders.customerTokenHeader(), uniquingKeysWith: { $1 })
34
- 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
+ }
35
40
  allHeaders.merge(headers, uniquingKeysWith: { $1 }) // override if needed
36
41
 
37
42
  // Apply to request
@@ -1,6 +1,6 @@
1
1
  Pod::Spec.new do |s|
2
2
  s.name = 'easymerchantsdk'
3
- s.version = '2.3.9'
3
+ s.version = '2.5.1'
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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jimrising/easymerchantsdk-react-native",
3
- "version": "2.4.9",
3
+ "version": "2.5.1",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -16,5 +16,5 @@
16
16
  "react-native": "^0.76.4",
17
17
  "react-native-windows": "^0.76.2"
18
18
  },
19
- "repository" : "https://github.com/EasyMerchant/em-MobileCheckoutSDK-ReactNative.git#dev-branch"
19
+ "repository": "https://github.com/EasyMerchant/em-MobileCheckoutSDK-ReactNative.git#dev-branch"
20
20
  }