react-native-pos-pagseguro 1.0.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/LICENSE +20 -0
- package/PosPagseguro.podspec +29 -0
- package/README.md +193 -0
- package/android/CMakeLists.txt +24 -0
- package/android/build.gradle +132 -0
- package/android/gradle.properties +5 -0
- package/android/libs/wrapper-1.30.52.aar +0 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/cpp/cpp-adapter.cpp +6 -0
- package/android/src/main/java/com/margelo/nitro/pospagseguro/PosPagseguro.kt +251 -0
- package/android/src/main/java/com/margelo/nitro/pospagseguro/PosPagseguroPackage.kt +23 -0
- package/android/src/main/java/com/margelo/nitro/pospagseguro/maps/SubAcquirer.kt +23 -0
- package/android/src/main/java/com/margelo/nitro/pospagseguro/maps/TransactionResult.kt +53 -0
- package/android/src/main/java/com/margelo/nitro/pospagseguro/maps/Userdata.kt +17 -0
- package/ios/PosPagseguro.swift +5 -0
- package/lib/module/PosPagseguro.nitro.js +4 -0
- package/lib/module/PosPagseguro.nitro.js.map +1 -0
- package/lib/module/index.js +7 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/pag_seguro.js +290 -0
- package/lib/module/pag_seguro.js.map +1 -0
- package/lib/module/types/device.js +71 -0
- package/lib/module/types/device.js.map +1 -0
- package/lib/module/types/exceptions.js +16 -0
- package/lib/module/types/exceptions.js.map +1 -0
- package/lib/module/types/payments.js +84 -0
- package/lib/module/types/payments.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/PosPagseguro.nitro.d.ts +27 -0
- package/lib/typescript/src/PosPagseguro.nitro.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +7 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/pag_seguro.d.ts +188 -0
- package/lib/typescript/src/pag_seguro.d.ts.map +1 -0
- package/lib/typescript/src/types/device.d.ts +92 -0
- package/lib/typescript/src/types/device.d.ts.map +1 -0
- package/lib/typescript/src/types/exceptions.d.ts +16 -0
- package/lib/typescript/src/types/exceptions.d.ts.map +1 -0
- package/lib/typescript/src/types/payments.d.ts +205 -0
- package/lib/typescript/src/types/payments.d.ts.map +1 -0
- package/nitro.json +16 -0
- package/nitrogen/generated/android/c++/JCapabilities.hpp +100 -0
- package/nitrogen/generated/android/c++/JCardIssuerNationality.hpp +61 -0
- package/nitrogen/generated/android/c++/JCustomError.hpp +61 -0
- package/nitrogen/generated/android/c++/JFunc_void_std__string.hpp +76 -0
- package/nitrogen/generated/android/c++/JHybridPosPagseguroSpec.cpp +248 -0
- package/nitrogen/generated/android/c++/JHybridPosPagseguroSpec.hpp +81 -0
- package/nitrogen/generated/android/c++/JInstallmentTypes.hpp +61 -0
- package/nitrogen/generated/android/c++/JPaymentData.hpp +81 -0
- package/nitrogen/generated/android/c++/JPaymentTypes.hpp +64 -0
- package/nitrogen/generated/android/c++/JSubAcquirer.hpp +101 -0
- package/nitrogen/generated/android/c++/JTransactionResult.hpp +208 -0
- package/nitrogen/generated/android/c++/JUserData.hpp +86 -0
- package/nitrogen/generated/android/c++/JVariant_CustomError_TransactionResult.cpp +26 -0
- package/nitrogen/generated/android/c++/JVariant_CustomError_TransactionResult.hpp +75 -0
- package/nitrogen/generated/android/c++/JVariant_Double_CustomError.cpp +26 -0
- package/nitrogen/generated/android/c++/JVariant_Double_CustomError.hpp +70 -0
- package/nitrogen/generated/android/c++/JVoidPayData.hpp +72 -0
- package/nitrogen/generated/android/c++/JVoidType.hpp +58 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pospagseguro/Capabilities.kt +37 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pospagseguro/CardIssuerNationality.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pospagseguro/CustomError.kt +41 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pospagseguro/Func_void_std__string.kt +80 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pospagseguro/HybridPosPagseguroSpec.kt +132 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pospagseguro/InstallmentTypes.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pospagseguro/PaymentData.kt +53 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pospagseguro/PaymentTypes.kt +25 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pospagseguro/SubAcquirer.kt +71 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pospagseguro/TransactionResult.kt +149 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pospagseguro/UserData.kt +59 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pospagseguro/Variant_CustomError_TransactionResult.kt +59 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pospagseguro/Variant_Double_CustomError.kt +59 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pospagseguro/VoidPayData.kt +47 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pospagseguro/VoidType.kt +23 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/pospagseguro/pospagseguroOnLoad.kt +35 -0
- package/nitrogen/generated/android/pospagseguro+autolinking.cmake +83 -0
- package/nitrogen/generated/android/pospagseguro+autolinking.gradle +27 -0
- package/nitrogen/generated/android/pospagseguroOnLoad.cpp +46 -0
- package/nitrogen/generated/android/pospagseguroOnLoad.hpp +25 -0
- package/nitrogen/generated/ios/PosPagseguro+autolinking.rb +60 -0
- package/nitrogen/generated/ios/PosPagseguro-Swift-Cxx-Bridge.cpp +65 -0
- package/nitrogen/generated/ios/PosPagseguro-Swift-Cxx-Bridge.hpp +422 -0
- package/nitrogen/generated/ios/PosPagseguro-Swift-Cxx-Umbrella.hpp +81 -0
- package/nitrogen/generated/ios/c++/HybridPosPagseguroSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridPosPagseguroSpecSwift.hpp +236 -0
- package/nitrogen/generated/ios/swift/Capabilities.swift +96 -0
- package/nitrogen/generated/ios/swift/CardIssuerNationality.swift +44 -0
- package/nitrogen/generated/ios/swift/CustomError.swift +35 -0
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__string.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__variant_CustomError__TransactionResult_.swift +59 -0
- package/nitrogen/generated/ios/swift/Func_void_std__variant_double__CustomError_.swift +59 -0
- package/nitrogen/generated/ios/swift/HybridPosPagseguroSpec.swift +72 -0
- package/nitrogen/generated/ios/swift/HybridPosPagseguroSpec_cxx.swift +434 -0
- package/nitrogen/generated/ios/swift/InstallmentTypes.swift +44 -0
- package/nitrogen/generated/ios/swift/PaymentData.swift +74 -0
- package/nitrogen/generated/ios/swift/PaymentTypes.swift +48 -0
- package/nitrogen/generated/ios/swift/SubAcquirer.swift +85 -0
- package/nitrogen/generated/ios/swift/TransactionResult.swift +674 -0
- package/nitrogen/generated/ios/swift/UserData.swift +169 -0
- package/nitrogen/generated/ios/swift/Variant_CustomError_TransactionResult.swift +18 -0
- package/nitrogen/generated/ios/swift/Variant_Double_CustomError.swift +18 -0
- package/nitrogen/generated/ios/swift/VoidPayData.swift +64 -0
- package/nitrogen/generated/ios/swift/VoidType.swift +40 -0
- package/nitrogen/generated/shared/c++/Capabilities.hpp +76 -0
- package/nitrogen/generated/shared/c++/CardIssuerNationality.hpp +80 -0
- package/nitrogen/generated/shared/c++/CustomError.hpp +87 -0
- package/nitrogen/generated/shared/c++/HybridPosPagseguroSpec.cpp +37 -0
- package/nitrogen/generated/shared/c++/HybridPosPagseguroSpec.hpp +102 -0
- package/nitrogen/generated/shared/c++/InstallmentTypes.hpp +63 -0
- package/nitrogen/generated/shared/c++/PaymentData.hpp +108 -0
- package/nitrogen/generated/shared/c++/PaymentTypes.hpp +69 -0
- package/nitrogen/generated/shared/c++/SubAcquirer.hpp +127 -0
- package/nitrogen/generated/shared/c++/TransactionResult.hpp +234 -0
- package/nitrogen/generated/shared/c++/UserData.hpp +112 -0
- package/nitrogen/generated/shared/c++/VoidPayData.hpp +98 -0
- package/nitrogen/generated/shared/c++/VoidType.hpp +62 -0
- package/package.json +179 -0
- package/src/PosPagseguro.nitro.ts +32 -0
- package/src/index.ts +19 -0
- package/src/pag_seguro.ts +306 -0
- package/src/types/device.ts +97 -0
- package/src/types/exceptions.ts +19 -0
- package/src/types/payments.ts +215 -0
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// UserData.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import Foundation
|
|
9
|
+
import NitroModules
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Represents an instance of `UserData`, backed by a C++ struct.
|
|
13
|
+
*/
|
|
14
|
+
public typealias UserData = margelo.nitro.pospagseguro.UserData
|
|
15
|
+
|
|
16
|
+
public extension UserData {
|
|
17
|
+
private typealias bridge = margelo.nitro.pospagseguro.bridge.swift
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Create a new instance of `UserData`.
|
|
21
|
+
*/
|
|
22
|
+
init(address: String?, city: String?, cnpj_cpf: String?, address_complement: String?, company_name: String?, nick_name: String?, address_state: String?, email: String?) {
|
|
23
|
+
self.init({ () -> bridge.std__optional_std__string_ in
|
|
24
|
+
if let __unwrappedValue = address {
|
|
25
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
26
|
+
} else {
|
|
27
|
+
return .init()
|
|
28
|
+
}
|
|
29
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
30
|
+
if let __unwrappedValue = city {
|
|
31
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
32
|
+
} else {
|
|
33
|
+
return .init()
|
|
34
|
+
}
|
|
35
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
36
|
+
if let __unwrappedValue = cnpj_cpf {
|
|
37
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
38
|
+
} else {
|
|
39
|
+
return .init()
|
|
40
|
+
}
|
|
41
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
42
|
+
if let __unwrappedValue = address_complement {
|
|
43
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
44
|
+
} else {
|
|
45
|
+
return .init()
|
|
46
|
+
}
|
|
47
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
48
|
+
if let __unwrappedValue = company_name {
|
|
49
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
50
|
+
} else {
|
|
51
|
+
return .init()
|
|
52
|
+
}
|
|
53
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
54
|
+
if let __unwrappedValue = nick_name {
|
|
55
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
56
|
+
} else {
|
|
57
|
+
return .init()
|
|
58
|
+
}
|
|
59
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
60
|
+
if let __unwrappedValue = address_state {
|
|
61
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
62
|
+
} else {
|
|
63
|
+
return .init()
|
|
64
|
+
}
|
|
65
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
66
|
+
if let __unwrappedValue = email {
|
|
67
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
68
|
+
} else {
|
|
69
|
+
return .init()
|
|
70
|
+
}
|
|
71
|
+
}())
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@inline(__always)
|
|
75
|
+
var address: String? {
|
|
76
|
+
return { () -> String? in
|
|
77
|
+
if bridge.has_value_std__optional_std__string_(self.__address) {
|
|
78
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__address)
|
|
79
|
+
return String(__unwrapped)
|
|
80
|
+
} else {
|
|
81
|
+
return nil
|
|
82
|
+
}
|
|
83
|
+
}()
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@inline(__always)
|
|
87
|
+
var city: String? {
|
|
88
|
+
return { () -> String? in
|
|
89
|
+
if bridge.has_value_std__optional_std__string_(self.__city) {
|
|
90
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__city)
|
|
91
|
+
return String(__unwrapped)
|
|
92
|
+
} else {
|
|
93
|
+
return nil
|
|
94
|
+
}
|
|
95
|
+
}()
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@inline(__always)
|
|
99
|
+
var cnpj_cpf: String? {
|
|
100
|
+
return { () -> String? in
|
|
101
|
+
if bridge.has_value_std__optional_std__string_(self.__cnpj_cpf) {
|
|
102
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__cnpj_cpf)
|
|
103
|
+
return String(__unwrapped)
|
|
104
|
+
} else {
|
|
105
|
+
return nil
|
|
106
|
+
}
|
|
107
|
+
}()
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
@inline(__always)
|
|
111
|
+
var address_complement: String? {
|
|
112
|
+
return { () -> String? in
|
|
113
|
+
if bridge.has_value_std__optional_std__string_(self.__address_complement) {
|
|
114
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__address_complement)
|
|
115
|
+
return String(__unwrapped)
|
|
116
|
+
} else {
|
|
117
|
+
return nil
|
|
118
|
+
}
|
|
119
|
+
}()
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
@inline(__always)
|
|
123
|
+
var company_name: String? {
|
|
124
|
+
return { () -> String? in
|
|
125
|
+
if bridge.has_value_std__optional_std__string_(self.__company_name) {
|
|
126
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__company_name)
|
|
127
|
+
return String(__unwrapped)
|
|
128
|
+
} else {
|
|
129
|
+
return nil
|
|
130
|
+
}
|
|
131
|
+
}()
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
@inline(__always)
|
|
135
|
+
var nick_name: String? {
|
|
136
|
+
return { () -> String? in
|
|
137
|
+
if bridge.has_value_std__optional_std__string_(self.__nick_name) {
|
|
138
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__nick_name)
|
|
139
|
+
return String(__unwrapped)
|
|
140
|
+
} else {
|
|
141
|
+
return nil
|
|
142
|
+
}
|
|
143
|
+
}()
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
@inline(__always)
|
|
147
|
+
var address_state: String? {
|
|
148
|
+
return { () -> String? in
|
|
149
|
+
if bridge.has_value_std__optional_std__string_(self.__address_state) {
|
|
150
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__address_state)
|
|
151
|
+
return String(__unwrapped)
|
|
152
|
+
} else {
|
|
153
|
+
return nil
|
|
154
|
+
}
|
|
155
|
+
}()
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
@inline(__always)
|
|
159
|
+
var email: String? {
|
|
160
|
+
return { () -> String? in
|
|
161
|
+
if bridge.has_value_std__optional_std__string_(self.__email) {
|
|
162
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__email)
|
|
163
|
+
return String(__unwrapped)
|
|
164
|
+
} else {
|
|
165
|
+
return nil
|
|
166
|
+
}
|
|
167
|
+
}()
|
|
168
|
+
}
|
|
169
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Variant_CustomError_TransactionResult.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* An Swift enum with associated values representing a Variant/Union type.
|
|
12
|
+
* JS type: `struct | struct`
|
|
13
|
+
*/
|
|
14
|
+
@frozen
|
|
15
|
+
public indirect enum Variant_CustomError_TransactionResult {
|
|
16
|
+
case first(CustomError)
|
|
17
|
+
case second(TransactionResult)
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Variant_Double_CustomError.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* An Swift enum with associated values representing a Variant/Union type.
|
|
12
|
+
* JS type: `number | struct`
|
|
13
|
+
*/
|
|
14
|
+
@frozen
|
|
15
|
+
public indirect enum Variant_Double_CustomError {
|
|
16
|
+
case first(Double)
|
|
17
|
+
case second(CustomError)
|
|
18
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// VoidPayData.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import Foundation
|
|
9
|
+
import NitroModules
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Represents an instance of `VoidPayData`, backed by a C++ struct.
|
|
13
|
+
*/
|
|
14
|
+
public typealias VoidPayData = margelo.nitro.pospagseguro.VoidPayData
|
|
15
|
+
|
|
16
|
+
public extension VoidPayData {
|
|
17
|
+
private typealias bridge = margelo.nitro.pospagseguro.bridge.swift
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Create a new instance of `VoidPayData`.
|
|
21
|
+
*/
|
|
22
|
+
init(transaction_code: String, transaction_id: String, print_receipt: Bool?, void_type: VoidType?) {
|
|
23
|
+
self.init(std.string(transaction_code), std.string(transaction_id), { () -> bridge.std__optional_bool_ in
|
|
24
|
+
if let __unwrappedValue = print_receipt {
|
|
25
|
+
return bridge.create_std__optional_bool_(__unwrappedValue)
|
|
26
|
+
} else {
|
|
27
|
+
return .init()
|
|
28
|
+
}
|
|
29
|
+
}(), { () -> bridge.std__optional_VoidType_ in
|
|
30
|
+
if let __unwrappedValue = void_type {
|
|
31
|
+
return bridge.create_std__optional_VoidType_(__unwrappedValue)
|
|
32
|
+
} else {
|
|
33
|
+
return .init()
|
|
34
|
+
}
|
|
35
|
+
}())
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@inline(__always)
|
|
39
|
+
var transaction_code: String {
|
|
40
|
+
return String(self.__transaction_code)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@inline(__always)
|
|
44
|
+
var transaction_id: String {
|
|
45
|
+
return String(self.__transaction_id)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@inline(__always)
|
|
49
|
+
var print_receipt: Bool? {
|
|
50
|
+
return { () -> Bool? in
|
|
51
|
+
if bridge.has_value_std__optional_bool_(self.__print_receipt) {
|
|
52
|
+
let __unwrapped = bridge.get_std__optional_bool_(self.__print_receipt)
|
|
53
|
+
return __unwrapped
|
|
54
|
+
} else {
|
|
55
|
+
return nil
|
|
56
|
+
}
|
|
57
|
+
}()
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@inline(__always)
|
|
61
|
+
var void_type: VoidType? {
|
|
62
|
+
return self.__void_type.has_value() ? self.__void_type.pointee : nil
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// VoidType.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Represents the JS enum `VoidType`, backed by a C++ enum.
|
|
10
|
+
*/
|
|
11
|
+
public typealias VoidType = margelo.nitro.pospagseguro.VoidType
|
|
12
|
+
|
|
13
|
+
public extension VoidType {
|
|
14
|
+
/**
|
|
15
|
+
* Get a VoidType for the given String value, or
|
|
16
|
+
* return `nil` if the given value was invalid/unknown.
|
|
17
|
+
*/
|
|
18
|
+
init?(fromString string: String) {
|
|
19
|
+
switch string {
|
|
20
|
+
case "PAYMENT":
|
|
21
|
+
self = .payment
|
|
22
|
+
case "QRCODE":
|
|
23
|
+
self = .qrcode
|
|
24
|
+
default:
|
|
25
|
+
return nil
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Get the String value this VoidType represents.
|
|
31
|
+
*/
|
|
32
|
+
var stringValue: String {
|
|
33
|
+
switch self {
|
|
34
|
+
case .payment:
|
|
35
|
+
return "PAYMENT"
|
|
36
|
+
case .qrcode:
|
|
37
|
+
return "QRCODE"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Capabilities.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
|
|
21
|
+
namespace margelo::nitro::pospagseguro {
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* An enum which can be represented as a JavaScript enum (Capabilities).
|
|
25
|
+
*/
|
|
26
|
+
enum class Capabilities {
|
|
27
|
+
MAG SWIFT_NAME(mag) = 1,
|
|
28
|
+
ICC SWIFT_NAME(icc) = 2,
|
|
29
|
+
PICC SWIFT_NAME(picc) = 3,
|
|
30
|
+
PED SWIFT_NAME(ped) = 4,
|
|
31
|
+
KEYBOARD SWIFT_NAME(keyboard) = 5,
|
|
32
|
+
PRINTER SWIFT_NAME(printer) = 6,
|
|
33
|
+
BLUETOOTH SWIFT_NAME(bluetooth) = 7,
|
|
34
|
+
CASH_BOX SWIFT_NAME(cashBox) = 8,
|
|
35
|
+
CUSTOMER_DISPLAY SWIFT_NAME(customerDisplay) = 9,
|
|
36
|
+
ETHERNET SWIFT_NAME(ethernet) = 10,
|
|
37
|
+
FINGERPRINT_READER SWIFT_NAME(fingerprintReader) = 11,
|
|
38
|
+
G_SENSOR SWIFT_NAME(gSensor) = 12,
|
|
39
|
+
HDMI SWIFT_NAME(hdmi) = 13,
|
|
40
|
+
ID_CARD_READER SWIFT_NAME(idCardReader) = 14,
|
|
41
|
+
SM SWIFT_NAME(sm) = 15,
|
|
42
|
+
MODEM SWIFT_NAME(modem) = 16,
|
|
43
|
+
} CLOSED_ENUM;
|
|
44
|
+
|
|
45
|
+
} // namespace margelo::nitro::pospagseguro
|
|
46
|
+
|
|
47
|
+
namespace margelo::nitro {
|
|
48
|
+
|
|
49
|
+
// C++ Capabilities <> JS Capabilities (enum)
|
|
50
|
+
template <>
|
|
51
|
+
struct JSIConverter<margelo::nitro::pospagseguro::Capabilities> final {
|
|
52
|
+
static inline margelo::nitro::pospagseguro::Capabilities fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
53
|
+
int enumValue = JSIConverter<int>::fromJSI(runtime, arg);
|
|
54
|
+
return static_cast<margelo::nitro::pospagseguro::Capabilities>(enumValue);
|
|
55
|
+
}
|
|
56
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::pospagseguro::Capabilities arg) {
|
|
57
|
+
int enumValue = static_cast<int>(arg);
|
|
58
|
+
return JSIConverter<int>::toJSI(runtime, enumValue);
|
|
59
|
+
}
|
|
60
|
+
static inline bool canConvert(jsi::Runtime&, const jsi::Value& value) {
|
|
61
|
+
if (!value.isNumber()) {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
double number = value.getNumber();
|
|
65
|
+
int integer = static_cast<int>(number);
|
|
66
|
+
if (number != integer) {
|
|
67
|
+
// The integer is not the same value as the double - we truncated floating points.
|
|
68
|
+
// Enums are all integers, so the input floating point number is obviously invalid.
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
// Check if we are within the bounds of the enum.
|
|
72
|
+
return integer >= 1 && integer <= 16;
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// CardIssuerNationality.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/NitroHash.hpp>)
|
|
11
|
+
#include <NitroModules/NitroHash.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
16
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
21
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
|
|
26
|
+
namespace margelo::nitro::pospagseguro {
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* An enum which can be represented as a JavaScript union (CardIssuerNationality).
|
|
30
|
+
*/
|
|
31
|
+
enum class CardIssuerNationality {
|
|
32
|
+
UNAVAILABLE SWIFT_NAME(unavailable) = 0,
|
|
33
|
+
DOMESTIC SWIFT_NAME(domestic) = 1,
|
|
34
|
+
INTERNATIONAL SWIFT_NAME(international) = 2,
|
|
35
|
+
} CLOSED_ENUM;
|
|
36
|
+
|
|
37
|
+
} // namespace margelo::nitro::pospagseguro
|
|
38
|
+
|
|
39
|
+
namespace margelo::nitro {
|
|
40
|
+
|
|
41
|
+
// C++ CardIssuerNationality <> JS CardIssuerNationality (union)
|
|
42
|
+
template <>
|
|
43
|
+
struct JSIConverter<margelo::nitro::pospagseguro::CardIssuerNationality> final {
|
|
44
|
+
static inline margelo::nitro::pospagseguro::CardIssuerNationality fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
45
|
+
std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
|
|
46
|
+
switch (hashString(unionValue.c_str(), unionValue.size())) {
|
|
47
|
+
case hashString("UNAVAILABLE"): return margelo::nitro::pospagseguro::CardIssuerNationality::UNAVAILABLE;
|
|
48
|
+
case hashString("DOMESTIC"): return margelo::nitro::pospagseguro::CardIssuerNationality::DOMESTIC;
|
|
49
|
+
case hashString("INTERNATIONAL"): return margelo::nitro::pospagseguro::CardIssuerNationality::INTERNATIONAL;
|
|
50
|
+
default: [[unlikely]]
|
|
51
|
+
throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum CardIssuerNationality - invalid value!");
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::pospagseguro::CardIssuerNationality arg) {
|
|
55
|
+
switch (arg) {
|
|
56
|
+
case margelo::nitro::pospagseguro::CardIssuerNationality::UNAVAILABLE: return JSIConverter<std::string>::toJSI(runtime, "UNAVAILABLE");
|
|
57
|
+
case margelo::nitro::pospagseguro::CardIssuerNationality::DOMESTIC: return JSIConverter<std::string>::toJSI(runtime, "DOMESTIC");
|
|
58
|
+
case margelo::nitro::pospagseguro::CardIssuerNationality::INTERNATIONAL: return JSIConverter<std::string>::toJSI(runtime, "INTERNATIONAL");
|
|
59
|
+
default: [[unlikely]]
|
|
60
|
+
throw std::invalid_argument("Cannot convert CardIssuerNationality to JS - invalid value: "
|
|
61
|
+
+ std::to_string(static_cast<int>(arg)) + "!");
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
65
|
+
if (!value.isString()) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, value);
|
|
69
|
+
switch (hashString(unionValue.c_str(), unionValue.size())) {
|
|
70
|
+
case hashString("UNAVAILABLE"):
|
|
71
|
+
case hashString("DOMESTIC"):
|
|
72
|
+
case hashString("INTERNATIONAL"):
|
|
73
|
+
return true;
|
|
74
|
+
default:
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// CustomError.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
+
#else
|
|
28
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
#include <string>
|
|
34
|
+
|
|
35
|
+
namespace margelo::nitro::pospagseguro {
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* A struct which can be represented as a JavaScript object (CustomError).
|
|
39
|
+
*/
|
|
40
|
+
struct CustomError final {
|
|
41
|
+
public:
|
|
42
|
+
std::string code SWIFT_PRIVATE;
|
|
43
|
+
std::string message SWIFT_PRIVATE;
|
|
44
|
+
|
|
45
|
+
public:
|
|
46
|
+
CustomError() = default;
|
|
47
|
+
explicit CustomError(std::string code, std::string message): code(code), message(message) {}
|
|
48
|
+
|
|
49
|
+
public:
|
|
50
|
+
friend bool operator==(const CustomError& lhs, const CustomError& rhs) = default;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
} // namespace margelo::nitro::pospagseguro
|
|
54
|
+
|
|
55
|
+
namespace margelo::nitro {
|
|
56
|
+
|
|
57
|
+
// C++ CustomError <> JS CustomError (object)
|
|
58
|
+
template <>
|
|
59
|
+
struct JSIConverter<margelo::nitro::pospagseguro::CustomError> final {
|
|
60
|
+
static inline margelo::nitro::pospagseguro::CustomError fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
61
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
62
|
+
return margelo::nitro::pospagseguro::CustomError(
|
|
63
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "code"))),
|
|
64
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "message")))
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::pospagseguro::CustomError& arg) {
|
|
68
|
+
jsi::Object obj(runtime);
|
|
69
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "code"), JSIConverter<std::string>::toJSI(runtime, arg.code));
|
|
70
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "message"), JSIConverter<std::string>::toJSI(runtime, arg.message));
|
|
71
|
+
return obj;
|
|
72
|
+
}
|
|
73
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
74
|
+
if (!value.isObject()) {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
jsi::Object obj = value.getObject(runtime);
|
|
78
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "code")))) return false;
|
|
82
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "message")))) return false;
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridPosPagseguroSpec.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © 2026 Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "HybridPosPagseguroSpec.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::pospagseguro {
|
|
11
|
+
|
|
12
|
+
void HybridPosPagseguroSpec::loadHybridMethods() {
|
|
13
|
+
// load base methods/properties
|
|
14
|
+
HybridObject::loadHybridMethods();
|
|
15
|
+
// load custom methods/properties
|
|
16
|
+
registerHybrids(this, [](Prototype& prototype) {
|
|
17
|
+
prototype.registerHybridMethod("getModel", &HybridPosPagseguroSpec::getModel);
|
|
18
|
+
prototype.registerHybridMethod("getSerialNumber", &HybridPosPagseguroSpec::getSerialNumber);
|
|
19
|
+
prototype.registerHybridMethod("getSubAcquirerData", &HybridPosPagseguroSpec::getSubAcquirerData);
|
|
20
|
+
prototype.registerHybridMethod("getUserData", &HybridPosPagseguroSpec::getUserData);
|
|
21
|
+
prototype.registerHybridMethod("reboot", &HybridPosPagseguroSpec::reboot);
|
|
22
|
+
prototype.registerHybridMethod("reprintCustomerReceipt", &HybridPosPagseguroSpec::reprintCustomerReceipt);
|
|
23
|
+
prototype.registerHybridMethod("reprintStablishmentReceipt", &HybridPosPagseguroSpec::reprintStablishmentReceipt);
|
|
24
|
+
prototype.registerHybridMethod("printFromFile", &HybridPosPagseguroSpec::printFromFile);
|
|
25
|
+
prototype.registerHybridMethod("printFromBase64", &HybridPosPagseguroSpec::printFromBase64);
|
|
26
|
+
prototype.registerHybridMethod("abort", &HybridPosPagseguroSpec::abort);
|
|
27
|
+
prototype.registerHybridMethod("isServiceBusy", &HybridPosPagseguroSpec::isServiceBusy);
|
|
28
|
+
prototype.registerHybridMethod("isAuthenticated", &HybridPosPagseguroSpec::isAuthenticated);
|
|
29
|
+
prototype.registerHybridMethod("hasCapability", &HybridPosPagseguroSpec::hasCapability);
|
|
30
|
+
prototype.registerHybridMethod("initialize", &HybridPosPagseguroSpec::initialize);
|
|
31
|
+
prototype.registerHybridMethod("doPayment", &HybridPosPagseguroSpec::doPayment);
|
|
32
|
+
prototype.registerHybridMethod("voidPayment", &HybridPosPagseguroSpec::voidPayment);
|
|
33
|
+
prototype.registerHybridMethod("getLastApprovedTransaction", &HybridPosPagseguroSpec::getLastApprovedTransaction);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
} // namespace margelo::nitro::pospagseguro
|