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.
Files changed (125) hide show
  1. package/LICENSE +20 -0
  2. package/PosPagseguro.podspec +29 -0
  3. package/README.md +193 -0
  4. package/android/CMakeLists.txt +24 -0
  5. package/android/build.gradle +132 -0
  6. package/android/gradle.properties +5 -0
  7. package/android/libs/wrapper-1.30.52.aar +0 -0
  8. package/android/src/main/AndroidManifest.xml +2 -0
  9. package/android/src/main/cpp/cpp-adapter.cpp +6 -0
  10. package/android/src/main/java/com/margelo/nitro/pospagseguro/PosPagseguro.kt +251 -0
  11. package/android/src/main/java/com/margelo/nitro/pospagseguro/PosPagseguroPackage.kt +23 -0
  12. package/android/src/main/java/com/margelo/nitro/pospagseguro/maps/SubAcquirer.kt +23 -0
  13. package/android/src/main/java/com/margelo/nitro/pospagseguro/maps/TransactionResult.kt +53 -0
  14. package/android/src/main/java/com/margelo/nitro/pospagseguro/maps/Userdata.kt +17 -0
  15. package/ios/PosPagseguro.swift +5 -0
  16. package/lib/module/PosPagseguro.nitro.js +4 -0
  17. package/lib/module/PosPagseguro.nitro.js.map +1 -0
  18. package/lib/module/index.js +7 -0
  19. package/lib/module/index.js.map +1 -0
  20. package/lib/module/package.json +1 -0
  21. package/lib/module/pag_seguro.js +290 -0
  22. package/lib/module/pag_seguro.js.map +1 -0
  23. package/lib/module/types/device.js +71 -0
  24. package/lib/module/types/device.js.map +1 -0
  25. package/lib/module/types/exceptions.js +16 -0
  26. package/lib/module/types/exceptions.js.map +1 -0
  27. package/lib/module/types/payments.js +84 -0
  28. package/lib/module/types/payments.js.map +1 -0
  29. package/lib/typescript/package.json +1 -0
  30. package/lib/typescript/src/PosPagseguro.nitro.d.ts +27 -0
  31. package/lib/typescript/src/PosPagseguro.nitro.d.ts.map +1 -0
  32. package/lib/typescript/src/index.d.ts +7 -0
  33. package/lib/typescript/src/index.d.ts.map +1 -0
  34. package/lib/typescript/src/pag_seguro.d.ts +188 -0
  35. package/lib/typescript/src/pag_seguro.d.ts.map +1 -0
  36. package/lib/typescript/src/types/device.d.ts +92 -0
  37. package/lib/typescript/src/types/device.d.ts.map +1 -0
  38. package/lib/typescript/src/types/exceptions.d.ts +16 -0
  39. package/lib/typescript/src/types/exceptions.d.ts.map +1 -0
  40. package/lib/typescript/src/types/payments.d.ts +205 -0
  41. package/lib/typescript/src/types/payments.d.ts.map +1 -0
  42. package/nitro.json +16 -0
  43. package/nitrogen/generated/android/c++/JCapabilities.hpp +100 -0
  44. package/nitrogen/generated/android/c++/JCardIssuerNationality.hpp +61 -0
  45. package/nitrogen/generated/android/c++/JCustomError.hpp +61 -0
  46. package/nitrogen/generated/android/c++/JFunc_void_std__string.hpp +76 -0
  47. package/nitrogen/generated/android/c++/JHybridPosPagseguroSpec.cpp +248 -0
  48. package/nitrogen/generated/android/c++/JHybridPosPagseguroSpec.hpp +81 -0
  49. package/nitrogen/generated/android/c++/JInstallmentTypes.hpp +61 -0
  50. package/nitrogen/generated/android/c++/JPaymentData.hpp +81 -0
  51. package/nitrogen/generated/android/c++/JPaymentTypes.hpp +64 -0
  52. package/nitrogen/generated/android/c++/JSubAcquirer.hpp +101 -0
  53. package/nitrogen/generated/android/c++/JTransactionResult.hpp +208 -0
  54. package/nitrogen/generated/android/c++/JUserData.hpp +86 -0
  55. package/nitrogen/generated/android/c++/JVariant_CustomError_TransactionResult.cpp +26 -0
  56. package/nitrogen/generated/android/c++/JVariant_CustomError_TransactionResult.hpp +75 -0
  57. package/nitrogen/generated/android/c++/JVariant_Double_CustomError.cpp +26 -0
  58. package/nitrogen/generated/android/c++/JVariant_Double_CustomError.hpp +70 -0
  59. package/nitrogen/generated/android/c++/JVoidPayData.hpp +72 -0
  60. package/nitrogen/generated/android/c++/JVoidType.hpp +58 -0
  61. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pospagseguro/Capabilities.kt +37 -0
  62. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pospagseguro/CardIssuerNationality.kt +24 -0
  63. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pospagseguro/CustomError.kt +41 -0
  64. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pospagseguro/Func_void_std__string.kt +80 -0
  65. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pospagseguro/HybridPosPagseguroSpec.kt +132 -0
  66. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pospagseguro/InstallmentTypes.kt +24 -0
  67. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pospagseguro/PaymentData.kt +53 -0
  68. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pospagseguro/PaymentTypes.kt +25 -0
  69. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pospagseguro/SubAcquirer.kt +71 -0
  70. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pospagseguro/TransactionResult.kt +149 -0
  71. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pospagseguro/UserData.kt +59 -0
  72. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pospagseguro/Variant_CustomError_TransactionResult.kt +59 -0
  73. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pospagseguro/Variant_Double_CustomError.kt +59 -0
  74. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pospagseguro/VoidPayData.kt +47 -0
  75. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pospagseguro/VoidType.kt +23 -0
  76. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pospagseguro/pospagseguroOnLoad.kt +35 -0
  77. package/nitrogen/generated/android/pospagseguro+autolinking.cmake +83 -0
  78. package/nitrogen/generated/android/pospagseguro+autolinking.gradle +27 -0
  79. package/nitrogen/generated/android/pospagseguroOnLoad.cpp +46 -0
  80. package/nitrogen/generated/android/pospagseguroOnLoad.hpp +25 -0
  81. package/nitrogen/generated/ios/PosPagseguro+autolinking.rb +60 -0
  82. package/nitrogen/generated/ios/PosPagseguro-Swift-Cxx-Bridge.cpp +65 -0
  83. package/nitrogen/generated/ios/PosPagseguro-Swift-Cxx-Bridge.hpp +422 -0
  84. package/nitrogen/generated/ios/PosPagseguro-Swift-Cxx-Umbrella.hpp +81 -0
  85. package/nitrogen/generated/ios/c++/HybridPosPagseguroSpecSwift.cpp +11 -0
  86. package/nitrogen/generated/ios/c++/HybridPosPagseguroSpecSwift.hpp +236 -0
  87. package/nitrogen/generated/ios/swift/Capabilities.swift +96 -0
  88. package/nitrogen/generated/ios/swift/CardIssuerNationality.swift +44 -0
  89. package/nitrogen/generated/ios/swift/CustomError.swift +35 -0
  90. package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +47 -0
  91. package/nitrogen/generated/ios/swift/Func_void_std__string.swift +47 -0
  92. package/nitrogen/generated/ios/swift/Func_void_std__variant_CustomError__TransactionResult_.swift +59 -0
  93. package/nitrogen/generated/ios/swift/Func_void_std__variant_double__CustomError_.swift +59 -0
  94. package/nitrogen/generated/ios/swift/HybridPosPagseguroSpec.swift +72 -0
  95. package/nitrogen/generated/ios/swift/HybridPosPagseguroSpec_cxx.swift +434 -0
  96. package/nitrogen/generated/ios/swift/InstallmentTypes.swift +44 -0
  97. package/nitrogen/generated/ios/swift/PaymentData.swift +74 -0
  98. package/nitrogen/generated/ios/swift/PaymentTypes.swift +48 -0
  99. package/nitrogen/generated/ios/swift/SubAcquirer.swift +85 -0
  100. package/nitrogen/generated/ios/swift/TransactionResult.swift +674 -0
  101. package/nitrogen/generated/ios/swift/UserData.swift +169 -0
  102. package/nitrogen/generated/ios/swift/Variant_CustomError_TransactionResult.swift +18 -0
  103. package/nitrogen/generated/ios/swift/Variant_Double_CustomError.swift +18 -0
  104. package/nitrogen/generated/ios/swift/VoidPayData.swift +64 -0
  105. package/nitrogen/generated/ios/swift/VoidType.swift +40 -0
  106. package/nitrogen/generated/shared/c++/Capabilities.hpp +76 -0
  107. package/nitrogen/generated/shared/c++/CardIssuerNationality.hpp +80 -0
  108. package/nitrogen/generated/shared/c++/CustomError.hpp +87 -0
  109. package/nitrogen/generated/shared/c++/HybridPosPagseguroSpec.cpp +37 -0
  110. package/nitrogen/generated/shared/c++/HybridPosPagseguroSpec.hpp +102 -0
  111. package/nitrogen/generated/shared/c++/InstallmentTypes.hpp +63 -0
  112. package/nitrogen/generated/shared/c++/PaymentData.hpp +108 -0
  113. package/nitrogen/generated/shared/c++/PaymentTypes.hpp +69 -0
  114. package/nitrogen/generated/shared/c++/SubAcquirer.hpp +127 -0
  115. package/nitrogen/generated/shared/c++/TransactionResult.hpp +234 -0
  116. package/nitrogen/generated/shared/c++/UserData.hpp +112 -0
  117. package/nitrogen/generated/shared/c++/VoidPayData.hpp +98 -0
  118. package/nitrogen/generated/shared/c++/VoidType.hpp +62 -0
  119. package/package.json +179 -0
  120. package/src/PosPagseguro.nitro.ts +32 -0
  121. package/src/index.ts +19 -0
  122. package/src/pag_seguro.ts +306 -0
  123. package/src/types/device.ts +97 -0
  124. package/src/types/exceptions.ts +19 -0
  125. package/src/types/payments.ts +215 -0
