vialink-react-native-sdk 2.0.14 → 2.1.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/android/src/main/java/com/vialink/reactnative/ViaLinkModule.kt +57 -1
- package/dist/ViaLinkSDK.d.ts +50 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/ios/Frameworks/ViaLinkCore.xcframework/Info.plist +5 -5
- package/ios/Frameworks/ViaLinkCore.xcframework/ios-arm64/ViaLinkCore.framework/Info.plist +0 -0
- package/ios/Frameworks/ViaLinkCore.xcframework/ios-arm64/ViaLinkCore.framework/Modules/ViaLinkCore.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
- package/ios/Frameworks/ViaLinkCore.xcframework/ios-arm64/ViaLinkCore.framework/Modules/ViaLinkCore.swiftmodule/arm64-apple-ios.abi.json +1160 -1
- package/ios/Frameworks/ViaLinkCore.xcframework/ios-arm64/ViaLinkCore.framework/Modules/ViaLinkCore.swiftmodule/arm64-apple-ios.package.swiftinterface +34 -2
- package/ios/Frameworks/ViaLinkCore.xcframework/ios-arm64/ViaLinkCore.framework/Modules/ViaLinkCore.swiftmodule/arm64-apple-ios.private.swiftinterface +34 -2
- package/ios/Frameworks/ViaLinkCore.xcframework/ios-arm64/ViaLinkCore.framework/Modules/ViaLinkCore.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/Frameworks/ViaLinkCore.xcframework/ios-arm64/ViaLinkCore.framework/Modules/ViaLinkCore.swiftmodule/arm64-apple-ios.swiftinterface +34 -2
- package/ios/Frameworks/ViaLinkCore.xcframework/ios-arm64/ViaLinkCore.framework/ViaLinkCore +0 -0
- package/ios/Frameworks/ViaLinkCore.xcframework/ios-arm64_x86_64-simulator/ViaLinkCore.framework/Info.plist +0 -0
- package/ios/Frameworks/ViaLinkCore.xcframework/ios-arm64_x86_64-simulator/ViaLinkCore.framework/Modules/ViaLinkCore.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
- package/ios/Frameworks/ViaLinkCore.xcframework/ios-arm64_x86_64-simulator/ViaLinkCore.framework/Modules/ViaLinkCore.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
- package/ios/Frameworks/ViaLinkCore.xcframework/ios-arm64_x86_64-simulator/ViaLinkCore.framework/Modules/ViaLinkCore.swiftmodule/arm64-apple-ios-simulator.abi.json +1160 -1
- package/ios/Frameworks/ViaLinkCore.xcframework/ios-arm64_x86_64-simulator/ViaLinkCore.framework/Modules/ViaLinkCore.swiftmodule/arm64-apple-ios-simulator.package.swiftinterface +34 -2
- package/ios/Frameworks/ViaLinkCore.xcframework/ios-arm64_x86_64-simulator/ViaLinkCore.framework/Modules/ViaLinkCore.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +34 -2
- package/ios/Frameworks/ViaLinkCore.xcframework/ios-arm64_x86_64-simulator/ViaLinkCore.framework/Modules/ViaLinkCore.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/Frameworks/ViaLinkCore.xcframework/ios-arm64_x86_64-simulator/ViaLinkCore.framework/Modules/ViaLinkCore.swiftmodule/arm64-apple-ios-simulator.swiftinterface +34 -2
- package/ios/Frameworks/ViaLinkCore.xcframework/ios-arm64_x86_64-simulator/ViaLinkCore.framework/Modules/ViaLinkCore.swiftmodule/x86_64-apple-ios-simulator.abi.json +1160 -1
- package/ios/Frameworks/ViaLinkCore.xcframework/ios-arm64_x86_64-simulator/ViaLinkCore.framework/Modules/ViaLinkCore.swiftmodule/x86_64-apple-ios-simulator.package.swiftinterface +34 -2
- package/ios/Frameworks/ViaLinkCore.xcframework/ios-arm64_x86_64-simulator/ViaLinkCore.framework/Modules/ViaLinkCore.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +34 -2
- package/ios/Frameworks/ViaLinkCore.xcframework/ios-arm64_x86_64-simulator/ViaLinkCore.framework/Modules/ViaLinkCore.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/Frameworks/ViaLinkCore.xcframework/ios-arm64_x86_64-simulator/ViaLinkCore.framework/Modules/ViaLinkCore.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +34 -2
- package/ios/Frameworks/ViaLinkCore.xcframework/ios-arm64_x86_64-simulator/ViaLinkCore.framework/ViaLinkCore +0 -0
- package/ios/Frameworks/ViaLinkCore.xcframework/ios-arm64_x86_64-simulator/ViaLinkCore.framework/_CodeSignature/CodeResources +1 -1
- package/ios/ViaLinkModule.m +4 -0
- package/ios/ViaLinkModule.swift +51 -2
- package/package.json +1 -1
- package/vialink-react-native-sdk.podspec +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// swift-interface-format-version: 1.0
|
|
2
|
-
// swift-compiler-version: Apple Swift version 6.3 effective-5.10 (swiftlang-6.3.
|
|
2
|
+
// swift-compiler-version: Apple Swift version 6.3.1 effective-5.10 (swiftlang-6.3.1.1.2 clang-2100.0.123.102)
|
|
3
3
|
// swift-module-flags: -target x86_64-apple-ios15.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -O -enable-experimental-feature DebugDescriptionMacro -module-name ViaLinkCore -package-name vialink_ios_sdk
|
|
4
|
-
// swift-module-flags-ignorable: -formal-cxx-interoperability-mode=off -interface-compiler-version 6.3
|
|
4
|
+
// swift-module-flags-ignorable: -formal-cxx-interoperability-mode=off -interface-compiler-version 6.3.1
|
|
5
5
|
import CoreTelephony
|
|
6
6
|
import Foundation
|
|
7
7
|
import Network
|
|
@@ -16,6 +16,32 @@ public struct DeepLinkData : Swift.Sendable {
|
|
|
16
16
|
public let shortCode: Swift.String?
|
|
17
17
|
public init(path: Swift.String, params: [Swift.String : Swift.String] = [:], shortCode: Swift.String? = nil)
|
|
18
18
|
}
|
|
19
|
+
public struct PaymentInitiatedArgs : Swift.Sendable {
|
|
20
|
+
public let orderId: Swift.String
|
|
21
|
+
public let amount: Swift.Double
|
|
22
|
+
public let currency: Swift.String
|
|
23
|
+
public let linkId: Swift.Int?
|
|
24
|
+
public let paymentMethod: Swift.String?
|
|
25
|
+
public let metadata: [Swift.String : Swift.String]?
|
|
26
|
+
public init(orderId: Swift.String, amount: Swift.Double, currency: Swift.String, linkId: Swift.Int? = nil, paymentMethod: Swift.String? = nil, metadata: [Swift.String : Swift.String]? = nil)
|
|
27
|
+
}
|
|
28
|
+
public struct PaymentInitiatedResult : Swift.Sendable {
|
|
29
|
+
public let success: Swift.Bool
|
|
30
|
+
public let paymentEventId: Swift.String
|
|
31
|
+
public init(success: Swift.Bool, paymentEventId: Swift.String)
|
|
32
|
+
}
|
|
33
|
+
public enum PaymentError : Swift.Error, Foundation.LocalizedError, Swift.Sendable, Swift.Equatable {
|
|
34
|
+
case invalidOrderId
|
|
35
|
+
case invalidAmount
|
|
36
|
+
case invalidCurrency
|
|
37
|
+
case sdkNotInitialized
|
|
38
|
+
case invalidResponse
|
|
39
|
+
case networkFailure(Swift.String)
|
|
40
|
+
public var errorDescription: Swift.String? {
|
|
41
|
+
get
|
|
42
|
+
}
|
|
43
|
+
public static func == (lhs: ViaLinkCore.PaymentError, rhs: ViaLinkCore.PaymentError) -> Swift.Bool
|
|
44
|
+
}
|
|
19
45
|
@_hasMissingDesignatedInitializers final public class ViaLinkSDK : @unchecked Swift.Sendable {
|
|
20
46
|
public static let sdkVersion: Swift.String
|
|
21
47
|
public static let shared: ViaLinkCore.ViaLinkSDK
|
|
@@ -41,6 +67,12 @@ public struct DeepLinkData : Swift.Sendable {
|
|
|
41
67
|
get
|
|
42
68
|
}
|
|
43
69
|
}
|
|
70
|
+
final public var payment: ViaLinkCore.ViaLinkSDK.PaymentAPI {
|
|
71
|
+
get
|
|
72
|
+
}
|
|
73
|
+
public struct PaymentAPI {
|
|
74
|
+
public func initiated(_ args: ViaLinkCore.PaymentInitiatedArgs) async throws -> ViaLinkCore.PaymentInitiatedResult
|
|
75
|
+
}
|
|
44
76
|
@objc deinit
|
|
45
77
|
}
|
|
46
78
|
extension ViaLinkCore.ViaLinkSDK.CreateLinkError : Swift.Equatable {}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// swift-interface-format-version: 1.0
|
|
2
|
-
// swift-compiler-version: Apple Swift version 6.3 effective-5.10 (swiftlang-6.3.
|
|
2
|
+
// swift-compiler-version: Apple Swift version 6.3.1 effective-5.10 (swiftlang-6.3.1.1.2 clang-2100.0.123.102)
|
|
3
3
|
// swift-module-flags: -target x86_64-apple-ios15.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -O -enable-experimental-feature DebugDescriptionMacro -module-name ViaLinkCore -package-name vialink_ios_sdk
|
|
4
|
-
// swift-module-flags-ignorable: -formal-cxx-interoperability-mode=off -interface-compiler-version 6.3
|
|
4
|
+
// swift-module-flags-ignorable: -formal-cxx-interoperability-mode=off -interface-compiler-version 6.3.1
|
|
5
5
|
import CoreTelephony
|
|
6
6
|
import Foundation
|
|
7
7
|
import Network
|
|
@@ -16,6 +16,32 @@ public struct DeepLinkData : Swift.Sendable {
|
|
|
16
16
|
public let shortCode: Swift.String?
|
|
17
17
|
public init(path: Swift.String, params: [Swift.String : Swift.String] = [:], shortCode: Swift.String? = nil)
|
|
18
18
|
}
|
|
19
|
+
public struct PaymentInitiatedArgs : Swift.Sendable {
|
|
20
|
+
public let orderId: Swift.String
|
|
21
|
+
public let amount: Swift.Double
|
|
22
|
+
public let currency: Swift.String
|
|
23
|
+
public let linkId: Swift.Int?
|
|
24
|
+
public let paymentMethod: Swift.String?
|
|
25
|
+
public let metadata: [Swift.String : Swift.String]?
|
|
26
|
+
public init(orderId: Swift.String, amount: Swift.Double, currency: Swift.String, linkId: Swift.Int? = nil, paymentMethod: Swift.String? = nil, metadata: [Swift.String : Swift.String]? = nil)
|
|
27
|
+
}
|
|
28
|
+
public struct PaymentInitiatedResult : Swift.Sendable {
|
|
29
|
+
public let success: Swift.Bool
|
|
30
|
+
public let paymentEventId: Swift.String
|
|
31
|
+
public init(success: Swift.Bool, paymentEventId: Swift.String)
|
|
32
|
+
}
|
|
33
|
+
public enum PaymentError : Swift.Error, Foundation.LocalizedError, Swift.Sendable, Swift.Equatable {
|
|
34
|
+
case invalidOrderId
|
|
35
|
+
case invalidAmount
|
|
36
|
+
case invalidCurrency
|
|
37
|
+
case sdkNotInitialized
|
|
38
|
+
case invalidResponse
|
|
39
|
+
case networkFailure(Swift.String)
|
|
40
|
+
public var errorDescription: Swift.String? {
|
|
41
|
+
get
|
|
42
|
+
}
|
|
43
|
+
public static func == (lhs: ViaLinkCore.PaymentError, rhs: ViaLinkCore.PaymentError) -> Swift.Bool
|
|
44
|
+
}
|
|
19
45
|
@_hasMissingDesignatedInitializers final public class ViaLinkSDK : @unchecked Swift.Sendable {
|
|
20
46
|
public static let sdkVersion: Swift.String
|
|
21
47
|
public static let shared: ViaLinkCore.ViaLinkSDK
|
|
@@ -41,6 +67,12 @@ public struct DeepLinkData : Swift.Sendable {
|
|
|
41
67
|
get
|
|
42
68
|
}
|
|
43
69
|
}
|
|
70
|
+
final public var payment: ViaLinkCore.ViaLinkSDK.PaymentAPI {
|
|
71
|
+
get
|
|
72
|
+
}
|
|
73
|
+
public struct PaymentAPI {
|
|
74
|
+
public func initiated(_ args: ViaLinkCore.PaymentInitiatedArgs) async throws -> ViaLinkCore.PaymentInitiatedResult
|
|
75
|
+
}
|
|
44
76
|
@objc deinit
|
|
45
77
|
}
|
|
46
78
|
extension ViaLinkCore.ViaLinkSDK.CreateLinkError : Swift.Equatable {}
|
|
Binary file
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// swift-interface-format-version: 1.0
|
|
2
|
-
// swift-compiler-version: Apple Swift version 6.3 effective-5.10 (swiftlang-6.3.
|
|
2
|
+
// swift-compiler-version: Apple Swift version 6.3.1 effective-5.10 (swiftlang-6.3.1.1.2 clang-2100.0.123.102)
|
|
3
3
|
// swift-module-flags: -target x86_64-apple-ios15.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -O -enable-experimental-feature DebugDescriptionMacro -module-name ViaLinkCore -package-name vialink_ios_sdk
|
|
4
|
-
// swift-module-flags-ignorable: -formal-cxx-interoperability-mode=off -interface-compiler-version 6.3
|
|
4
|
+
// swift-module-flags-ignorable: -formal-cxx-interoperability-mode=off -interface-compiler-version 6.3.1
|
|
5
5
|
import CoreTelephony
|
|
6
6
|
import Foundation
|
|
7
7
|
import Network
|
|
@@ -16,6 +16,32 @@ public struct DeepLinkData : Swift.Sendable {
|
|
|
16
16
|
public let shortCode: Swift.String?
|
|
17
17
|
public init(path: Swift.String, params: [Swift.String : Swift.String] = [:], shortCode: Swift.String? = nil)
|
|
18
18
|
}
|
|
19
|
+
public struct PaymentInitiatedArgs : Swift.Sendable {
|
|
20
|
+
public let orderId: Swift.String
|
|
21
|
+
public let amount: Swift.Double
|
|
22
|
+
public let currency: Swift.String
|
|
23
|
+
public let linkId: Swift.Int?
|
|
24
|
+
public let paymentMethod: Swift.String?
|
|
25
|
+
public let metadata: [Swift.String : Swift.String]?
|
|
26
|
+
public init(orderId: Swift.String, amount: Swift.Double, currency: Swift.String, linkId: Swift.Int? = nil, paymentMethod: Swift.String? = nil, metadata: [Swift.String : Swift.String]? = nil)
|
|
27
|
+
}
|
|
28
|
+
public struct PaymentInitiatedResult : Swift.Sendable {
|
|
29
|
+
public let success: Swift.Bool
|
|
30
|
+
public let paymentEventId: Swift.String
|
|
31
|
+
public init(success: Swift.Bool, paymentEventId: Swift.String)
|
|
32
|
+
}
|
|
33
|
+
public enum PaymentError : Swift.Error, Foundation.LocalizedError, Swift.Sendable, Swift.Equatable {
|
|
34
|
+
case invalidOrderId
|
|
35
|
+
case invalidAmount
|
|
36
|
+
case invalidCurrency
|
|
37
|
+
case sdkNotInitialized
|
|
38
|
+
case invalidResponse
|
|
39
|
+
case networkFailure(Swift.String)
|
|
40
|
+
public var errorDescription: Swift.String? {
|
|
41
|
+
get
|
|
42
|
+
}
|
|
43
|
+
public static func == (lhs: ViaLinkCore.PaymentError, rhs: ViaLinkCore.PaymentError) -> Swift.Bool
|
|
44
|
+
}
|
|
19
45
|
@_hasMissingDesignatedInitializers final public class ViaLinkSDK : @unchecked Swift.Sendable {
|
|
20
46
|
public static let sdkVersion: Swift.String
|
|
21
47
|
public static let shared: ViaLinkCore.ViaLinkSDK
|
|
@@ -41,6 +67,12 @@ public struct DeepLinkData : Swift.Sendable {
|
|
|
41
67
|
get
|
|
42
68
|
}
|
|
43
69
|
}
|
|
70
|
+
final public var payment: ViaLinkCore.ViaLinkSDK.PaymentAPI {
|
|
71
|
+
get
|
|
72
|
+
}
|
|
73
|
+
public struct PaymentAPI {
|
|
74
|
+
public func initiated(_ args: ViaLinkCore.PaymentInitiatedArgs) async throws -> ViaLinkCore.PaymentInitiatedResult
|
|
75
|
+
}
|
|
44
76
|
@objc deinit
|
|
45
77
|
}
|
|
46
78
|
extension ViaLinkCore.ViaLinkSDK.CreateLinkError : Swift.Equatable {}
|
|
Binary file
|
package/ios/ViaLinkModule.m
CHANGED
|
@@ -16,4 +16,8 @@ RCT_EXTERN_METHOD(createLink:(NSString *)path
|
|
|
16
16
|
resolve:(RCTPromiseResolveBlock)resolve
|
|
17
17
|
reject:(RCTPromiseRejectBlock)reject)
|
|
18
18
|
|
|
19
|
+
RCT_EXTERN_METHOD(paymentInitiated:(NSDictionary *)args
|
|
20
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
21
|
+
reject:(RCTPromiseRejectBlock)reject)
|
|
22
|
+
|
|
19
23
|
@end
|
package/ios/ViaLinkModule.swift
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import Foundation
|
|
2
2
|
import React
|
|
3
|
-
import
|
|
3
|
+
import ViaLinkCore // xcframework module: ViaLinkCore (class: ViaLinkSDK)
|
|
4
4
|
|
|
5
5
|
@objc(ViaLinkSDK)
|
|
6
6
|
class ViaLinkModule: RCTEventEmitter {
|
|
7
7
|
|
|
8
|
-
static let wrapperVersion = "2.0
|
|
8
|
+
static let wrapperVersion = "2.1.0"
|
|
9
9
|
|
|
10
10
|
private var pendingDeepLink: [String: Any?]?
|
|
11
11
|
private var pendingDeferred: [String: Any?]?
|
|
@@ -76,6 +76,55 @@ class ViaLinkModule: RCTEventEmitter {
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
+
|
|
80
|
+
/// 결제 시도 이벤트를 native iOS SDK(ViaLinkSDK.shared.payment.initiated)로 전달.
|
|
81
|
+
/// args: { orderId, amount, currency, linkId?, paymentMethod?, metadata? }
|
|
82
|
+
/// resolve: { success: Bool, paymentEventId: String }
|
|
83
|
+
@objc func paymentInitiated(_ args: NSDictionary,
|
|
84
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
85
|
+
reject: @escaping RCTPromiseRejectBlock) {
|
|
86
|
+
guard let orderId = args["orderId"] as? String, !orderId.isEmpty else {
|
|
87
|
+
reject("E_INVALID_ARG", "orderId가 필요합니다.", nil)
|
|
88
|
+
return
|
|
89
|
+
}
|
|
90
|
+
guard let amountValue = args["amount"] as? NSNumber else {
|
|
91
|
+
reject("E_INVALID_ARG", "amount가 필요합니다.", nil)
|
|
92
|
+
return
|
|
93
|
+
}
|
|
94
|
+
guard let currency = args["currency"] as? String, !currency.isEmpty else {
|
|
95
|
+
reject("E_INVALID_ARG", "currency가 필요합니다.", nil)
|
|
96
|
+
return
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
let linkId = args["linkId"] as? Int
|
|
100
|
+
let paymentMethod = args["paymentMethod"] as? String
|
|
101
|
+
let metadata = args["metadata"] as? [String: String]
|
|
102
|
+
|
|
103
|
+
let payArgs = PaymentInitiatedArgs(
|
|
104
|
+
orderId: orderId,
|
|
105
|
+
amount: amountValue.doubleValue,
|
|
106
|
+
currency: currency,
|
|
107
|
+
linkId: linkId,
|
|
108
|
+
paymentMethod: paymentMethod,
|
|
109
|
+
metadata: metadata
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
Task {
|
|
113
|
+
do {
|
|
114
|
+
let result = try await ViaLinkSDK.shared.payment.initiated(payArgs)
|
|
115
|
+
DispatchQueue.main.async {
|
|
116
|
+
resolve([
|
|
117
|
+
"success": result.success,
|
|
118
|
+
"paymentEventId": result.paymentEventId,
|
|
119
|
+
])
|
|
120
|
+
}
|
|
121
|
+
} catch {
|
|
122
|
+
DispatchQueue.main.async {
|
|
123
|
+
reject("E_PAYMENT_FAILED", error.localizedDescription, error)
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
79
128
|
}
|
|
80
129
|
|
|
81
130
|
extension DeepLinkData {
|
package/package.json
CHANGED