@jimrising/easymerchantsdk-react-native 1.3.9 → 1.4.2
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 +77 -0
- package/README.md +140 -81
- package/android/.gradle/8.10/checksums/checksums.lock +0 -0
- package/android/.gradle/8.10/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/8.10/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/8.10/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/8.9/checksums/checksums.lock +0 -0
- package/android/.gradle/8.9/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/8.9/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +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 +158 -36
- package/android/src/main/java/com/reactlibrary/RNEasymerchantsdkPackage.java +45 -13
- package/ios/Classes/EasyMerchantSdk.m +106 -55
- package/ios/Classes/EasyMerchantSdk.swift +199 -77
- package/ios/Classes/EasyPayViewController.swift +1 -1
- package/ios/CustomComponents/DatePickerHandler.swift +15 -4
- package/ios/EnvironmentConfig.swift +32 -30
- package/ios/Models/Request.swift +176 -14
- package/ios/Models/Result.swift +12 -5
- package/ios/Pods/ViewControllers/AdditionalInfoVC.swift +855 -366
- package/ios/Pods/ViewControllers/BaseVC.swift +51 -36
- package/ios/Pods/ViewControllers/BillingInfoVC/BillingInfoVC.swift +1985 -178
- package/ios/Pods/ViewControllers/CountryListVC.swift +20 -1
- package/ios/Pods/ViewControllers/CustomOverlay.swift +199 -0
- package/ios/Pods/ViewControllers/EmailVerificationVC.swift +74 -5
- package/ios/Pods/ViewControllers/GrailPayVC.swift +131 -107
- package/ios/Pods/ViewControllers/OTPVerificationVC.swift +296 -106
- package/ios/Pods/ViewControllers/PaymentDoneVC.swift +35 -26
- package/ios/Pods/ViewControllers/PaymentInformation/PaymentInfoVC.swift +1276 -545
- package/ios/Pods/ViewControllers/ThreeDSecurePaymentDoneVC.swift +607 -24
- package/ios/easymerchantsdk.podspec +1 -1
- package/ios/easymerchantsdk.storyboard +1388 -1165
- package/package.json +1 -1
package/ios/Models/Request.swift
CHANGED
|
@@ -20,6 +20,8 @@ public struct ThemeConfiguration: Codable {
|
|
|
20
20
|
public let secondaryButtonFontColor: String?
|
|
21
21
|
public let borderRadius: String?
|
|
22
22
|
public let fontSize: String?
|
|
23
|
+
public let fontWeight: Int?
|
|
24
|
+
public let fontFamily: String?
|
|
23
25
|
|
|
24
26
|
public init(
|
|
25
27
|
bodyBackgroundColor: String? = nil,
|
|
@@ -33,7 +35,9 @@ public struct ThemeConfiguration: Codable {
|
|
|
33
35
|
secondaryButtonHoverColor: String? = nil,
|
|
34
36
|
secondaryButtonFontColor: String? = nil,
|
|
35
37
|
borderRadius: String? = nil,
|
|
36
|
-
fontSize: String? = nil
|
|
38
|
+
fontSize: String? = nil,
|
|
39
|
+
fontWeight: Int? = nil,
|
|
40
|
+
fontFamily: String? = nil
|
|
37
41
|
) {
|
|
38
42
|
self.bodyBackgroundColor = bodyBackgroundColor
|
|
39
43
|
self.containerBackgroundColor = containerBackgroundColor
|
|
@@ -47,6 +51,8 @@ public struct ThemeConfiguration: Codable {
|
|
|
47
51
|
self.secondaryButtonFontColor = secondaryButtonFontColor
|
|
48
52
|
self.borderRadius = borderRadius
|
|
49
53
|
self.fontSize = fontSize
|
|
54
|
+
self.fontWeight = fontWeight
|
|
55
|
+
self.fontFamily = fontFamily
|
|
50
56
|
}
|
|
51
57
|
}
|
|
52
58
|
|
|
@@ -81,14 +87,70 @@ public struct GrailPayRequest: Codable {
|
|
|
81
87
|
}
|
|
82
88
|
}
|
|
83
89
|
|
|
90
|
+
public enum BillingFieldName: String, Codable {
|
|
91
|
+
case address
|
|
92
|
+
case country
|
|
93
|
+
case state
|
|
94
|
+
case city
|
|
95
|
+
case postalCode = "postal_code"
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
public enum AdditionalFieldName: String, Codable {
|
|
99
|
+
case name
|
|
100
|
+
case email = "email_address"
|
|
101
|
+
case phoneNumber = "phone_number"
|
|
102
|
+
case description
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
public struct FieldItem: Codable {
|
|
106
|
+
public let name: String
|
|
107
|
+
public let required: Bool
|
|
108
|
+
public var value: String
|
|
109
|
+
|
|
110
|
+
// Overloaded initializer for BillingFieldName
|
|
111
|
+
public init(name: BillingFieldName, required: Bool, value: String) {
|
|
112
|
+
self.name = name.rawValue
|
|
113
|
+
self.required = required
|
|
114
|
+
self.value = value
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// Overloaded initializer for AdditionalFieldName
|
|
118
|
+
public init(name: AdditionalFieldName, required: Bool, value: String) {
|
|
119
|
+
self.name = name.rawValue
|
|
120
|
+
self.required = required
|
|
121
|
+
self.value = value
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
public struct FieldsVisibility: Codable {
|
|
126
|
+
public let billing: Bool
|
|
127
|
+
public let additional: Bool
|
|
128
|
+
|
|
129
|
+
public init(billing: Bool, additional: Bool) {
|
|
130
|
+
self.billing = billing
|
|
131
|
+
self.additional = additional
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
public struct FieldSection: Codable {
|
|
136
|
+
public let visibility: FieldsVisibility
|
|
137
|
+
public var billing: [FieldItem]
|
|
138
|
+
public var additional: [FieldItem]
|
|
139
|
+
|
|
140
|
+
public init(visibility: FieldsVisibility, billing: [FieldItem], additional: [FieldItem]) {
|
|
141
|
+
self.visibility = visibility
|
|
142
|
+
self.billing = billing
|
|
143
|
+
self.additional = additional
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
84
147
|
@objc
|
|
85
148
|
public final class Request: NSObject {
|
|
86
|
-
public let amount: Double
|
|
149
|
+
public let amount: Double?
|
|
150
|
+
public let currency: String?
|
|
87
151
|
public let billingInfoData: Data?
|
|
88
|
-
let themeConfiguration: ThemeConfiguration?
|
|
89
|
-
let selectedPaymentMethods: [PaymentMethod]
|
|
90
|
-
|
|
91
|
-
// New parameters
|
|
152
|
+
public let themeConfiguration: ThemeConfiguration?
|
|
153
|
+
public let selectedPaymentMethods: [PaymentMethod]
|
|
92
154
|
public let tokenOnly: Bool?
|
|
93
155
|
public let saveCard: Bool?
|
|
94
156
|
public let saveAccount: Bool?
|
|
@@ -99,10 +161,16 @@ public final class Request: NSObject {
|
|
|
99
161
|
public var recurringIntervals: [RecurringIntervals]?
|
|
100
162
|
public var recurringStartDateType: RecurringStartDateType?
|
|
101
163
|
public var recurringStartDate: String?
|
|
102
|
-
public let
|
|
103
|
-
|
|
164
|
+
public let secureAuthentication: Bool?
|
|
165
|
+
public let showReceipt: Bool?
|
|
166
|
+
public let showTotal: Bool?
|
|
167
|
+
public let showSubmitButton: Bool?
|
|
168
|
+
public let referenceID: Bool?
|
|
169
|
+
public let referenceToken: String?
|
|
170
|
+
|
|
104
171
|
public init(
|
|
105
|
-
amount: Double,
|
|
172
|
+
amount: Double? = nil,
|
|
173
|
+
currency: String? = nil,
|
|
106
174
|
billingInfoData: Data? = nil,
|
|
107
175
|
paymentMethods: [PaymentMethod]? = nil,
|
|
108
176
|
themeConfiguration: ThemeConfiguration? = nil,
|
|
@@ -116,9 +184,36 @@ public final class Request: NSObject {
|
|
|
116
184
|
recurringIntervals: [RecurringIntervals]? = nil,
|
|
117
185
|
recurringStartDateType: RecurringStartDateType? = nil,
|
|
118
186
|
recurringStartDate: String? = nil,
|
|
119
|
-
|
|
187
|
+
secureAuthentication: Bool = false,
|
|
188
|
+
showReceipt: Bool = false,
|
|
189
|
+
showTotal: Bool = false,
|
|
190
|
+
showSubmitButton: Bool = false,
|
|
191
|
+
referenceID: Bool = false,
|
|
192
|
+
referenceToken: String? = nil
|
|
120
193
|
) {
|
|
194
|
+
|
|
195
|
+
// Validate if amount is provided, must be ≥ 0.50
|
|
196
|
+
if let amt = amount, amt < 0.50 {
|
|
197
|
+
DispatchQueue.main.async {
|
|
198
|
+
if let topVC = UIApplication.topViewController() {
|
|
199
|
+
let alert = UIAlertController(title: "Invalid Amount",
|
|
200
|
+
message: "Amount must be at least $0.50.",
|
|
201
|
+
preferredStyle: .alert)
|
|
202
|
+
alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { _ in
|
|
203
|
+
if let easyPayVC = UIApplication.findEasyPayViewController(from: topVC) {
|
|
204
|
+
easyPayVC.dismiss(animated: true)
|
|
205
|
+
} else {
|
|
206
|
+
// fallback: dismiss topVC itself if it's presented modally
|
|
207
|
+
topVC.dismiss(animated: true)
|
|
208
|
+
}
|
|
209
|
+
}))
|
|
210
|
+
topVC.present(alert, animated: true)
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
121
215
|
self.amount = amount
|
|
216
|
+
self.currency = currency
|
|
122
217
|
self.billingInfoData = billingInfoData
|
|
123
218
|
self.themeConfiguration = themeConfiguration
|
|
124
219
|
self.tokenOnly = tokenOnly
|
|
@@ -131,7 +226,12 @@ public final class Request: NSObject {
|
|
|
131
226
|
self.recurringIntervals = recurringIntervals
|
|
132
227
|
self.recurringStartDateType = recurringStartDateType
|
|
133
228
|
self.recurringStartDate = recurringStartDate
|
|
134
|
-
self.
|
|
229
|
+
self.secureAuthentication = secureAuthentication
|
|
230
|
+
self.showReceipt = showReceipt
|
|
231
|
+
self.showTotal = showTotal
|
|
232
|
+
self.showSubmitButton = showSubmitButton
|
|
233
|
+
self.referenceID = referenceID
|
|
234
|
+
self.referenceToken = referenceToken
|
|
135
235
|
|
|
136
236
|
// Conditionally assign recurring fields only if is_recurring == true
|
|
137
237
|
if is_recurring {
|
|
@@ -186,12 +286,19 @@ public final class Request: NSObject {
|
|
|
186
286
|
self.paymentIntentApi { success in
|
|
187
287
|
if success {
|
|
188
288
|
print("Payment Intent API call succeeded")
|
|
189
|
-
UserStoreSingleton.shared.price = String(self.amount)
|
|
289
|
+
UserStoreSingleton.shared.price = String(self.amount ?? 0)
|
|
190
290
|
print("Saved amount: \(UserStoreSingleton.shared.price ?? "No amount")")
|
|
191
291
|
}
|
|
192
292
|
}
|
|
193
293
|
}
|
|
194
294
|
|
|
295
|
+
if referenceID == true {
|
|
296
|
+
fetchReferenceData { response in
|
|
297
|
+
DispatchQueue.main.async {
|
|
298
|
+
NotificationCenter.default.post(name: NSNotification.Name("ReferenceIDResponse"), object: response)
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
195
302
|
}
|
|
196
303
|
|
|
197
304
|
//MARK: - Payment Intent Api
|
|
@@ -239,7 +346,7 @@ public final class Request: NSObject {
|
|
|
239
346
|
}
|
|
240
347
|
|
|
241
348
|
let params: [String: Any] = [
|
|
242
|
-
"amount": amount,
|
|
349
|
+
"amount": amount ?? 0,
|
|
243
350
|
"allowed_cycles": String(recurringIntervals?.count ?? 0),
|
|
244
351
|
"intervals": recurringIntervals?.map { $0.rawValue } ?? [],
|
|
245
352
|
"is_recurring": self.is_recurring ?? false,
|
|
@@ -332,7 +439,7 @@ public final class Request: NSObject {
|
|
|
332
439
|
request.addValue(UserStoreSingleton.shared.clientToken ?? "", forHTTPHeaderField: "clientToken")
|
|
333
440
|
|
|
334
441
|
let params: [String: Any] = [
|
|
335
|
-
"amount": amount,
|
|
442
|
+
"amount": amount ?? 0,
|
|
336
443
|
]
|
|
337
444
|
|
|
338
445
|
do {
|
|
@@ -440,6 +547,61 @@ public final class Request: NSObject {
|
|
|
440
547
|
task.resume()
|
|
441
548
|
}
|
|
442
549
|
|
|
550
|
+
// MARK: - GET Transaction Status API
|
|
551
|
+
private func fetchReferenceData(completion: @escaping ([String: Any]?) -> Void) {
|
|
552
|
+
let urlString = EnvironmentConfig.baseURL + EnvironmentConfig.Endpoints.threeDSecureStatus(referenceToken ?? "").path()
|
|
553
|
+
print("Final 3DS status URL: \(urlString)")
|
|
554
|
+
|
|
555
|
+
guard let url = URL(string: urlString) else {
|
|
556
|
+
print("Invalid URL")
|
|
557
|
+
completion(nil)
|
|
558
|
+
return
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
var uRLRequest = URLRequest(url: url)
|
|
562
|
+
uRLRequest.httpMethod = "GET"
|
|
563
|
+
uRLRequest.addValue("application/json", forHTTPHeaderField: "Content-Type")
|
|
564
|
+
|
|
565
|
+
let token = UserStoreSingleton.shared.customerToken
|
|
566
|
+
print("Setting customerToken header: \(token ?? "None")")
|
|
567
|
+
uRLRequest.addValue(token ?? "", forHTTPHeaderField: "Customer-Token")
|
|
568
|
+
|
|
569
|
+
// Add API key/secret headers
|
|
570
|
+
if let apiKey = EnvironmentConfig.apiKey,
|
|
571
|
+
let apiSecret = EnvironmentConfig.apiSecret {
|
|
572
|
+
uRLRequest.addValue(apiKey, forHTTPHeaderField: "x-api-key")
|
|
573
|
+
uRLRequest.addValue(apiSecret, forHTTPHeaderField: "x-api-secret")
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
let task = URLSession.shared.dataTask(with: uRLRequest) { data, response, error in
|
|
577
|
+
if let error = error {
|
|
578
|
+
print("3DS status check error:", error.localizedDescription)
|
|
579
|
+
completion(nil)
|
|
580
|
+
return
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
guard let data = data else {
|
|
584
|
+
print("No data in response")
|
|
585
|
+
completion(nil)
|
|
586
|
+
return
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
do {
|
|
590
|
+
if let json = try JSONSerialization.jsonObject(with: data) as? [String: Any] {
|
|
591
|
+
print("3DS status response:", json)
|
|
592
|
+
completion(json) // pass result
|
|
593
|
+
} else {
|
|
594
|
+
completion(nil)
|
|
595
|
+
}
|
|
596
|
+
} catch {
|
|
597
|
+
print("Error parsing JSON:", error.localizedDescription)
|
|
598
|
+
completion(nil)
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
task.resume()
|
|
603
|
+
}
|
|
604
|
+
|
|
443
605
|
}
|
|
444
606
|
|
|
445
607
|
extension DateFormatter {
|
package/ios/Models/Result.swift
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Result.swift
|
|
3
|
+
// EasyPay
|
|
4
|
+
//
|
|
5
|
+
// Created by iftekhar on 14/07/24.
|
|
6
|
+
//
|
|
7
|
+
|
|
1
8
|
import UIKit
|
|
2
9
|
|
|
3
10
|
@objc
|
|
@@ -9,14 +16,14 @@ public enum ResultType: Int {
|
|
|
9
16
|
|
|
10
17
|
@objc
|
|
11
18
|
public final class Result: NSObject {
|
|
12
|
-
|
|
19
|
+
|
|
13
20
|
@objc public let type: ResultType
|
|
14
21
|
@objc public let error: NSError?
|
|
15
22
|
@objc public let chargeData: [String: Any]?
|
|
16
|
-
|
|
23
|
+
|
|
17
24
|
@objc public let billingInfo: [String: Any]?
|
|
18
25
|
@objc public let additionalInfo: [String: Any]?
|
|
19
|
-
|
|
26
|
+
|
|
20
27
|
// Initializer for error type result
|
|
21
28
|
internal init(error: NSError) {
|
|
22
29
|
self.type = .error
|
|
@@ -26,7 +33,7 @@ public final class Result: NSObject {
|
|
|
26
33
|
self.additionalInfo = nil
|
|
27
34
|
super.init()
|
|
28
35
|
}
|
|
29
|
-
|
|
36
|
+
|
|
30
37
|
// Initializer for success/cancelled result types
|
|
31
38
|
internal init(type: ResultType,
|
|
32
39
|
chargeData: [String: Any]? = nil,
|
|
@@ -39,4 +46,4 @@ public final class Result: NSObject {
|
|
|
39
46
|
self.additionalInfo = additionalInfo
|
|
40
47
|
super.init()
|
|
41
48
|
}
|
|
42
|
-
}
|
|
49
|
+
}
|