@@ -0,0 +1,53 @@
1
+ ///
2
+ /// PaymentData.kt
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
+ package com.margelo.nitro.pospagseguro
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+
13
+
14
+ /**
15
+ * Represents the JavaScript object/struct "PaymentData".
16
+ */
17
+ @DoNotStrip
18
+ @Keep
19
+ data class PaymentData(
20
+ @DoNotStrip
21
+ @Keep
22
+ val amount: Double,
23
+ @DoNotStrip
24
+ @Keep
25
+ val installment_type: InstallmentTypes,
26
+ @DoNotStrip
27
+ @Keep
28
+ val installments: Double,
29
+ @DoNotStrip
30
+ @Keep
31
+ val print_receipt: Boolean?,
32
+ @DoNotStrip
33
+ @Keep
34
+ val type: PaymentTypes,
35
+ @DoNotStrip
36
+ @Keep
37
+ val user_reference: Double?
38
+ ) {
39
+ /* primary constructor */
40
+
41
+ companion object {
42
+ /**
43
+ * Constructor called from C++
44
+ */
45
+ @DoNotStrip
46
+ @Keep
47
+ @Suppress("unused")
48
+ @JvmStatic
49
+ private fun fromCpp(amount: Double, installment_type: InstallmentTypes, installments: Double, print_receipt: Boolean?, type: PaymentTypes, user_reference: Double?): PaymentData {
50
+ return PaymentData(amount, installment_type, installments, print_receipt, type, user_reference)
51
+ }
52
+ }
53
+ }
@@ -0,0 +1,25 @@
1
+ ///
2
+ /// PaymentTypes.kt
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
+ package com.margelo.nitro.pospagseguro
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+
13
+ /**
14
+ * Represents the JavaScript enum/union "PaymentTypes".
15
+ */
16
+ @DoNotStrip
17
+ @Keep
18
+ enum class PaymentTypes(@DoNotStrip @Keep val value: Int) {
19
+ CREDIT(1),
20
+ DEBIT(2),
21
+ VOUCHER(3),
22
+ PIX(5);
23
+
24
+ companion object
25
+ }
@@ -0,0 +1,71 @@
1
+ ///
2
+ /// SubAcquirer.kt
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
+ package com.margelo.nitro.pospagseguro
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+
13
+
14
+ /**
15
+ * Represents the JavaScript object/struct "SubAcquirer".
16
+ */
17
+ @DoNotStrip
18
+ @Keep
19
+ data class SubAcquirer(
20
+ @DoNotStrip
21
+ @Keep
22
+ val name: String,
23
+ @DoNotStrip
24
+ @Keep
25
+ val address: String,
26
+ @DoNotStrip
27
+ @Keep
28
+ val city: String,
29
+ @DoNotStrip
30
+ @Keep
31
+ val uf: String,
32
+ @DoNotStrip
33
+ @Keep
34
+ val country: String,
35
+ @DoNotStrip
36
+ @Keep
37
+ val zip_code: String,
38
+ @DoNotStrip
39
+ @Keep
40
+ val mcc: String,
41
+ @DoNotStrip
42
+ @Keep
43
+ val cnpj_cpf: String,
44
+ @DoNotStrip
45
+ @Keep
46
+ val doc_type: String,
47
+ @DoNotStrip
48
+ @Keep
49
+ val telephone: String,
50
+ @DoNotStrip
51
+ @Keep
52
+ val full_name: String,
53
+ @DoNotStrip
54
+ @Keep
55
+ val merchant_id: String
56
+ ) {
57
+ /* primary constructor */
58
+
59
+ companion object {
60
+ /**
61
+ * Constructor called from C++
62
+ */
63
+ @DoNotStrip
64
+ @Keep
65
+ @Suppress("unused")
66
+ @JvmStatic
67
+ private fun fromCpp(name: String, address: String, city: String, uf: String, country: String, zip_code: String, mcc: String, cnpj_cpf: String, doc_type: String, telephone: String, full_name: String, merchant_id: String): SubAcquirer {
68
+ return SubAcquirer(name, address, city, uf, country, zip_code, mcc, cnpj_cpf, doc_type, telephone, full_name, merchant_id)
69
+ }
70
+ }
71
+ }
@@ -0,0 +1,149 @@
1
+ ///
2
+ /// TransactionResult.kt
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
+ package com.margelo.nitro.pospagseguro
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+
13
+
14
+ /**
15
+ * Represents the JavaScript object/struct "TransactionResult".
16
+ */
17
+ @DoNotStrip
18
+ @Keep
19
+ data class TransactionResult(
20
+ @DoNotStrip
21
+ @Keep
22
+ val transaction_code: String?,
23
+ @DoNotStrip
24
+ @Keep
25
+ val transaction_id: String?,
26
+ @DoNotStrip
27
+ @Keep
28
+ val date: String?,
29
+ @DoNotStrip
30
+ @Keep
31
+ val time: String?,
32
+ @DoNotStrip
33
+ @Keep
34
+ val host_nsu: String?,
35
+ @DoNotStrip
36
+ @Keep
37
+ val card_brand: String?,
38
+ @DoNotStrip
39
+ @Keep
40
+ val bin: String?,
41
+ @DoNotStrip
42
+ @Keep
43
+ val holder: String?,
44
+ @DoNotStrip
45
+ @Keep
46
+ val user_reference: String?,
47
+ @DoNotStrip
48
+ @Keep
49
+ val terminal_serial_number: String?,
50
+ @DoNotStrip
51
+ @Keep
52
+ val amount: String?,
53
+ @DoNotStrip
54
+ @Keep
55
+ val available_balance: String?,
56
+ @DoNotStrip
57
+ @Keep
58
+ val card_application: String?,
59
+ @DoNotStrip
60
+ @Keep
61
+ val label: String?,
62
+ @DoNotStrip
63
+ @Keep
64
+ val holder_name: String?,
65
+ @DoNotStrip
66
+ @Keep
67
+ val extended_holder_name: String?,
68
+ @DoNotStrip
69
+ @Keep
70
+ val card_issuer_nationality: CardIssuerNationality?,
71
+ @DoNotStrip
72
+ @Keep
73
+ val reader_model: String?,
74
+ @DoNotStrip
75
+ @Keep
76
+ val nsu: String?,
77
+ @DoNotStrip
78
+ @Keep
79
+ val auto_code: String?,
80
+ @DoNotStrip
81
+ @Keep
82
+ val installments: Double?,
83
+ @DoNotStrip
84
+ @Keep
85
+ val original_amount: Double?,
86
+ @DoNotStrip
87
+ @Keep
88
+ val buyer_name: String?,
89
+ @DoNotStrip
90
+ @Keep
91
+ val payment_type: Double?,
92
+ @DoNotStrip
93
+ @Keep
94
+ val type_transaction: String?,
95
+ @DoNotStrip
96
+ @Keep
97
+ val app_identification: String?,
98
+ @DoNotStrip
99
+ @Keep
100
+ val card_hash: String?,
101
+ @DoNotStrip
102
+ @Keep
103
+ val pre_auto_due_date: String?,
104
+ @DoNotStrip
105
+ @Keep
106
+ val pre_auto_original_amount: String?,
107
+ @DoNotStrip
108
+ @Keep
109
+ val user_registered: Double?,
110
+ @DoNotStrip
111
+ @Keep
112
+ val accumulated_value: String?,
113
+ @DoNotStrip
114
+ @Keep
115
+ val consumer_identification: String?,
116
+ @DoNotStrip
117
+ @Keep
118
+ val current_balance: String?,
119
+ @DoNotStrip
120
+ @Keep
121
+ val consumer_phone_number: String?,
122
+ @DoNotStrip
123
+ @Keep
124
+ val clube_pag_screens_ids: String?,
125
+ @DoNotStrip
126
+ @Keep
127
+ val partial_pay_partially_authorized_amount: String?,
128
+ @DoNotStrip
129
+ @Keep
130
+ val partial_pay_remaining_amount: String?,
131
+ @DoNotStrip
132
+ @Keep
133
+ val pix_tx_id_code: String?
134
+ ) {
135
+ /* primary constructor */
136
+
137
+ companion object {
138
+ /**
139
+ * Constructor called from C++
140
+ */
141
+ @DoNotStrip
142
+ @Keep
143
+ @Suppress("unused")
144
+ @JvmStatic
145
+ private fun fromCpp(transaction_code: String?, transaction_id: String?, date: String?, time: String?, host_nsu: String?, card_brand: String?, bin: String?, holder: String?, user_reference: String?, terminal_serial_number: String?, amount: String?, available_balance: String?, card_application: String?, label: String?, holder_name: String?, extended_holder_name: String?, card_issuer_nationality: CardIssuerNationality?, reader_model: String?, nsu: String?, auto_code: String?, installments: Double?, original_amount: Double?, buyer_name: String?, payment_type: Double?, type_transaction: String?, app_identification: String?, card_hash: String?, pre_auto_due_date: String?, pre_auto_original_amount: String?, user_registered: Double?, accumulated_value: String?, consumer_identification: String?, current_balance: String?, consumer_phone_number: String?, clube_pag_screens_ids: String?, partial_pay_partially_authorized_amount: String?, partial_pay_remaining_amount: String?, pix_tx_id_code: String?): TransactionResult {
146
+ return TransactionResult(transaction_code, transaction_id, date, time, host_nsu, card_brand, bin, holder, user_reference, terminal_serial_number, amount, available_balance, card_application, label, holder_name, extended_holder_name, card_issuer_nationality, reader_model, nsu, auto_code, installments, original_amount, buyer_name, payment_type, type_transaction, app_identification, card_hash, pre_auto_due_date, pre_auto_original_amount, user_registered, accumulated_value, consumer_identification, current_balance, consumer_phone_number, clube_pag_screens_ids, partial_pay_partially_authorized_amount, partial_pay_remaining_amount, pix_tx_id_code)
147
+ }
148
+ }
149
+ }
@@ -0,0 +1,59 @@
1
+ ///
2
+ /// UserData.kt
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
+ package com.margelo.nitro.pospagseguro
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+
13
+
14
+ /**
15
+ * Represents the JavaScript object/struct "UserData".
16
+ */
17
+ @DoNotStrip
18
+ @Keep
19
+ data class UserData(
20
+ @DoNotStrip
21
+ @Keep
22
+ val address: String?,
23
+ @DoNotStrip
24
+ @Keep
25
+ val city: String?,
26
+ @DoNotStrip
27
+ @Keep
28
+ val cnpj_cpf: String?,
29
+ @DoNotStrip
30
+ @Keep
31
+ val address_complement: String?,
32
+ @DoNotStrip
33
+ @Keep
34
+ val company_name: String?,
35
+ @DoNotStrip
36
+ @Keep
37
+ val nick_name: String?,
38
+ @DoNotStrip
39
+ @Keep
40
+ val address_state: String?,
41
+ @DoNotStrip
42
+ @Keep
43
+ val email: String?
44
+ ) {
45
+ /* primary constructor */
46
+
47
+ companion object {
48
+ /**
49
+ * Constructor called from C++
50
+ */
51
+ @DoNotStrip
52
+ @Keep
53
+ @Suppress("unused")
54
+ @JvmStatic
55
+ private fun fromCpp(address: String?, city: String?, cnpj_cpf: String?, address_complement: String?, company_name: String?, nick_name: String?, address_state: String?, email: String?): UserData {
56
+ return UserData(address, city, cnpj_cpf, address_complement, company_name, nick_name, address_state, email)
57
+ }
58
+ }
59
+ }
@@ -0,0 +1,59 @@
1
+ ///
2
+ /// Variant_CustomError_TransactionResult.kt
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
+ package com.margelo.nitro.pospagseguro
9
+
10
+ import com.facebook.proguard.annotations.DoNotStrip
11
+
12
+
13
+ /**
14
+ * Represents the TypeScript variant "CustomError | TransactionResult".
15
+ */
16
+ @Suppress("ClassName")
17
+ @DoNotStrip
18
+ sealed class Variant_CustomError_TransactionResult {
19
+ @DoNotStrip
20
+ data class First(@DoNotStrip val value: CustomError): Variant_CustomError_TransactionResult()
21
+ @DoNotStrip
22
+ data class Second(@DoNotStrip val value: TransactionResult): Variant_CustomError_TransactionResult()
23
+
24
+ @Deprecated("getAs() is not type-safe. Use fold/asFirstOrNull/asSecondOrNull instead.", level = DeprecationLevel.ERROR)
25
+ inline fun <reified T> getAs(): T? = when (this) {
26
+ is First -> value as? T
27
+ is Second -> value as? T
28
+ }
29
+
30
+ val isFirst: Boolean
31
+ get() = this is First
32
+ val isSecond: Boolean
33
+ get() = this is Second
34
+
35
+ fun asFirstOrNull(): CustomError? {
36
+ val value = (this as? First)?.value ?: return null
37
+ return value
38
+ }
39
+ fun asSecondOrNull(): TransactionResult? {
40
+ val value = (this as? Second)?.value ?: return null
41
+ return value
42
+ }
43
+
44
+ inline fun <R> match(first: (CustomError) -> R, second: (TransactionResult) -> R): R {
45
+ return when (this) {
46
+ is First -> first(value)
47
+ is Second -> second(value)
48
+ }
49
+ }
50
+
51
+ companion object {
52
+ @JvmStatic
53
+ @DoNotStrip
54
+ fun create(value: CustomError): Variant_CustomError_TransactionResult = First(value)
55
+ @JvmStatic
56
+ @DoNotStrip
57
+ fun create(value: TransactionResult): Variant_CustomError_TransactionResult = Second(value)
58
+ }
59
+ }
@@ -0,0 +1,59 @@
1
+ ///
2
+ /// Variant_Double_CustomError.kt
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
+ package com.margelo.nitro.pospagseguro
9
+
10
+ import com.facebook.proguard.annotations.DoNotStrip
11
+
12
+
13
+ /**
14
+ * Represents the TypeScript variant "Double | CustomError".
15
+ */
16
+ @Suppress("ClassName")
17
+ @DoNotStrip
18
+ sealed class Variant_Double_CustomError {
19
+ @DoNotStrip
20
+ data class First(@DoNotStrip val value: Double): Variant_Double_CustomError()
21
+ @DoNotStrip
22
+ data class Second(@DoNotStrip val value: CustomError): Variant_Double_CustomError()
23
+
24
+ @Deprecated("getAs() is not type-safe. Use fold/asFirstOrNull/asSecondOrNull instead.", level = DeprecationLevel.ERROR)
25
+ inline fun <reified T> getAs(): T? = when (this) {
26
+ is First -> value as? T
27
+ is Second -> value as? T
28
+ }
29
+
30
+ val isFirst: Boolean
31
+ get() = this is First
32
+ val isSecond: Boolean
33
+ get() = this is Second
34
+
35
+ fun asFirstOrNull(): Double? {
36
+ val value = (this as? First)?.value ?: return null
37
+ return value
38
+ }
39
+ fun asSecondOrNull(): CustomError? {
40
+ val value = (this as? Second)?.value ?: return null
41
+ return value
42
+ }
43
+
44
+ inline fun <R> match(first: (Double) -> R, second: (CustomError) -> R): R {
45
+ return when (this) {
46
+ is First -> first(value)
47
+ is Second -> second(value)
48
+ }
49
+ }
50
+
51
+ companion object {
52
+ @JvmStatic
53
+ @DoNotStrip
54
+ fun create(value: Double): Variant_Double_CustomError = First(value)
55
+ @JvmStatic
56
+ @DoNotStrip
57
+ fun create(value: CustomError): Variant_Double_CustomError = Second(value)
58
+ }
59
+ }
@@ -0,0 +1,47 @@
1
+ ///
2
+ /// VoidPayData.kt
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
+ package com.margelo.nitro.pospagseguro
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+
13
+
14
+ /**
15
+ * Represents the JavaScript object/struct "VoidPayData".
16
+ */
17
+ @DoNotStrip
18
+ @Keep
19
+ data class VoidPayData(
20
+ @DoNotStrip
21
+ @Keep
22
+ val transaction_code: String,
23
+ @DoNotStrip
24
+ @Keep
25
+ val transaction_id: String,
26
+ @DoNotStrip
27
+ @Keep
28
+ val print_receipt: Boolean?,
29
+ @DoNotStrip
30
+ @Keep
31
+ val void_type: VoidType?
32
+ ) {
33
+ /* primary constructor */
34
+
35
+ companion object {
36
+ /**
37
+ * Constructor called from C++
38
+ */
39
+ @DoNotStrip
40
+ @Keep
41
+ @Suppress("unused")
42
+ @JvmStatic
43
+ private fun fromCpp(transaction_code: String, transaction_id: String, print_receipt: Boolean?, void_type: VoidType?): VoidPayData {
44
+ return VoidPayData(transaction_code, transaction_id, print_receipt, void_type)
45
+ }
46
+ }
47
+ }
@@ -0,0 +1,23 @@
1
+ ///
2
+ /// VoidType.kt
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
+ package com.margelo.nitro.pospagseguro
9
+
10
+ import androidx.annotation.Keep
11
+ import com.facebook.proguard.annotations.DoNotStrip
12
+
13
+ /**
14
+ * Represents the JavaScript enum/union "VoidType".
15
+ */
16
+ @DoNotStrip
17
+ @Keep
18
+ enum class VoidType(@DoNotStrip @Keep val value: Int) {
19
+ PAYMENT(1),
20
+ QRCODE(2);
21
+
22
+ companion object
23
+ }
@@ -0,0 +1,35 @@
1
+ ///
2
+ /// pospagseguroOnLoad.kt
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
+ package com.margelo.nitro.pospagseguro
9
+
10
+ import android.util.Log
11
+
12
+ internal class pospagseguroOnLoad {
13
+ companion object {
14
+ private const val TAG = "pospagseguroOnLoad"
15
+ private var didLoad = false
16
+ /**
17
+ * Initializes the native part of "pospagseguro".
18
+ * This method is idempotent and can be called more than once.
19
+ */
20
+ @JvmStatic
21
+ fun initializeNative() {
22
+ if (didLoad) return
23
+ try {
24
+ Log.i(TAG, "Loading pospagseguro C++ library...")
25
+ System.loadLibrary("pospagseguro")
26
+ Log.i(TAG, "Successfully loaded pospagseguro C++ library!")
27
+ didLoad = true
28
+ } catch (e: Error) {
29
+ Log.e(TAG, "Failed to load pospagseguro C++ library! Is it properly installed and linked? " +
30
+ "Is the name correct? (see `CMakeLists.txt`, at `add_library(...)`)", e)
31
+ throw e
32
+ }
33
+ }
34
+ }
35
+ }
@@ -0,0 +1,83 @@
1
+ #
2
+ # pospagseguro+autolinking.cmake
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
+ # This is a CMake file that adds all files generated by Nitrogen
9
+ # to the current CMake project.
10
+ #
11
+ # To use it, add this to your CMakeLists.txt:
12
+ # ```cmake
13
+ # include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/pospagseguro+autolinking.cmake)
14
+ # ```
15
+
16
+ # Define a flag to check if we are building properly
17
+ add_definitions(-DBUILDING_POSPAGSEGURO_WITH_GENERATED_CMAKE_PROJECT)
18
+
19
+ # Enable Raw Props parsing in react-native (for Nitro Views)
20
+ add_definitions(-DRN_SERIALIZABLE_STATE)
21
+
22
+ # Add all headers that were generated by Nitrogen
23
+ include_directories(
24
+ "../nitrogen/generated/shared/c++"
25
+ "../nitrogen/generated/android/c++"
26
+ "../nitrogen/generated/android/"
27
+ )
28
+
29
+ # Add all .cpp sources that were generated by Nitrogen
30
+ target_sources(
31
+ # CMake project name (Android C++ library name)
32
+ pospagseguro PRIVATE
33
+ # Autolinking Setup
34
+ ../nitrogen/generated/android/pospagseguroOnLoad.cpp
35
+ # Shared Nitrogen C++ sources
36
+ ../nitrogen/generated/shared/c++/HybridPosPagseguroSpec.cpp
37
+ # Android-specific Nitrogen C++ sources
38
+ ../nitrogen/generated/android/c++/JHybridPosPagseguroSpec.cpp
39
+ ../nitrogen/generated/android/c++/JVariant_Double_CustomError.cpp
40
+ ../nitrogen/generated/android/c++/JVariant_CustomError_TransactionResult.cpp
41
+ )
42
+
43
+ # From node_modules/react-native/ReactAndroid/cmake-utils/folly-flags.cmake
44
+ # Used in node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake
45
+ target_compile_definitions(
46
+ pospagseguro PRIVATE
47
+ -DFOLLY_NO_CONFIG=1
48
+ -DFOLLY_HAVE_CLOCK_GETTIME=1
49
+ -DFOLLY_USE_LIBCPP=1
50
+ -DFOLLY_CFG_NO_COROUTINES=1
51
+ -DFOLLY_MOBILE=1
52
+ -DFOLLY_HAVE_RECVMMSG=1
53
+ -DFOLLY_HAVE_PTHREAD=1
54
+ # Once we target android-23 above, we can comment
55
+ # the following line. NDK uses GNU style stderror_r() after API 23.
56
+ -DFOLLY_HAVE_XSI_STRERROR_R=1
57
+ )
58
+
59
+ # Add all libraries required by the generated specs
60
+ find_package(fbjni REQUIRED) # <-- Used for communication between Java <-> C++
61
+ find_package(ReactAndroid REQUIRED) # <-- Used to set up React Native bindings (e.g. CallInvoker/TurboModule)
62
+ find_package(react-native-nitro-modules REQUIRED) # <-- Used to create all HybridObjects and use the Nitro core library
63
+
64
+ # Link all libraries together
65
+ target_link_libraries(
66
+ pospagseguro
67
+ fbjni::fbjni # <-- Facebook C++ JNI helpers
68
+ ReactAndroid::jsi # <-- RN: JSI
69
+ react-native-nitro-modules::NitroModules # <-- NitroModules Core :)
70
+ )
71
+
72
+ # Link react-native (different prefab between RN 0.75 and RN 0.76)
73
+ if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 76)
74
+ target_link_libraries(
75
+ pospagseguro
76
+ ReactAndroid::reactnative # <-- RN: Native Modules umbrella prefab
77
+ )
78
+ else()
79
+ target_link_libraries(
80
+ pospagseguro
81
+ ReactAndroid::react_nativemodule_core # <-- RN: TurboModules Core
82
+ )
83
+ endif()
@@ -0,0 +1,27 @@
1
+ ///
2
+ /// pospagseguro+autolinking.gradle
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
+ /// This is a Gradle file that adds all files generated by Nitrogen
9
+ /// to the current Gradle project.
10
+ ///
11
+ /// To use it, add this to your build.gradle:
12
+ /// ```gradle
13
+ /// apply from: '../nitrogen/generated/android/pospagseguro+autolinking.gradle'
14
+ /// ```
15
+
16
+ logger.warn("[NitroModules] 🔥 pospagseguro is boosted by nitro!")
17
+
18
+ android {
19
+ sourceSets {
20
+ main {
21
+ java.srcDirs += [
22
+ // Nitrogen files
23
+ "${project.projectDir}/../nitrogen/generated/android/kotlin"
24
+ ]
25
+ }
26
+ }
27
+ }