@jimrising/easymerchantsdk-react-native 1.2.9 → 1.3.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.
- package/.idea/caches/deviceStreaming.xml +11 -0
- package/.idea/workspace.xml +19 -15
- package/README.md +51 -39
- package/ios/Classes/EasyMerchantSdk.m +7 -65
- package/ios/Classes/EasyMerchantSdk.swift +70 -150
- package/ios/Classes/EasyPayViewController.swift +4 -0
- package/ios/Classes/dsd +74 -0
- package/ios/EnvironmentConfig.swift +4 -0
- package/ios/Example/ViewController.swift +72 -36
- package/ios/Helper/GrailPayHelper.swift +19 -0
- package/ios/Models/Request.swift +138 -142
- package/ios/Pods/UserDefaults/UserStoreSingleton.swift +21 -5
- package/ios/Pods/ViewControllers/GrailPayVC.swift +220 -0
- package/ios/Pods/ViewControllers/PaymentInformation/PaymentInfoVC.swift +632 -436
- package/ios/easymerchantsdk.podspec +3 -1
- package/ios/easymerchantsdk.storyboard +4092 -45
- package/package.json +1 -1
|
@@ -49,6 +49,7 @@ public class EnvironmentConfig {
|
|
|
49
49
|
case account
|
|
50
50
|
case achCharge
|
|
51
51
|
case charges
|
|
52
|
+
case accountConnect
|
|
52
53
|
|
|
53
54
|
func path() -> String {
|
|
54
55
|
switch self {
|
|
@@ -61,6 +62,9 @@ public class EnvironmentConfig {
|
|
|
61
62
|
case .account: return "/api/v1/ach/account"
|
|
62
63
|
case .achCharge: return "/api/v1/ach/charge"
|
|
63
64
|
case .charges: return "/api/v1/charges"
|
|
65
|
+
case .accountConnect: return "/api/v1/ach/account/connect"
|
|
66
|
+
|
|
67
|
+
|
|
64
68
|
}
|
|
65
69
|
}
|
|
66
70
|
}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
//
|
|
2
|
+
//
|
|
1
3
|
//import UIKit
|
|
4
|
+
//import EasyPay
|
|
2
5
|
//
|
|
3
6
|
//class ViewController: UIViewController {
|
|
4
7
|
//
|
|
@@ -8,36 +11,48 @@
|
|
|
8
11
|
// override func viewDidLoad() {
|
|
9
12
|
// super.viewDidLoad()
|
|
10
13
|
//
|
|
11
|
-
//
|
|
12
|
-
// EnvironmentConfig.setEnvironment(.staging)
|
|
14
|
+
// // Select environment
|
|
15
|
+
// EasyPay.EnvironmentConfig.setEnvironment(.staging)
|
|
16
|
+
//
|
|
17
|
+
// // Blink Card License Setup
|
|
18
|
+
// let licenseErrorMessage = BlinkCardHelper.setupLicense()
|
|
19
|
+
// if !licenseErrorMessage.isEmpty {
|
|
20
|
+
// showLicenseErrorAlert(message: licenseErrorMessage)
|
|
21
|
+
// }
|
|
22
|
+
// }
|
|
23
|
+
//
|
|
24
|
+
// private func showLicenseErrorAlert(message: String) {
|
|
25
|
+
// let alert = UIAlertController(title: "License Error", message: message, preferredStyle: .alert)
|
|
26
|
+
// alert.addAction(UIAlertAction(title: "OK", style: .default))
|
|
27
|
+
// self.present(alert, animated: true, completion: nil)
|
|
13
28
|
// }
|
|
14
29
|
//
|
|
15
30
|
// @IBAction private func payAction() {
|
|
16
|
-
//// let apiKey = "
|
|
17
|
-
//// let apiSecret = "
|
|
18
|
-
//
|
|
19
|
-
//
|
|
20
|
-
//
|
|
21
|
-
//
|
|
22
|
-
// EnvironmentConfig.configure(apiKey: apiKey, apiSecret: apiSecret)
|
|
23
|
-
//
|
|
24
|
-
//
|
|
25
|
-
// let themeConfiguration
|
|
26
|
-
//
|
|
27
|
-
//
|
|
28
|
-
//
|
|
29
|
-
//
|
|
30
|
-
//
|
|
31
|
-
//
|
|
32
|
-
//
|
|
33
|
-
//
|
|
34
|
-
//
|
|
35
|
-
//
|
|
36
|
-
//
|
|
37
|
-
//
|
|
38
|
-
//
|
|
31
|
+
//// let apiKey = "f149cf5afc3a67c79e0aa87e7"
|
|
32
|
+
//// let apiSecret = "22b9dd1e588146077ca77da82"
|
|
33
|
+
//
|
|
34
|
+
// let apiKey = "14fbf8a186091763e59c289c1"
|
|
35
|
+
// let apiSecret = "f90863e7a853539f8ace8d6de"
|
|
36
|
+
//
|
|
37
|
+
// EasyPay.EnvironmentConfig.configure(apiKey: apiKey, apiSecret: apiSecret)
|
|
38
|
+
//
|
|
39
|
+
// // Theme Configuration
|
|
40
|
+
// let themeConfiguration = ThemeConfiguration(
|
|
41
|
+
// bodyBackgroundColor: "#EBF8FF",
|
|
42
|
+
// containerBackgroundColor: "#FFFFFF",
|
|
43
|
+
// primaryFontColor: "#1E3A8A",
|
|
44
|
+
// secondaryFontColor: "#696969",
|
|
45
|
+
// primaryButtonBackgroundColor: "#1D4ED8",
|
|
46
|
+
// primaryButtonHoverColor: "#2563EB",
|
|
47
|
+
// primaryButtonFontColor: "#FFFFFF",
|
|
48
|
+
// secondaryButtonBackgroundColor: "#FFFFFF",
|
|
49
|
+
// secondaryButtonHoverColor: "#BFDBFE",
|
|
50
|
+
// secondaryButtonFontColor: "#1E40AF",
|
|
51
|
+
// borderRadius: "8",
|
|
52
|
+
// fontSize: "14"
|
|
53
|
+
// )
|
|
39
54
|
//
|
|
40
|
-
// let additionalInfoRequest = [
|
|
55
|
+
// let additionalInfoRequest: [String: Any] = [
|
|
41
56
|
// "name": "Test User",
|
|
42
57
|
// "email": "test@gmail.com",
|
|
43
58
|
// "phone_number": "9465351125",
|
|
@@ -59,18 +74,32 @@
|
|
|
59
74
|
// return
|
|
60
75
|
// }
|
|
61
76
|
//
|
|
62
|
-
// let
|
|
77
|
+
// let authenticatedACH = true
|
|
78
|
+
//
|
|
79
|
+
// let grailPayParams = GrailPayRequest(
|
|
80
|
+
// accessToken: "251|uTijpDGfrS88UR2V1cZNMQ8S4hUJA0sVzsnsoUZF",
|
|
81
|
+
// vendorId: "251",
|
|
82
|
+
// role: "business",
|
|
83
|
+
// timeout: 10,
|
|
84
|
+
// isSandbox: true,
|
|
85
|
+
// brandingName: "Lyfecycle Payments",
|
|
86
|
+
// finderSubtitle: "Search for your bank",
|
|
87
|
+
// searchPlaceholder: "Enter bank name"
|
|
88
|
+
// )
|
|
89
|
+
//
|
|
90
|
+
// let request = EasyPay.Request(
|
|
63
91
|
// amount: 99,
|
|
64
92
|
// billingInfoData: jsonData,
|
|
65
93
|
// paymentMethods: [.Card, .Bank, .Crypto],
|
|
66
94
|
// themeConfiguration: themeConfiguration,
|
|
67
95
|
// tokenOnly: false,
|
|
68
96
|
// saveCard: false,
|
|
69
|
-
// saveAccount: false
|
|
70
|
-
//
|
|
97
|
+
// saveAccount: false,
|
|
98
|
+
// submitButtonText: "Submit",
|
|
99
|
+
// authenticatedACH: authenticatedACH,
|
|
100
|
+
// grailPayParams: authenticatedACH ? grailPayParams : nil
|
|
71
101
|
// )
|
|
72
102
|
//
|
|
73
|
-
// // If tokenOnly is true, wait for the clientToken and show it in lblResponseShow
|
|
74
103
|
// if request.tokenOnly == true {
|
|
75
104
|
// NotificationCenter.default.addObserver(forName: NSNotification.Name("ClientTokenReceived"), object: nil, queue: .main) { notification in
|
|
76
105
|
// if let clientToken = notification.object as? String {
|
|
@@ -82,21 +111,16 @@
|
|
|
82
111
|
// let controller = EasyPayViewController(request: request, delegate: self)
|
|
83
112
|
// self.present(controller, animated: true)
|
|
84
113
|
// }
|
|
85
|
-
//
|
|
86
114
|
// }
|
|
87
|
-
//
|
|
88
115
|
//}
|
|
89
116
|
//
|
|
90
117
|
//extension ViewController: EasyPayViewControllerDelegate {
|
|
91
118
|
//
|
|
92
|
-
// func easyPayController(_ controller: EasyPayViewController, didFinishWith result: Result) {
|
|
119
|
+
// func easyPayController(_ controller: EasyPayViewController, didFinishWith result: EasyPay.Result) {
|
|
93
120
|
// switch result.type {
|
|
94
121
|
// case .cancelled:
|
|
95
122
|
// print("Cancelled")
|
|
96
123
|
// case .success:
|
|
97
|
-
// // if let chargeData = result.chargeData {
|
|
98
|
-
// // handleSuccess(with: chargeData)
|
|
99
|
-
// // }
|
|
100
124
|
// if let chargeData = result.chargeData {
|
|
101
125
|
// if let clientToken = chargeData["clientToken"] as? String {
|
|
102
126
|
// // If tokenOnly was true, display the token
|
|
@@ -121,4 +145,16 @@
|
|
|
121
145
|
// lblResponseShow.isHidden = false
|
|
122
146
|
// lblResponseShow.text = "Received Charge Data: \(chargeData)"
|
|
123
147
|
// }
|
|
148
|
+
//
|
|
124
149
|
//}
|
|
150
|
+
//
|
|
151
|
+
//
|
|
152
|
+
//
|
|
153
|
+
//
|
|
154
|
+
//
|
|
155
|
+
//
|
|
156
|
+
//
|
|
157
|
+
//
|
|
158
|
+
//
|
|
159
|
+
//
|
|
160
|
+
//
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//
|
|
2
|
+
// GrailPayHelper.swift
|
|
3
|
+
// EasyPay
|
|
4
|
+
//
|
|
5
|
+
// Created by Mony's Mac on 02/05/25.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
public class GrailPayHelper {
|
|
9
|
+
public static func presentGrailPay(
|
|
10
|
+
from viewController: UIViewController,
|
|
11
|
+
request: GrailPayRequest,
|
|
12
|
+
completion: @escaping (Result) -> Void
|
|
13
|
+
) {
|
|
14
|
+
let grailPayVC = GrailPayVC(request: request)
|
|
15
|
+
grailPayVC.onCompletion = completion
|
|
16
|
+
grailPayVC.modalPresentationStyle = .fullScreen
|
|
17
|
+
viewController.present(grailPayVC, animated: true)
|
|
18
|
+
}
|
|
19
|
+
}
|