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,75 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JVariant_CustomError_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
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include <variant>
|
|
12
|
+
|
|
13
|
+
#include "CustomError.hpp"
|
|
14
|
+
#include "TransactionResult.hpp"
|
|
15
|
+
#include <variant>
|
|
16
|
+
#include "JCustomError.hpp"
|
|
17
|
+
#include <string>
|
|
18
|
+
#include "JTransactionResult.hpp"
|
|
19
|
+
#include <optional>
|
|
20
|
+
#include "CardIssuerNationality.hpp"
|
|
21
|
+
#include "JCardIssuerNationality.hpp"
|
|
22
|
+
|
|
23
|
+
namespace margelo::nitro::pospagseguro {
|
|
24
|
+
|
|
25
|
+
using namespace facebook;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* The C++ JNI bridge between the C++ std::variant and the Java class "Variant_CustomError_TransactionResult".
|
|
29
|
+
*/
|
|
30
|
+
class JVariant_CustomError_TransactionResult: public jni::JavaClass<JVariant_CustomError_TransactionResult> {
|
|
31
|
+
public:
|
|
32
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/pospagseguro/Variant_CustomError_TransactionResult;";
|
|
33
|
+
|
|
34
|
+
static jni::local_ref<JVariant_CustomError_TransactionResult> create_0(jni::alias_ref<JCustomError> value) {
|
|
35
|
+
static const auto method = javaClassStatic()->getStaticMethod<JVariant_CustomError_TransactionResult(jni::alias_ref<JCustomError>)>("create");
|
|
36
|
+
return method(javaClassStatic(), value);
|
|
37
|
+
}
|
|
38
|
+
static jni::local_ref<JVariant_CustomError_TransactionResult> create_1(jni::alias_ref<JTransactionResult> value) {
|
|
39
|
+
static const auto method = javaClassStatic()->getStaticMethod<JVariant_CustomError_TransactionResult(jni::alias_ref<JTransactionResult>)>("create");
|
|
40
|
+
return method(javaClassStatic(), value);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
static jni::local_ref<JVariant_CustomError_TransactionResult> fromCpp(const std::variant<CustomError, TransactionResult>& variant) {
|
|
44
|
+
switch (variant.index()) {
|
|
45
|
+
case 0: return create_0(JCustomError::fromCpp(std::get<0>(variant)));
|
|
46
|
+
case 1: return create_1(JTransactionResult::fromCpp(std::get<1>(variant)));
|
|
47
|
+
default: throw std::invalid_argument("Variant holds unknown index! (" + std::to_string(variant.index()) + ")");
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
[[nodiscard]] std::variant<CustomError, TransactionResult> toCpp() const;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
namespace JVariant_CustomError_TransactionResult_impl {
|
|
55
|
+
class First final: public jni::JavaClass<First, JVariant_CustomError_TransactionResult> {
|
|
56
|
+
public:
|
|
57
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/pospagseguro/Variant_CustomError_TransactionResult$First;";
|
|
58
|
+
|
|
59
|
+
[[nodiscard]] jni::local_ref<JCustomError> getValue() const {
|
|
60
|
+
static const auto field = javaClassStatic()->getField<JCustomError>("value");
|
|
61
|
+
return getFieldValue(field);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
class Second final: public jni::JavaClass<Second, JVariant_CustomError_TransactionResult> {
|
|
66
|
+
public:
|
|
67
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/pospagseguro/Variant_CustomError_TransactionResult$Second;";
|
|
68
|
+
|
|
69
|
+
[[nodiscard]] jni::local_ref<JTransactionResult> getValue() const {
|
|
70
|
+
static const auto field = javaClassStatic()->getField<JTransactionResult>("value");
|
|
71
|
+
return getFieldValue(field);
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
} // namespace JVariant_CustomError_TransactionResult_impl
|
|
75
|
+
} // namespace margelo::nitro::pospagseguro
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JVariant_Double_CustomError.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 "JVariant_Double_CustomError.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::pospagseguro {
|
|
11
|
+
/**
|
|
12
|
+
* Converts JVariant_Double_CustomError to std::variant<double, CustomError>
|
|
13
|
+
*/
|
|
14
|
+
std::variant<double, CustomError> JVariant_Double_CustomError::toCpp() const {
|
|
15
|
+
if (isInstanceOf(JVariant_Double_CustomError_impl::First::javaClassStatic())) {
|
|
16
|
+
// It's a `double`
|
|
17
|
+
auto jniValue = static_cast<const JVariant_Double_CustomError_impl::First*>(this)->getValue();
|
|
18
|
+
return jniValue;
|
|
19
|
+
} else if (isInstanceOf(JVariant_Double_CustomError_impl::Second::javaClassStatic())) {
|
|
20
|
+
// It's a `CustomError`
|
|
21
|
+
auto jniValue = static_cast<const JVariant_Double_CustomError_impl::Second*>(this)->getValue();
|
|
22
|
+
return jniValue->toCpp();
|
|
23
|
+
}
|
|
24
|
+
throw std::invalid_argument("Variant is unknown Kotlin instance!");
|
|
25
|
+
}
|
|
26
|
+
} // namespace margelo::nitro::pospagseguro
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JVariant_Double_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
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include <variant>
|
|
12
|
+
|
|
13
|
+
#include "CustomError.hpp"
|
|
14
|
+
#include <variant>
|
|
15
|
+
#include "JCustomError.hpp"
|
|
16
|
+
#include <string>
|
|
17
|
+
|
|
18
|
+
namespace margelo::nitro::pospagseguro {
|
|
19
|
+
|
|
20
|
+
using namespace facebook;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The C++ JNI bridge between the C++ std::variant and the Java class "Variant_Double_CustomError".
|
|
24
|
+
*/
|
|
25
|
+
class JVariant_Double_CustomError: public jni::JavaClass<JVariant_Double_CustomError> {
|
|
26
|
+
public:
|
|
27
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/pospagseguro/Variant_Double_CustomError;";
|
|
28
|
+
|
|
29
|
+
static jni::local_ref<JVariant_Double_CustomError> create_0(double value) {
|
|
30
|
+
static const auto method = javaClassStatic()->getStaticMethod<JVariant_Double_CustomError(double)>("create");
|
|
31
|
+
return method(javaClassStatic(), value);
|
|
32
|
+
}
|
|
33
|
+
static jni::local_ref<JVariant_Double_CustomError> create_1(jni::alias_ref<JCustomError> value) {
|
|
34
|
+
static const auto method = javaClassStatic()->getStaticMethod<JVariant_Double_CustomError(jni::alias_ref<JCustomError>)>("create");
|
|
35
|
+
return method(javaClassStatic(), value);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
static jni::local_ref<JVariant_Double_CustomError> fromCpp(const std::variant<double, CustomError>& variant) {
|
|
39
|
+
switch (variant.index()) {
|
|
40
|
+
case 0: return create_0(std::get<0>(variant));
|
|
41
|
+
case 1: return create_1(JCustomError::fromCpp(std::get<1>(variant)));
|
|
42
|
+
default: throw std::invalid_argument("Variant holds unknown index! (" + std::to_string(variant.index()) + ")");
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
[[nodiscard]] std::variant<double, CustomError> toCpp() const;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
namespace JVariant_Double_CustomError_impl {
|
|
50
|
+
class First final: public jni::JavaClass<First, JVariant_Double_CustomError> {
|
|
51
|
+
public:
|
|
52
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/pospagseguro/Variant_Double_CustomError$First;";
|
|
53
|
+
|
|
54
|
+
[[nodiscard]] double getValue() const {
|
|
55
|
+
static const auto field = javaClassStatic()->getField<double>("value");
|
|
56
|
+
return getFieldValue(field);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
class Second final: public jni::JavaClass<Second, JVariant_Double_CustomError> {
|
|
61
|
+
public:
|
|
62
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/pospagseguro/Variant_Double_CustomError$Second;";
|
|
63
|
+
|
|
64
|
+
[[nodiscard]] jni::local_ref<JCustomError> getValue() const {
|
|
65
|
+
static const auto field = javaClassStatic()->getField<JCustomError>("value");
|
|
66
|
+
return getFieldValue(field);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
} // namespace JVariant_Double_CustomError_impl
|
|
70
|
+
} // namespace margelo::nitro::pospagseguro
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JVoidPayData.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
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "VoidPayData.hpp"
|
|
12
|
+
|
|
13
|
+
#include "JVoidType.hpp"
|
|
14
|
+
#include "VoidType.hpp"
|
|
15
|
+
#include <optional>
|
|
16
|
+
#include <string>
|
|
17
|
+
|
|
18
|
+
namespace margelo::nitro::pospagseguro {
|
|
19
|
+
|
|
20
|
+
using namespace facebook;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The C++ JNI bridge between the C++ struct "VoidPayData" and the the Kotlin data class "VoidPayData".
|
|
24
|
+
*/
|
|
25
|
+
struct JVoidPayData final: public jni::JavaClass<JVoidPayData> {
|
|
26
|
+
public:
|
|
27
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/pospagseguro/VoidPayData;";
|
|
28
|
+
|
|
29
|
+
public:
|
|
30
|
+
/**
|
|
31
|
+
* Convert this Java/Kotlin-based struct to the C++ struct VoidPayData by copying all values to C++.
|
|
32
|
+
*/
|
|
33
|
+
[[maybe_unused]]
|
|
34
|
+
[[nodiscard]]
|
|
35
|
+
VoidPayData toCpp() const {
|
|
36
|
+
static const auto clazz = javaClassStatic();
|
|
37
|
+
static const auto fieldTransaction_code = clazz->getField<jni::JString>("transaction_code");
|
|
38
|
+
jni::local_ref<jni::JString> transaction_code = this->getFieldValue(fieldTransaction_code);
|
|
39
|
+
static const auto fieldTransaction_id = clazz->getField<jni::JString>("transaction_id");
|
|
40
|
+
jni::local_ref<jni::JString> transaction_id = this->getFieldValue(fieldTransaction_id);
|
|
41
|
+
static const auto fieldPrint_receipt = clazz->getField<jni::JBoolean>("print_receipt");
|
|
42
|
+
jni::local_ref<jni::JBoolean> print_receipt = this->getFieldValue(fieldPrint_receipt);
|
|
43
|
+
static const auto fieldVoid_type = clazz->getField<JVoidType>("void_type");
|
|
44
|
+
jni::local_ref<JVoidType> void_type = this->getFieldValue(fieldVoid_type);
|
|
45
|
+
return VoidPayData(
|
|
46
|
+
transaction_code->toStdString(),
|
|
47
|
+
transaction_id->toStdString(),
|
|
48
|
+
print_receipt != nullptr ? std::make_optional(static_cast<bool>(print_receipt->value())) : std::nullopt,
|
|
49
|
+
void_type != nullptr ? std::make_optional(void_type->toCpp()) : std::nullopt
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
public:
|
|
54
|
+
/**
|
|
55
|
+
* Create a Java/Kotlin-based struct by copying all values from the given C++ struct to Java.
|
|
56
|
+
*/
|
|
57
|
+
[[maybe_unused]]
|
|
58
|
+
static jni::local_ref<JVoidPayData::javaobject> fromCpp(const VoidPayData& value) {
|
|
59
|
+
using JSignature = JVoidPayData(jni::alias_ref<jni::JString>, jni::alias_ref<jni::JString>, jni::alias_ref<jni::JBoolean>, jni::alias_ref<JVoidType>);
|
|
60
|
+
static const auto clazz = javaClassStatic();
|
|
61
|
+
static const auto create = clazz->getStaticMethod<JSignature>("fromCpp");
|
|
62
|
+
return create(
|
|
63
|
+
clazz,
|
|
64
|
+
jni::make_jstring(value.transaction_code),
|
|
65
|
+
jni::make_jstring(value.transaction_id),
|
|
66
|
+
value.print_receipt.has_value() ? jni::JBoolean::valueOf(value.print_receipt.value()) : nullptr,
|
|
67
|
+
value.void_type.has_value() ? JVoidType::fromCpp(value.void_type.value()) : nullptr
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
} // namespace margelo::nitro::pospagseguro
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// JVoidType.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
|
+
#include <fbjni/fbjni.h>
|
|
11
|
+
#include "VoidType.hpp"
|
|
12
|
+
|
|
13
|
+
namespace margelo::nitro::pospagseguro {
|
|
14
|
+
|
|
15
|
+
using namespace facebook;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The C++ JNI bridge between the C++ enum "VoidType" and the the Kotlin enum "VoidType".
|
|
19
|
+
*/
|
|
20
|
+
struct JVoidType final: public jni::JavaClass<JVoidType> {
|
|
21
|
+
public:
|
|
22
|
+
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/pospagseguro/VoidType;";
|
|
23
|
+
|
|
24
|
+
public:
|
|
25
|
+
/**
|
|
26
|
+
* Convert this Java/Kotlin-based enum to the C++ enum VoidType.
|
|
27
|
+
*/
|
|
28
|
+
[[maybe_unused]]
|
|
29
|
+
[[nodiscard]]
|
|
30
|
+
VoidType toCpp() const {
|
|
31
|
+
static const auto clazz = javaClassStatic();
|
|
32
|
+
static const auto fieldOrdinal = clazz->getField<int>("value");
|
|
33
|
+
int ordinal = this->getFieldValue(fieldOrdinal);
|
|
34
|
+
return static_cast<VoidType>(ordinal);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public:
|
|
38
|
+
/**
|
|
39
|
+
* Create a Java/Kotlin-based enum with the given C++ enum's value.
|
|
40
|
+
*/
|
|
41
|
+
[[maybe_unused]]
|
|
42
|
+
static jni::alias_ref<JVoidType> fromCpp(VoidType value) {
|
|
43
|
+
static const auto clazz = javaClassStatic();
|
|
44
|
+
switch (value) {
|
|
45
|
+
case VoidType::PAYMENT:
|
|
46
|
+
static const auto fieldPAYMENT = clazz->getStaticField<JVoidType>("PAYMENT");
|
|
47
|
+
return clazz->getStaticFieldValue(fieldPAYMENT);
|
|
48
|
+
case VoidType::QRCODE:
|
|
49
|
+
static const auto fieldQRCODE = clazz->getStaticField<JVoidType>("QRCODE");
|
|
50
|
+
return clazz->getStaticFieldValue(fieldQRCODE);
|
|
51
|
+
default:
|
|
52
|
+
std::string stringValue = std::to_string(static_cast<int>(value));
|
|
53
|
+
throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
} // namespace margelo::nitro::pospagseguro
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Capabilities.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 "Capabilities".
|
|
15
|
+
*/
|
|
16
|
+
@DoNotStrip
|
|
17
|
+
@Keep
|
|
18
|
+
enum class Capabilities(@DoNotStrip @Keep val value: Int) {
|
|
19
|
+
MAG(1),
|
|
20
|
+
ICC(2),
|
|
21
|
+
PICC(3),
|
|
22
|
+
PED(4),
|
|
23
|
+
KEYBOARD(5),
|
|
24
|
+
PRINTER(6),
|
|
25
|
+
BLUETOOTH(7),
|
|
26
|
+
CASH_BOX(8),
|
|
27
|
+
CUSTOMER_DISPLAY(9),
|
|
28
|
+
ETHERNET(10),
|
|
29
|
+
FINGERPRINT_READER(11),
|
|
30
|
+
G_SENSOR(12),
|
|
31
|
+
HDMI(13),
|
|
32
|
+
ID_CARD_READER(14),
|
|
33
|
+
SM(15),
|
|
34
|
+
MODEM(16);
|
|
35
|
+
|
|
36
|
+
companion object
|
|
37
|
+
}
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/pospagseguro/CardIssuerNationality.kt
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// CardIssuerNationality.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 "CardIssuerNationality".
|
|
15
|
+
*/
|
|
16
|
+
@DoNotStrip
|
|
17
|
+
@Keep
|
|
18
|
+
enum class CardIssuerNationality(@DoNotStrip @Keep val value: Int) {
|
|
19
|
+
UNAVAILABLE(0),
|
|
20
|
+
DOMESTIC(1),
|
|
21
|
+
INTERNATIONAL(2);
|
|
22
|
+
|
|
23
|
+
companion object
|
|
24
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// 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 androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Represents the JavaScript object/struct "CustomError".
|
|
16
|
+
*/
|
|
17
|
+
@DoNotStrip
|
|
18
|
+
@Keep
|
|
19
|
+
data class CustomError(
|
|
20
|
+
@DoNotStrip
|
|
21
|
+
@Keep
|
|
22
|
+
val code: String,
|
|
23
|
+
@DoNotStrip
|
|
24
|
+
@Keep
|
|
25
|
+
val message: String
|
|
26
|
+
) {
|
|
27
|
+
/* primary constructor */
|
|
28
|
+
|
|
29
|
+
companion object {
|
|
30
|
+
/**
|
|
31
|
+
* Constructor called from C++
|
|
32
|
+
*/
|
|
33
|
+
@DoNotStrip
|
|
34
|
+
@Keep
|
|
35
|
+
@Suppress("unused")
|
|
36
|
+
@JvmStatic
|
|
37
|
+
private fun fromCpp(code: String, message: String): CustomError {
|
|
38
|
+
return CustomError(code, message)
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/pospagseguro/Func_void_std__string.kt
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Func_void_std__string.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.jni.HybridData
|
|
12
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
13
|
+
import dalvik.annotation.optimization.FastNative
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Represents the JavaScript callback `(event: string) => void`.
|
|
18
|
+
* This can be either implemented in C++ (in which case it might be a callback coming from JS),
|
|
19
|
+
* or in Kotlin/Java (in which case it is a native callback).
|
|
20
|
+
*/
|
|
21
|
+
@DoNotStrip
|
|
22
|
+
@Keep
|
|
23
|
+
@Suppress("ClassName", "RedundantUnitReturnType")
|
|
24
|
+
fun interface Func_void_std__string: (String) -> Unit {
|
|
25
|
+
/**
|
|
26
|
+
* Call the given JS callback.
|
|
27
|
+
* @throws Throwable if the JS function itself throws an error, or if the JS function/runtime has already been deleted.
|
|
28
|
+
*/
|
|
29
|
+
@DoNotStrip
|
|
30
|
+
@Keep
|
|
31
|
+
override fun invoke(event: String): Unit
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Represents the JavaScript callback `(event: string) => void`.
|
|
36
|
+
* This is implemented in C++, via a `std::function<...>`.
|
|
37
|
+
* The callback might be coming from JS.
|
|
38
|
+
*/
|
|
39
|
+
@DoNotStrip
|
|
40
|
+
@Keep
|
|
41
|
+
@Suppress(
|
|
42
|
+
"KotlinJniMissingFunction", "unused",
|
|
43
|
+
"RedundantSuppression", "RedundantUnitReturnType", "FunctionName",
|
|
44
|
+
"ConvertSecondaryConstructorToPrimary", "ClassName", "LocalVariableName",
|
|
45
|
+
)
|
|
46
|
+
class Func_void_std__string_cxx: Func_void_std__string {
|
|
47
|
+
@DoNotStrip
|
|
48
|
+
@Keep
|
|
49
|
+
private val mHybridData: HybridData
|
|
50
|
+
|
|
51
|
+
@DoNotStrip
|
|
52
|
+
@Keep
|
|
53
|
+
private constructor(hybridData: HybridData) {
|
|
54
|
+
mHybridData = hybridData
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
@DoNotStrip
|
|
58
|
+
@Keep
|
|
59
|
+
override fun invoke(event: String): Unit
|
|
60
|
+
= invoke_cxx(event)
|
|
61
|
+
|
|
62
|
+
@FastNative
|
|
63
|
+
private external fun invoke_cxx(event: String): Unit
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Represents the JavaScript callback `(event: string) => void`.
|
|
68
|
+
* This is implemented in Java/Kotlin, via a `(String) -> Unit`.
|
|
69
|
+
* The callback is always coming from native.
|
|
70
|
+
*/
|
|
71
|
+
@DoNotStrip
|
|
72
|
+
@Keep
|
|
73
|
+
@Suppress("ClassName", "RedundantUnitReturnType", "unused")
|
|
74
|
+
class Func_void_std__string_java(private val function: (String) -> Unit): Func_void_std__string {
|
|
75
|
+
@DoNotStrip
|
|
76
|
+
@Keep
|
|
77
|
+
override fun invoke(event: String): Unit {
|
|
78
|
+
return this.function(event)
|
|
79
|
+
}
|
|
80
|
+
}
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/pospagseguro/HybridPosPagseguroSpec.kt
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridPosPagseguroSpec.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.jni.HybridData
|
|
12
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
13
|
+
import com.margelo.nitro.core.Promise
|
|
14
|
+
import com.margelo.nitro.core.HybridObject
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* A Kotlin class representing the PosPagseguro HybridObject.
|
|
18
|
+
* Implement this abstract class to create Kotlin-based instances of PosPagseguro.
|
|
19
|
+
*/
|
|
20
|
+
@DoNotStrip
|
|
21
|
+
@Keep
|
|
22
|
+
@Suppress(
|
|
23
|
+
"KotlinJniMissingFunction", "unused",
|
|
24
|
+
"RedundantSuppression", "RedundantUnitReturnType", "SimpleRedundantLet",
|
|
25
|
+
"LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName"
|
|
26
|
+
)
|
|
27
|
+
abstract class HybridPosPagseguroSpec: HybridObject() {
|
|
28
|
+
@DoNotStrip
|
|
29
|
+
private var mHybridData: HybridData = initHybrid()
|
|
30
|
+
|
|
31
|
+
init {
|
|
32
|
+
super.updateNative(mHybridData)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
override fun updateNative(hybridData: HybridData) {
|
|
36
|
+
mHybridData = hybridData
|
|
37
|
+
super.updateNative(hybridData)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Default implementation of `HybridObject.toString()`
|
|
41
|
+
override fun toString(): String {
|
|
42
|
+
return "[HybridObject PosPagseguro]"
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Properties
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
// Methods
|
|
49
|
+
@DoNotStrip
|
|
50
|
+
@Keep
|
|
51
|
+
abstract fun getModel(): String
|
|
52
|
+
|
|
53
|
+
@DoNotStrip
|
|
54
|
+
@Keep
|
|
55
|
+
abstract fun getSerialNumber(): String
|
|
56
|
+
|
|
57
|
+
@DoNotStrip
|
|
58
|
+
@Keep
|
|
59
|
+
abstract fun getSubAcquirerData(): SubAcquirer?
|
|
60
|
+
|
|
61
|
+
@DoNotStrip
|
|
62
|
+
@Keep
|
|
63
|
+
abstract fun getUserData(): UserData
|
|
64
|
+
|
|
65
|
+
@DoNotStrip
|
|
66
|
+
@Keep
|
|
67
|
+
abstract fun reboot(): Unit
|
|
68
|
+
|
|
69
|
+
@DoNotStrip
|
|
70
|
+
@Keep
|
|
71
|
+
abstract fun reprintCustomerReceipt(): Promise<Variant_Double_CustomError>
|
|
72
|
+
|
|
73
|
+
@DoNotStrip
|
|
74
|
+
@Keep
|
|
75
|
+
abstract fun reprintStablishmentReceipt(): Promise<Variant_Double_CustomError>
|
|
76
|
+
|
|
77
|
+
@DoNotStrip
|
|
78
|
+
@Keep
|
|
79
|
+
abstract fun printFromFile(file_path: String, quality: Double, bottomPad: Double?): Promise<Variant_Double_CustomError>
|
|
80
|
+
|
|
81
|
+
@DoNotStrip
|
|
82
|
+
@Keep
|
|
83
|
+
abstract fun printFromBase64(base_64: String, quality: Double, bottomPad: Double?): Promise<Variant_Double_CustomError>
|
|
84
|
+
|
|
85
|
+
@DoNotStrip
|
|
86
|
+
@Keep
|
|
87
|
+
abstract fun abort(): CustomError?
|
|
88
|
+
|
|
89
|
+
@DoNotStrip
|
|
90
|
+
@Keep
|
|
91
|
+
abstract fun isServiceBusy(): Boolean
|
|
92
|
+
|
|
93
|
+
@DoNotStrip
|
|
94
|
+
@Keep
|
|
95
|
+
abstract fun isAuthenticated(): Boolean
|
|
96
|
+
|
|
97
|
+
@DoNotStrip
|
|
98
|
+
@Keep
|
|
99
|
+
abstract fun hasCapability(capability: Capabilities): Boolean
|
|
100
|
+
|
|
101
|
+
@DoNotStrip
|
|
102
|
+
@Keep
|
|
103
|
+
abstract fun initialize(activation_code: String): Unit
|
|
104
|
+
|
|
105
|
+
abstract fun doPayment(payment_data: PaymentData, process_callback: (event: String) -> Unit): Promise<Variant_CustomError_TransactionResult>
|
|
106
|
+
|
|
107
|
+
@DoNotStrip
|
|
108
|
+
@Keep
|
|
109
|
+
private fun doPayment_cxx(payment_data: PaymentData, process_callback: Func_void_std__string): Promise<Variant_CustomError_TransactionResult> {
|
|
110
|
+
val __result = doPayment(payment_data, process_callback)
|
|
111
|
+
return __result
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
abstract fun voidPayment(void_data: VoidPayData, process_callback: (event: String) -> Unit): Promise<Variant_CustomError_TransactionResult>
|
|
115
|
+
|
|
116
|
+
@DoNotStrip
|
|
117
|
+
@Keep
|
|
118
|
+
private fun voidPayment_cxx(void_data: VoidPayData, process_callback: Func_void_std__string): Promise<Variant_CustomError_TransactionResult> {
|
|
119
|
+
val __result = voidPayment(void_data, process_callback)
|
|
120
|
+
return __result
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
@DoNotStrip
|
|
124
|
+
@Keep
|
|
125
|
+
abstract fun getLastApprovedTransaction(): Variant_CustomError_TransactionResult
|
|
126
|
+
|
|
127
|
+
private external fun initHybrid(): HybridData
|
|
128
|
+
|
|
129
|
+
companion object {
|
|
130
|
+
protected const val TAG = "HybridPosPagseguroSpec"
|
|
131
|
+
}
|
|
132
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// InstallmentTypes.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 "InstallmentTypes".
|
|
15
|
+
*/
|
|
16
|
+
@DoNotStrip
|
|
17
|
+
@Keep
|
|
18
|
+
enum class InstallmentTypes(@DoNotStrip @Keep val value: Int) {
|
|
19
|
+
NO_INSTALLMENT(1),
|
|
20
|
+
SELLER_INSTALLMENT(2),
|
|
21
|
+
BUYER_INSTALLMENT(3);
|
|
22
|
+
|
|
23
|
+
companion object
|
|
24
|
+
}
|