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,234 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// TransactionResult.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
|
+
// Forward declaration of `CardIssuerNationality` to properly resolve imports.
|
|
32
|
+
namespace margelo::nitro::pospagseguro { enum class CardIssuerNationality; }
|
|
33
|
+
|
|
34
|
+
#include <string>
|
|
35
|
+
#include <optional>
|
|
36
|
+
#include "CardIssuerNationality.hpp"
|
|
37
|
+
|
|
38
|
+
namespace margelo::nitro::pospagseguro {
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* A struct which can be represented as a JavaScript object (TransactionResult).
|
|
42
|
+
*/
|
|
43
|
+
struct TransactionResult final {
|
|
44
|
+
public:
|
|
45
|
+
std::optional<std::string> transaction_code SWIFT_PRIVATE;
|
|
46
|
+
std::optional<std::string> transaction_id SWIFT_PRIVATE;
|
|
47
|
+
std::optional<std::string> date SWIFT_PRIVATE;
|
|
48
|
+
std::optional<std::string> time SWIFT_PRIVATE;
|
|
49
|
+
std::optional<std::string> host_nsu SWIFT_PRIVATE;
|
|
50
|
+
std::optional<std::string> card_brand SWIFT_PRIVATE;
|
|
51
|
+
std::optional<std::string> bin SWIFT_PRIVATE;
|
|
52
|
+
std::optional<std::string> holder SWIFT_PRIVATE;
|
|
53
|
+
std::optional<std::string> user_reference SWIFT_PRIVATE;
|
|
54
|
+
std::optional<std::string> terminal_serial_number SWIFT_PRIVATE;
|
|
55
|
+
std::optional<std::string> amount SWIFT_PRIVATE;
|
|
56
|
+
std::optional<std::string> available_balance SWIFT_PRIVATE;
|
|
57
|
+
std::optional<std::string> card_application SWIFT_PRIVATE;
|
|
58
|
+
std::optional<std::string> label SWIFT_PRIVATE;
|
|
59
|
+
std::optional<std::string> holder_name SWIFT_PRIVATE;
|
|
60
|
+
std::optional<std::string> extended_holder_name SWIFT_PRIVATE;
|
|
61
|
+
std::optional<CardIssuerNationality> card_issuer_nationality SWIFT_PRIVATE;
|
|
62
|
+
std::optional<std::string> reader_model SWIFT_PRIVATE;
|
|
63
|
+
std::optional<std::string> nsu SWIFT_PRIVATE;
|
|
64
|
+
std::optional<std::string> auto_code SWIFT_PRIVATE;
|
|
65
|
+
std::optional<double> installments SWIFT_PRIVATE;
|
|
66
|
+
std::optional<double> original_amount SWIFT_PRIVATE;
|
|
67
|
+
std::optional<std::string> buyer_name SWIFT_PRIVATE;
|
|
68
|
+
std::optional<double> payment_type SWIFT_PRIVATE;
|
|
69
|
+
std::optional<std::string> type_transaction SWIFT_PRIVATE;
|
|
70
|
+
std::optional<std::string> app_identification SWIFT_PRIVATE;
|
|
71
|
+
std::optional<std::string> card_hash SWIFT_PRIVATE;
|
|
72
|
+
std::optional<std::string> pre_auto_due_date SWIFT_PRIVATE;
|
|
73
|
+
std::optional<std::string> pre_auto_original_amount SWIFT_PRIVATE;
|
|
74
|
+
std::optional<double> user_registered SWIFT_PRIVATE;
|
|
75
|
+
std::optional<std::string> accumulated_value SWIFT_PRIVATE;
|
|
76
|
+
std::optional<std::string> consumer_identification SWIFT_PRIVATE;
|
|
77
|
+
std::optional<std::string> current_balance SWIFT_PRIVATE;
|
|
78
|
+
std::optional<std::string> consumer_phone_number SWIFT_PRIVATE;
|
|
79
|
+
std::optional<std::string> clube_pag_screens_ids SWIFT_PRIVATE;
|
|
80
|
+
std::optional<std::string> partial_pay_partially_authorized_amount SWIFT_PRIVATE;
|
|
81
|
+
std::optional<std::string> partial_pay_remaining_amount SWIFT_PRIVATE;
|
|
82
|
+
std::optional<std::string> pix_tx_id_code SWIFT_PRIVATE;
|
|
83
|
+
|
|
84
|
+
public:
|
|
85
|
+
TransactionResult() = default;
|
|
86
|
+
explicit TransactionResult(std::optional<std::string> transaction_code, std::optional<std::string> transaction_id, std::optional<std::string> date, std::optional<std::string> time, std::optional<std::string> host_nsu, std::optional<std::string> card_brand, std::optional<std::string> bin, std::optional<std::string> holder, std::optional<std::string> user_reference, std::optional<std::string> terminal_serial_number, std::optional<std::string> amount, std::optional<std::string> available_balance, std::optional<std::string> card_application, std::optional<std::string> label, std::optional<std::string> holder_name, std::optional<std::string> extended_holder_name, std::optional<CardIssuerNationality> card_issuer_nationality, std::optional<std::string> reader_model, std::optional<std::string> nsu, std::optional<std::string> auto_code, std::optional<double> installments, std::optional<double> original_amount, std::optional<std::string> buyer_name, std::optional<double> payment_type, std::optional<std::string> type_transaction, std::optional<std::string> app_identification, std::optional<std::string> card_hash, std::optional<std::string> pre_auto_due_date, std::optional<std::string> pre_auto_original_amount, std::optional<double> user_registered, std::optional<std::string> accumulated_value, std::optional<std::string> consumer_identification, std::optional<std::string> current_balance, std::optional<std::string> consumer_phone_number, std::optional<std::string> clube_pag_screens_ids, std::optional<std::string> partial_pay_partially_authorized_amount, std::optional<std::string> partial_pay_remaining_amount, std::optional<std::string> pix_tx_id_code): transaction_code(transaction_code), transaction_id(transaction_id), date(date), time(time), host_nsu(host_nsu), card_brand(card_brand), bin(bin), holder(holder), user_reference(user_reference), terminal_serial_number(terminal_serial_number), amount(amount), available_balance(available_balance), card_application(card_application), label(label), holder_name(holder_name), extended_holder_name(extended_holder_name), card_issuer_nationality(card_issuer_nationality), reader_model(reader_model), nsu(nsu), auto_code(auto_code), installments(installments), original_amount(original_amount), buyer_name(buyer_name), payment_type(payment_type), type_transaction(type_transaction), app_identification(app_identification), card_hash(card_hash), pre_auto_due_date(pre_auto_due_date), pre_auto_original_amount(pre_auto_original_amount), user_registered(user_registered), accumulated_value(accumulated_value), consumer_identification(consumer_identification), current_balance(current_balance), consumer_phone_number(consumer_phone_number), clube_pag_screens_ids(clube_pag_screens_ids), partial_pay_partially_authorized_amount(partial_pay_partially_authorized_amount), partial_pay_remaining_amount(partial_pay_remaining_amount), pix_tx_id_code(pix_tx_id_code) {}
|
|
87
|
+
|
|
88
|
+
public:
|
|
89
|
+
friend bool operator==(const TransactionResult& lhs, const TransactionResult& rhs) = default;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
} // namespace margelo::nitro::pospagseguro
|
|
93
|
+
|
|
94
|
+
namespace margelo::nitro {
|
|
95
|
+
|
|
96
|
+
// C++ TransactionResult <> JS TransactionResult (object)
|
|
97
|
+
template <>
|
|
98
|
+
struct JSIConverter<margelo::nitro::pospagseguro::TransactionResult> final {
|
|
99
|
+
static inline margelo::nitro::pospagseguro::TransactionResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
100
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
101
|
+
return margelo::nitro::pospagseguro::TransactionResult(
|
|
102
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "transaction_code"))),
|
|
103
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "transaction_id"))),
|
|
104
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "date"))),
|
|
105
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "time"))),
|
|
106
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "host_nsu"))),
|
|
107
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "card_brand"))),
|
|
108
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "bin"))),
|
|
109
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "holder"))),
|
|
110
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "user_reference"))),
|
|
111
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "terminal_serial_number"))),
|
|
112
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "amount"))),
|
|
113
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "available_balance"))),
|
|
114
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "card_application"))),
|
|
115
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "label"))),
|
|
116
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "holder_name"))),
|
|
117
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "extended_holder_name"))),
|
|
118
|
+
JSIConverter<std::optional<margelo::nitro::pospagseguro::CardIssuerNationality>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "card_issuer_nationality"))),
|
|
119
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "reader_model"))),
|
|
120
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "nsu"))),
|
|
121
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "auto_code"))),
|
|
122
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "installments"))),
|
|
123
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "original_amount"))),
|
|
124
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "buyer_name"))),
|
|
125
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "payment_type"))),
|
|
126
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "type_transaction"))),
|
|
127
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "app_identification"))),
|
|
128
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "card_hash"))),
|
|
129
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "pre_auto_due_date"))),
|
|
130
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "pre_auto_original_amount"))),
|
|
131
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "user_registered"))),
|
|
132
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "accumulated_value"))),
|
|
133
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "consumer_identification"))),
|
|
134
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "current_balance"))),
|
|
135
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "consumer_phone_number"))),
|
|
136
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "clube_pag_screens_ids"))),
|
|
137
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "partial_pay_partially_authorized_amount"))),
|
|
138
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "partial_pay_remaining_amount"))),
|
|
139
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "pix_tx_id_code")))
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::pospagseguro::TransactionResult& arg) {
|
|
143
|
+
jsi::Object obj(runtime);
|
|
144
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "transaction_code"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.transaction_code));
|
|
145
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "transaction_id"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.transaction_id));
|
|
146
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "date"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.date));
|
|
147
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "time"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.time));
|
|
148
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "host_nsu"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.host_nsu));
|
|
149
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "card_brand"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.card_brand));
|
|
150
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "bin"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.bin));
|
|
151
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "holder"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.holder));
|
|
152
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "user_reference"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.user_reference));
|
|
153
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "terminal_serial_number"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.terminal_serial_number));
|
|
154
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "amount"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.amount));
|
|
155
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "available_balance"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.available_balance));
|
|
156
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "card_application"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.card_application));
|
|
157
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "label"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.label));
|
|
158
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "holder_name"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.holder_name));
|
|
159
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "extended_holder_name"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.extended_holder_name));
|
|
160
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "card_issuer_nationality"), JSIConverter<std::optional<margelo::nitro::pospagseguro::CardIssuerNationality>>::toJSI(runtime, arg.card_issuer_nationality));
|
|
161
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "reader_model"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.reader_model));
|
|
162
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "nsu"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.nsu));
|
|
163
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "auto_code"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.auto_code));
|
|
164
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "installments"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.installments));
|
|
165
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "original_amount"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.original_amount));
|
|
166
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "buyer_name"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.buyer_name));
|
|
167
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "payment_type"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.payment_type));
|
|
168
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "type_transaction"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.type_transaction));
|
|
169
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "app_identification"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.app_identification));
|
|
170
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "card_hash"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.card_hash));
|
|
171
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "pre_auto_due_date"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.pre_auto_due_date));
|
|
172
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "pre_auto_original_amount"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.pre_auto_original_amount));
|
|
173
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "user_registered"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.user_registered));
|
|
174
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "accumulated_value"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.accumulated_value));
|
|
175
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "consumer_identification"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.consumer_identification));
|
|
176
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "current_balance"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.current_balance));
|
|
177
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "consumer_phone_number"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.consumer_phone_number));
|
|
178
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "clube_pag_screens_ids"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.clube_pag_screens_ids));
|
|
179
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "partial_pay_partially_authorized_amount"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.partial_pay_partially_authorized_amount));
|
|
180
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "partial_pay_remaining_amount"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.partial_pay_remaining_amount));
|
|
181
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "pix_tx_id_code"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.pix_tx_id_code));
|
|
182
|
+
return obj;
|
|
183
|
+
}
|
|
184
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
185
|
+
if (!value.isObject()) {
|
|
186
|
+
return false;
|
|
187
|
+
}
|
|
188
|
+
jsi::Object obj = value.getObject(runtime);
|
|
189
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
190
|
+
return false;
|
|
191
|
+
}
|
|
192
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "transaction_code")))) return false;
|
|
193
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "transaction_id")))) return false;
|
|
194
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "date")))) return false;
|
|
195
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "time")))) return false;
|
|
196
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "host_nsu")))) return false;
|
|
197
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "card_brand")))) return false;
|
|
198
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "bin")))) return false;
|
|
199
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "holder")))) return false;
|
|
200
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "user_reference")))) return false;
|
|
201
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "terminal_serial_number")))) return false;
|
|
202
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "amount")))) return false;
|
|
203
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "available_balance")))) return false;
|
|
204
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "card_application")))) return false;
|
|
205
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "label")))) return false;
|
|
206
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "holder_name")))) return false;
|
|
207
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "extended_holder_name")))) return false;
|
|
208
|
+
if (!JSIConverter<std::optional<margelo::nitro::pospagseguro::CardIssuerNationality>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "card_issuer_nationality")))) return false;
|
|
209
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "reader_model")))) return false;
|
|
210
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "nsu")))) return false;
|
|
211
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "auto_code")))) return false;
|
|
212
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "installments")))) return false;
|
|
213
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "original_amount")))) return false;
|
|
214
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "buyer_name")))) return false;
|
|
215
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "payment_type")))) return false;
|
|
216
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "type_transaction")))) return false;
|
|
217
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "app_identification")))) return false;
|
|
218
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "card_hash")))) return false;
|
|
219
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "pre_auto_due_date")))) return false;
|
|
220
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "pre_auto_original_amount")))) return false;
|
|
221
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "user_registered")))) return false;
|
|
222
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "accumulated_value")))) return false;
|
|
223
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "consumer_identification")))) return false;
|
|
224
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "current_balance")))) return false;
|
|
225
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "consumer_phone_number")))) return false;
|
|
226
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "clube_pag_screens_ids")))) return false;
|
|
227
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "partial_pay_partially_authorized_amount")))) return false;
|
|
228
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "partial_pay_remaining_amount")))) return false;
|
|
229
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "pix_tx_id_code")))) return false;
|
|
230
|
+
return true;
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// UserData.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
|
+
#include <optional>
|
|
35
|
+
|
|
36
|
+
namespace margelo::nitro::pospagseguro {
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* A struct which can be represented as a JavaScript object (UserData).
|
|
40
|
+
*/
|
|
41
|
+
struct UserData final {
|
|
42
|
+
public:
|
|
43
|
+
std::optional<std::string> address SWIFT_PRIVATE;
|
|
44
|
+
std::optional<std::string> city SWIFT_PRIVATE;
|
|
45
|
+
std::optional<std::string> cnpj_cpf SWIFT_PRIVATE;
|
|
46
|
+
std::optional<std::string> address_complement SWIFT_PRIVATE;
|
|
47
|
+
std::optional<std::string> company_name SWIFT_PRIVATE;
|
|
48
|
+
std::optional<std::string> nick_name SWIFT_PRIVATE;
|
|
49
|
+
std::optional<std::string> address_state SWIFT_PRIVATE;
|
|
50
|
+
std::optional<std::string> email SWIFT_PRIVATE;
|
|
51
|
+
|
|
52
|
+
public:
|
|
53
|
+
UserData() = default;
|
|
54
|
+
explicit UserData(std::optional<std::string> address, std::optional<std::string> city, std::optional<std::string> cnpj_cpf, std::optional<std::string> address_complement, std::optional<std::string> company_name, std::optional<std::string> nick_name, std::optional<std::string> address_state, std::optional<std::string> email): address(address), city(city), cnpj_cpf(cnpj_cpf), address_complement(address_complement), company_name(company_name), nick_name(nick_name), address_state(address_state), email(email) {}
|
|
55
|
+
|
|
56
|
+
public:
|
|
57
|
+
friend bool operator==(const UserData& lhs, const UserData& rhs) = default;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
} // namespace margelo::nitro::pospagseguro
|
|
61
|
+
|
|
62
|
+
namespace margelo::nitro {
|
|
63
|
+
|
|
64
|
+
// C++ UserData <> JS UserData (object)
|
|
65
|
+
template <>
|
|
66
|
+
struct JSIConverter<margelo::nitro::pospagseguro::UserData> final {
|
|
67
|
+
static inline margelo::nitro::pospagseguro::UserData fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
68
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
69
|
+
return margelo::nitro::pospagseguro::UserData(
|
|
70
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "address"))),
|
|
71
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "city"))),
|
|
72
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "cnpj_cpf"))),
|
|
73
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "address_complement"))),
|
|
74
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "company_name"))),
|
|
75
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "nick_name"))),
|
|
76
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "address_state"))),
|
|
77
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "email")))
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::pospagseguro::UserData& arg) {
|
|
81
|
+
jsi::Object obj(runtime);
|
|
82
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "address"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.address));
|
|
83
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "city"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.city));
|
|
84
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "cnpj_cpf"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.cnpj_cpf));
|
|
85
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "address_complement"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.address_complement));
|
|
86
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "company_name"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.company_name));
|
|
87
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "nick_name"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.nick_name));
|
|
88
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "address_state"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.address_state));
|
|
89
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "email"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.email));
|
|
90
|
+
return obj;
|
|
91
|
+
}
|
|
92
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
93
|
+
if (!value.isObject()) {
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
jsi::Object obj = value.getObject(runtime);
|
|
97
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "address")))) return false;
|
|
101
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "city")))) return false;
|
|
102
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "cnpj_cpf")))) return false;
|
|
103
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "address_complement")))) return false;
|
|
104
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "company_name")))) return false;
|
|
105
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "nick_name")))) return false;
|
|
106
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "address_state")))) return false;
|
|
107
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "email")))) return false;
|
|
108
|
+
return true;
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// VoidPayData.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
|
+
// Forward declaration of `VoidType` to properly resolve imports.
|
|
32
|
+
namespace margelo::nitro::pospagseguro { enum class VoidType; }
|
|
33
|
+
|
|
34
|
+
#include <string>
|
|
35
|
+
#include <optional>
|
|
36
|
+
#include "VoidType.hpp"
|
|
37
|
+
|
|
38
|
+
namespace margelo::nitro::pospagseguro {
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* A struct which can be represented as a JavaScript object (VoidPayData).
|
|
42
|
+
*/
|
|
43
|
+
struct VoidPayData final {
|
|
44
|
+
public:
|
|
45
|
+
std::string transaction_code SWIFT_PRIVATE;
|
|
46
|
+
std::string transaction_id SWIFT_PRIVATE;
|
|
47
|
+
std::optional<bool> print_receipt SWIFT_PRIVATE;
|
|
48
|
+
std::optional<VoidType> void_type SWIFT_PRIVATE;
|
|
49
|
+
|
|
50
|
+
public:
|
|
51
|
+
VoidPayData() = default;
|
|
52
|
+
explicit VoidPayData(std::string transaction_code, std::string transaction_id, std::optional<bool> print_receipt, std::optional<VoidType> void_type): transaction_code(transaction_code), transaction_id(transaction_id), print_receipt(print_receipt), void_type(void_type) {}
|
|
53
|
+
|
|
54
|
+
public:
|
|
55
|
+
friend bool operator==(const VoidPayData& lhs, const VoidPayData& rhs) = default;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
} // namespace margelo::nitro::pospagseguro
|
|
59
|
+
|
|
60
|
+
namespace margelo::nitro {
|
|
61
|
+
|
|
62
|
+
// C++ VoidPayData <> JS VoidPayData (object)
|
|
63
|
+
template <>
|
|
64
|
+
struct JSIConverter<margelo::nitro::pospagseguro::VoidPayData> final {
|
|
65
|
+
static inline margelo::nitro::pospagseguro::VoidPayData fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
66
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
67
|
+
return margelo::nitro::pospagseguro::VoidPayData(
|
|
68
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "transaction_code"))),
|
|
69
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "transaction_id"))),
|
|
70
|
+
JSIConverter<std::optional<bool>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "print_receipt"))),
|
|
71
|
+
JSIConverter<std::optional<margelo::nitro::pospagseguro::VoidType>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "void_type")))
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::pospagseguro::VoidPayData& arg) {
|
|
75
|
+
jsi::Object obj(runtime);
|
|
76
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "transaction_code"), JSIConverter<std::string>::toJSI(runtime, arg.transaction_code));
|
|
77
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "transaction_id"), JSIConverter<std::string>::toJSI(runtime, arg.transaction_id));
|
|
78
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "print_receipt"), JSIConverter<std::optional<bool>>::toJSI(runtime, arg.print_receipt));
|
|
79
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "void_type"), JSIConverter<std::optional<margelo::nitro::pospagseguro::VoidType>>::toJSI(runtime, arg.void_type));
|
|
80
|
+
return obj;
|
|
81
|
+
}
|
|
82
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
83
|
+
if (!value.isObject()) {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
jsi::Object obj = value.getObject(runtime);
|
|
87
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "transaction_code")))) return false;
|
|
91
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "transaction_id")))) return false;
|
|
92
|
+
if (!JSIConverter<std::optional<bool>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "print_receipt")))) return false;
|
|
93
|
+
if (!JSIConverter<std::optional<margelo::nitro::pospagseguro::VoidType>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "void_type")))) return false;
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// VoidType.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 (VoidType).
|
|
25
|
+
*/
|
|
26
|
+
enum class VoidType {
|
|
27
|
+
PAYMENT SWIFT_NAME(payment) = 1,
|
|
28
|
+
QRCODE SWIFT_NAME(qrcode) = 2,
|
|
29
|
+
} CLOSED_ENUM;
|
|
30
|
+
|
|
31
|
+
} // namespace margelo::nitro::pospagseguro
|
|
32
|
+
|
|
33
|
+
namespace margelo::nitro {
|
|
34
|
+
|
|
35
|
+
// C++ VoidType <> JS VoidType (enum)
|
|
36
|
+
template <>
|
|
37
|
+
struct JSIConverter<margelo::nitro::pospagseguro::VoidType> final {
|
|
38
|
+
static inline margelo::nitro::pospagseguro::VoidType fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
39
|
+
int enumValue = JSIConverter<int>::fromJSI(runtime, arg);
|
|
40
|
+
return static_cast<margelo::nitro::pospagseguro::VoidType>(enumValue);
|
|
41
|
+
}
|
|
42
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::pospagseguro::VoidType arg) {
|
|
43
|
+
int enumValue = static_cast<int>(arg);
|
|
44
|
+
return JSIConverter<int>::toJSI(runtime, enumValue);
|
|
45
|
+
}
|
|
46
|
+
static inline bool canConvert(jsi::Runtime&, const jsi::Value& value) {
|
|
47
|
+
if (!value.isNumber()) {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
double number = value.getNumber();
|
|
51
|
+
int integer = static_cast<int>(number);
|
|
52
|
+
if (number != integer) {
|
|
53
|
+
// The integer is not the same value as the double - we truncated floating points.
|
|
54
|
+
// Enums are all integers, so the input floating point number is obviously invalid.
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
// Check if we are within the bounds of the enum.
|
|
58
|
+
return integer >= 1 && integer <= 2;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
} // namespace margelo::nitro
|