paynl-pos-sdk-react-native 0.0.16
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/PaynlSdkReactNative.podspec +44 -0
- package/README.md +4 -0
- package/android/build.gradle +115 -0
- package/android/generated/java/com/paynl/sdk/reactnative/NativePayNlSdkSpec.java +82 -0
- package/android/generated/jni/CMakeLists.txt +36 -0
- package/android/generated/jni/RNPaynlSdkSpec-generated.cpp +88 -0
- package/android/generated/jni/RNPaynlSdkSpec.h +31 -0
- package/android/generated/jni/react/renderer/components/RNPaynlSdkSpec/RNPaynlSdkSpecJSI-generated.cpp +92 -0
- package/android/generated/jni/react/renderer/components/RNPaynlSdkSpec/RNPaynlSdkSpecJSI.h +1876 -0
- package/android/gradle.properties +7 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/java/com/paynl/sdk/reactnative/PayNlSdkPackage.kt +34 -0
- package/android/src/main/java/com/paynl/sdk/reactnative/PayNlUtils.kt +289 -0
- package/android/src/newarch/java/com/paynl/sdk/reactnative/PayNlSdkModule.kt +212 -0
- package/android/src/oldarch/java/com/paynl/sdk/reactnative/PayNlSdkModule.kt +233 -0
- package/ios/PayNlPosService.swift +203 -0
- package/ios/PaynlSdk.h +16 -0
- package/ios/PaynlSdk.mm +260 -0
- package/ios/generated/RNPaynlSdkSpec/RNPaynlSdkSpec-generated.mm +210 -0
- package/ios/generated/RNPaynlSdkSpec/RNPaynlSdkSpec.h +935 -0
- package/ios/generated/RNPaynlSdkSpecJSI-generated.cpp +92 -0
- package/ios/generated/RNPaynlSdkSpecJSI.h +1876 -0
- package/lib/commonjs/NativePayNlSdk.js +9 -0
- package/lib/commonjs/NativePayNlSdk.js.map +1 -0
- package/lib/commonjs/index.js +14 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/module/NativePayNlSdk.js +5 -0
- package/lib/module/NativePayNlSdk.js.map +1 -0
- package/lib/module/index.js +5 -0
- package/lib/module/index.js.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/src/NativePayNlSdk.d.ts +346 -0
- package/lib/typescript/commonjs/src/NativePayNlSdk.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +5 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/src/NativePayNlSdk.d.ts +346 -0
- package/lib/typescript/module/src/NativePayNlSdk.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +5 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -0
- package/package.json +157 -0
- package/react-native.config.js +12 -0
- package/src/NativePayNlSdk.ts +393 -0
- package/src/index.ts +5 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
require "json"
|
|
2
|
+
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
4
|
+
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
|
|
5
|
+
|
|
6
|
+
Pod::Spec.new do |s|
|
|
7
|
+
s.name = "PaynlSdkReactNative"
|
|
8
|
+
s.version = package["version"]
|
|
9
|
+
s.summary = package["description"]
|
|
10
|
+
s.homepage = package["homepage"]
|
|
11
|
+
s.license = package["license"]
|
|
12
|
+
s.authors = package["author"]
|
|
13
|
+
|
|
14
|
+
s.platforms = { :ios => '18.0' }
|
|
15
|
+
s.source = { :git => "https://github.com/paynl/pos-sdk.git", :tag => "#{s.version}" }
|
|
16
|
+
|
|
17
|
+
s.source_files = "ios/**/*.{h,mm,swift}"
|
|
18
|
+
s.private_header_files = "ios/**/*.h"
|
|
19
|
+
|
|
20
|
+
s.dependency 'PayNlPOSSdkSwift', '~> 0.0.20'
|
|
21
|
+
|
|
22
|
+
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
|
|
23
|
+
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
|
|
24
|
+
if respond_to?(:install_modules_dependencies, true)
|
|
25
|
+
install_modules_dependencies(s)
|
|
26
|
+
else
|
|
27
|
+
s.dependency "React-Core"
|
|
28
|
+
|
|
29
|
+
# Don't install the dependencies when we run `pod install` in the old architecture.
|
|
30
|
+
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
|
|
31
|
+
s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
|
|
32
|
+
s.pod_target_xcconfig = {
|
|
33
|
+
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
|
|
34
|
+
"OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
|
|
35
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
|
|
36
|
+
}
|
|
37
|
+
s.dependency "React-Codegen"
|
|
38
|
+
s.dependency "RCT-Folly"
|
|
39
|
+
s.dependency "RCTRequired"
|
|
40
|
+
s.dependency "RCTTypeSafety"
|
|
41
|
+
s.dependency "ReactCommon/turbomodule/core"
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
package/README.md
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
buildscript {
|
|
2
|
+
ext.getExtOrDefault = { name ->
|
|
3
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['PaynlSdkReactNative_' + name]
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
repositories {
|
|
7
|
+
google()
|
|
8
|
+
mavenCentral()
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
dependencies {
|
|
12
|
+
classpath "com.android.tools.build:gradle:8.7.2"
|
|
13
|
+
// noinspection DifferentKotlinGradleVersion
|
|
14
|
+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def isNewArchitectureEnabled() {
|
|
20
|
+
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
apply plugin: "com.android.library"
|
|
24
|
+
apply plugin: "kotlin-android"
|
|
25
|
+
|
|
26
|
+
if (isNewArchitectureEnabled()) {
|
|
27
|
+
apply plugin: "com.facebook.react"
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
def getExtOrIntegerDefault(name) {
|
|
31
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["PaynlSdkReactNative_" + name]).toInteger()
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
android {
|
|
35
|
+
namespace "com.paynl.sdk.reactnative"
|
|
36
|
+
|
|
37
|
+
sourceSets {
|
|
38
|
+
main {
|
|
39
|
+
manifest.srcFile "src/main/AndroidManifest.xml"
|
|
40
|
+
|
|
41
|
+
if (isNewArchitectureEnabled()) {
|
|
42
|
+
java.srcDirs += ['src/newarch']
|
|
43
|
+
} else {
|
|
44
|
+
java.srcDirs += ['src/oldarch']
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
|
|
50
|
+
|
|
51
|
+
defaultConfig {
|
|
52
|
+
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
|
|
53
|
+
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
|
|
54
|
+
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
buildFeatures {
|
|
58
|
+
buildConfig true
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
buildTypes {
|
|
62
|
+
debug {
|
|
63
|
+
minifyEnabled false
|
|
64
|
+
}
|
|
65
|
+
release {
|
|
66
|
+
minifyEnabled false
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
lintOptions {
|
|
71
|
+
disable "GradleCompatible"
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
compileOptions {
|
|
75
|
+
sourceCompatibility JavaVersion.VERSION_1_8
|
|
76
|
+
targetCompatibility JavaVersion.VERSION_1_8
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
sourceSets {
|
|
80
|
+
main {
|
|
81
|
+
if (isNewArchitectureEnabled()) {
|
|
82
|
+
java.srcDirs += [
|
|
83
|
+
"generated/java",
|
|
84
|
+
"generated/jni"
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
repositories {
|
|
92
|
+
mavenCentral()
|
|
93
|
+
google()
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
def kotlin_version = getExtOrDefault("kotlinVersion")
|
|
97
|
+
def PAYNL_PACKAGE = getExtOrDefault("paynlPackage")
|
|
98
|
+
def PAYNL_PACKAGE_STAGING = getExtOrDefault("paynlPackage") + ".staging"
|
|
99
|
+
def PAYNL_VERSION = getExtOrDefault("paynlVersion")
|
|
100
|
+
|
|
101
|
+
dependencies {
|
|
102
|
+
implementation "com.facebook.react:react-android"
|
|
103
|
+
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
104
|
+
|
|
105
|
+
debugImplementation "com.paynl.pos:$PAYNL_PACKAGE_STAGING:$PAYNL_VERSION"
|
|
106
|
+
releaseImplementation "com.paynl.pos:$PAYNL_PACKAGE:$PAYNL_VERSION"
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (isNewArchitectureEnabled()) {
|
|
110
|
+
react {
|
|
111
|
+
jsRootDir = file("../src/")
|
|
112
|
+
libraryName = "PaynlSdkReactNative"
|
|
113
|
+
codegenJavaPackageName = "com.paynl.sdk.reactnative"
|
|
114
|
+
}
|
|
115
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateModuleJavaSpec.js
|
|
9
|
+
*
|
|
10
|
+
* @nolint
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
package com.paynl.sdk.reactnative;
|
|
14
|
+
|
|
15
|
+
import com.facebook.proguard.annotations.DoNotStrip;
|
|
16
|
+
import com.facebook.react.bridge.Promise;
|
|
17
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
18
|
+
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
|
19
|
+
import com.facebook.react.bridge.ReactMethod;
|
|
20
|
+
import com.facebook.react.bridge.ReadableMap;
|
|
21
|
+
import com.facebook.react.bridge.WritableArray;
|
|
22
|
+
import com.facebook.react.bridge.WritableMap;
|
|
23
|
+
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
|
|
24
|
+
import javax.annotation.Nonnull;
|
|
25
|
+
import javax.annotation.Nullable;
|
|
26
|
+
|
|
27
|
+
public abstract class NativePayNlSdkSpec extends ReactContextBaseJavaModule implements TurboModule {
|
|
28
|
+
public static final String NAME = "PaynlSdk";
|
|
29
|
+
|
|
30
|
+
public NativePayNlSdkSpec(ReactApplicationContext reactContext) {
|
|
31
|
+
super(reactContext);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@Override
|
|
35
|
+
public @Nonnull String getName() {
|
|
36
|
+
return NAME;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
protected final void emitOnPaymentEvent(ReadableMap value) {
|
|
40
|
+
mEventEmitterCallback.invoke("onPaymentEvent", value);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@ReactMethod
|
|
44
|
+
@DoNotStrip
|
|
45
|
+
public abstract void initSdk(ReadableMap params, Promise promise);
|
|
46
|
+
|
|
47
|
+
@ReactMethod
|
|
48
|
+
@DoNotStrip
|
|
49
|
+
public abstract void getActivationCode(Promise promise);
|
|
50
|
+
|
|
51
|
+
@ReactMethod
|
|
52
|
+
@DoNotStrip
|
|
53
|
+
public abstract void loginViaCode(String code, Promise promise);
|
|
54
|
+
|
|
55
|
+
@ReactMethod
|
|
56
|
+
@DoNotStrip
|
|
57
|
+
public abstract void loginViaCredentials(String aCode, String serviceCode, String serviceSecret, Promise promise);
|
|
58
|
+
|
|
59
|
+
@ReactMethod
|
|
60
|
+
@DoNotStrip
|
|
61
|
+
public abstract void startTransaction(ReadableMap params, Promise promise);
|
|
62
|
+
|
|
63
|
+
@ReactMethod
|
|
64
|
+
@DoNotStrip
|
|
65
|
+
public abstract void sendTicketViaEmail(String email, String transactionId, String ticket, Promise promise);
|
|
66
|
+
|
|
67
|
+
@ReactMethod(isBlockingSynchronousMethod = true)
|
|
68
|
+
@DoNotStrip
|
|
69
|
+
public abstract @Nullable WritableMap getTerminalInfo();
|
|
70
|
+
|
|
71
|
+
@ReactMethod(isBlockingSynchronousMethod = true)
|
|
72
|
+
@DoNotStrip
|
|
73
|
+
public abstract @Nullable WritableArray getAllowedCurrencies();
|
|
74
|
+
|
|
75
|
+
@ReactMethod
|
|
76
|
+
@DoNotStrip
|
|
77
|
+
public abstract void logout();
|
|
78
|
+
|
|
79
|
+
@ReactMethod
|
|
80
|
+
@DoNotStrip
|
|
81
|
+
public abstract void sendLogs(Promise promise);
|
|
82
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
#
|
|
3
|
+
# This source code is licensed under the MIT license found in the
|
|
4
|
+
# LICENSE file in the root directory of this source tree.
|
|
5
|
+
|
|
6
|
+
cmake_minimum_required(VERSION 3.13)
|
|
7
|
+
set(CMAKE_VERBOSE_MAKEFILE on)
|
|
8
|
+
|
|
9
|
+
file(GLOB react_codegen_SRCS CONFIGURE_DEPENDS *.cpp react/renderer/components/RNPaynlSdkSpec/*.cpp)
|
|
10
|
+
|
|
11
|
+
add_library(
|
|
12
|
+
react_codegen_RNPaynlSdkSpec
|
|
13
|
+
OBJECT
|
|
14
|
+
${react_codegen_SRCS}
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
target_include_directories(react_codegen_RNPaynlSdkSpec PUBLIC . react/renderer/components/RNPaynlSdkSpec)
|
|
18
|
+
|
|
19
|
+
target_link_libraries(
|
|
20
|
+
react_codegen_RNPaynlSdkSpec
|
|
21
|
+
fbjni
|
|
22
|
+
jsi
|
|
23
|
+
# We need to link different libraries based on whether we are building rncore or not, that's necessary
|
|
24
|
+
# because we want to break a circular dependency between react_codegen_rncore and reactnative
|
|
25
|
+
reactnative
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
target_compile_options(
|
|
29
|
+
react_codegen_RNPaynlSdkSpec
|
|
30
|
+
PRIVATE
|
|
31
|
+
-DLOG_TAG=\"ReactNative\"
|
|
32
|
+
-fexceptions
|
|
33
|
+
-frtti
|
|
34
|
+
-std=c++20
|
|
35
|
+
-Wall
|
|
36
|
+
)
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateModuleJniCpp.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#include "RNPaynlSdkSpec.h"
|
|
12
|
+
|
|
13
|
+
namespace facebook::react {
|
|
14
|
+
|
|
15
|
+
static facebook::jsi::Value __hostFunction_NativePayNlSdkSpecJSI_initSdk(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
16
|
+
static jmethodID cachedMethodId = nullptr;
|
|
17
|
+
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "initSdk", "(Lcom/facebook/react/bridge/ReadableMap;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
static facebook::jsi::Value __hostFunction_NativePayNlSdkSpecJSI_getActivationCode(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
21
|
+
static jmethodID cachedMethodId = nullptr;
|
|
22
|
+
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "getActivationCode", "(Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
static facebook::jsi::Value __hostFunction_NativePayNlSdkSpecJSI_loginViaCode(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
26
|
+
static jmethodID cachedMethodId = nullptr;
|
|
27
|
+
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "loginViaCode", "(Ljava/lang/String;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
static facebook::jsi::Value __hostFunction_NativePayNlSdkSpecJSI_loginViaCredentials(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
31
|
+
static jmethodID cachedMethodId = nullptr;
|
|
32
|
+
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "loginViaCredentials", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
static facebook::jsi::Value __hostFunction_NativePayNlSdkSpecJSI_startTransaction(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
36
|
+
static jmethodID cachedMethodId = nullptr;
|
|
37
|
+
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "startTransaction", "(Lcom/facebook/react/bridge/ReadableMap;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
static facebook::jsi::Value __hostFunction_NativePayNlSdkSpecJSI_sendTicketViaEmail(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
41
|
+
static jmethodID cachedMethodId = nullptr;
|
|
42
|
+
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "sendTicketViaEmail", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
static facebook::jsi::Value __hostFunction_NativePayNlSdkSpecJSI_getTerminalInfo(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
46
|
+
static jmethodID cachedMethodId = nullptr;
|
|
47
|
+
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, ObjectKind, "getTerminalInfo", "()Lcom/facebook/react/bridge/WritableMap;", args, count, cachedMethodId);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
static facebook::jsi::Value __hostFunction_NativePayNlSdkSpecJSI_getAllowedCurrencies(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
51
|
+
static jmethodID cachedMethodId = nullptr;
|
|
52
|
+
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, ArrayKind, "getAllowedCurrencies", "()Lcom/facebook/react/bridge/WritableArray;", args, count, cachedMethodId);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
static facebook::jsi::Value __hostFunction_NativePayNlSdkSpecJSI_logout(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
56
|
+
static jmethodID cachedMethodId = nullptr;
|
|
57
|
+
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, VoidKind, "logout", "()V", args, count, cachedMethodId);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
static facebook::jsi::Value __hostFunction_NativePayNlSdkSpecJSI_sendLogs(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
61
|
+
static jmethodID cachedMethodId = nullptr;
|
|
62
|
+
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "sendLogs", "(Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
NativePayNlSdkSpecJSI::NativePayNlSdkSpecJSI(const JavaTurboModule::InitParams ¶ms)
|
|
66
|
+
: JavaTurboModule(params) {
|
|
67
|
+
methodMap_["initSdk"] = MethodMetadata {1, __hostFunction_NativePayNlSdkSpecJSI_initSdk};
|
|
68
|
+
methodMap_["getActivationCode"] = MethodMetadata {0, __hostFunction_NativePayNlSdkSpecJSI_getActivationCode};
|
|
69
|
+
methodMap_["loginViaCode"] = MethodMetadata {1, __hostFunction_NativePayNlSdkSpecJSI_loginViaCode};
|
|
70
|
+
methodMap_["loginViaCredentials"] = MethodMetadata {3, __hostFunction_NativePayNlSdkSpecJSI_loginViaCredentials};
|
|
71
|
+
methodMap_["startTransaction"] = MethodMetadata {1, __hostFunction_NativePayNlSdkSpecJSI_startTransaction};
|
|
72
|
+
methodMap_["sendTicketViaEmail"] = MethodMetadata {3, __hostFunction_NativePayNlSdkSpecJSI_sendTicketViaEmail};
|
|
73
|
+
methodMap_["getTerminalInfo"] = MethodMetadata {0, __hostFunction_NativePayNlSdkSpecJSI_getTerminalInfo};
|
|
74
|
+
methodMap_["getAllowedCurrencies"] = MethodMetadata {0, __hostFunction_NativePayNlSdkSpecJSI_getAllowedCurrencies};
|
|
75
|
+
methodMap_["logout"] = MethodMetadata {0, __hostFunction_NativePayNlSdkSpecJSI_logout};
|
|
76
|
+
methodMap_["sendLogs"] = MethodMetadata {0, __hostFunction_NativePayNlSdkSpecJSI_sendLogs};
|
|
77
|
+
eventEmitterMap_["onPaymentEvent"] = std::make_shared<AsyncEventEmitter<folly::dynamic>>();
|
|
78
|
+
setEventEmitterCallback(params.instance);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
std::shared_ptr<TurboModule> RNPaynlSdkSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams ¶ms) {
|
|
82
|
+
if (moduleName == "PaynlSdk") {
|
|
83
|
+
return std::make_shared<NativePayNlSdkSpecJSI>(params);
|
|
84
|
+
}
|
|
85
|
+
return nullptr;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
4
|
+
*
|
|
5
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
6
|
+
* once the code is regenerated.
|
|
7
|
+
*
|
|
8
|
+
* @generated by codegen project: GenerateModuleJniH.js
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
#pragma once
|
|
12
|
+
|
|
13
|
+
#include <ReactCommon/JavaTurboModule.h>
|
|
14
|
+
#include <ReactCommon/TurboModule.h>
|
|
15
|
+
#include <jsi/jsi.h>
|
|
16
|
+
|
|
17
|
+
namespace facebook::react {
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* JNI C++ class for module 'NativePayNlSdk'
|
|
21
|
+
*/
|
|
22
|
+
class JSI_EXPORT NativePayNlSdkSpecJSI : public JavaTurboModule {
|
|
23
|
+
public:
|
|
24
|
+
NativePayNlSdkSpecJSI(const JavaTurboModule::InitParams ¶ms);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
JSI_EXPORT
|
|
29
|
+
std::shared_ptr<TurboModule> RNPaynlSdkSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams ¶ms);
|
|
30
|
+
|
|
31
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GenerateModuleCpp.js
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
#include "RNPaynlSdkSpecJSI.h"
|
|
11
|
+
|
|
12
|
+
namespace facebook::react {
|
|
13
|
+
|
|
14
|
+
static jsi::Value __hostFunction_NativePayNlSdkCxxSpecJSI_initSdk(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
15
|
+
return static_cast<NativePayNlSdkCxxSpecJSI *>(&turboModule)->initSdk(
|
|
16
|
+
rt,
|
|
17
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt)
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
static jsi::Value __hostFunction_NativePayNlSdkCxxSpecJSI_getActivationCode(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
21
|
+
return static_cast<NativePayNlSdkCxxSpecJSI *>(&turboModule)->getActivationCode(
|
|
22
|
+
rt
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
static jsi::Value __hostFunction_NativePayNlSdkCxxSpecJSI_loginViaCode(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
26
|
+
return static_cast<NativePayNlSdkCxxSpecJSI *>(&turboModule)->loginViaCode(
|
|
27
|
+
rt,
|
|
28
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
static jsi::Value __hostFunction_NativePayNlSdkCxxSpecJSI_loginViaCredentials(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
32
|
+
return static_cast<NativePayNlSdkCxxSpecJSI *>(&turboModule)->loginViaCredentials(
|
|
33
|
+
rt,
|
|
34
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
35
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
|
|
36
|
+
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt)
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
static jsi::Value __hostFunction_NativePayNlSdkCxxSpecJSI_startTransaction(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
40
|
+
return static_cast<NativePayNlSdkCxxSpecJSI *>(&turboModule)->startTransaction(
|
|
41
|
+
rt,
|
|
42
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt)
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
static jsi::Value __hostFunction_NativePayNlSdkCxxSpecJSI_sendTicketViaEmail(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
46
|
+
return static_cast<NativePayNlSdkCxxSpecJSI *>(&turboModule)->sendTicketViaEmail(
|
|
47
|
+
rt,
|
|
48
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
49
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
|
|
50
|
+
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asString(rt)
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
static jsi::Value __hostFunction_NativePayNlSdkCxxSpecJSI_getTerminalInfo(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
54
|
+
auto result = static_cast<NativePayNlSdkCxxSpecJSI *>(&turboModule)->getTerminalInfo(
|
|
55
|
+
rt
|
|
56
|
+
);
|
|
57
|
+
return result ? jsi::Value(std::move(*result)) : jsi::Value::null();
|
|
58
|
+
}
|
|
59
|
+
static jsi::Value __hostFunction_NativePayNlSdkCxxSpecJSI_getAllowedCurrencies(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
60
|
+
auto result = static_cast<NativePayNlSdkCxxSpecJSI *>(&turboModule)->getAllowedCurrencies(
|
|
61
|
+
rt
|
|
62
|
+
);
|
|
63
|
+
return result ? jsi::Value(std::move(*result)) : jsi::Value::null();
|
|
64
|
+
}
|
|
65
|
+
static jsi::Value __hostFunction_NativePayNlSdkCxxSpecJSI_logout(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
66
|
+
static_cast<NativePayNlSdkCxxSpecJSI *>(&turboModule)->logout(
|
|
67
|
+
rt
|
|
68
|
+
);
|
|
69
|
+
return jsi::Value::undefined();
|
|
70
|
+
}
|
|
71
|
+
static jsi::Value __hostFunction_NativePayNlSdkCxxSpecJSI_sendLogs(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
72
|
+
return static_cast<NativePayNlSdkCxxSpecJSI *>(&turboModule)->sendLogs(
|
|
73
|
+
rt
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
NativePayNlSdkCxxSpecJSI::NativePayNlSdkCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker)
|
|
78
|
+
: TurboModule("PaynlSdk", jsInvoker) {
|
|
79
|
+
methodMap_["initSdk"] = MethodMetadata {1, __hostFunction_NativePayNlSdkCxxSpecJSI_initSdk};
|
|
80
|
+
methodMap_["getActivationCode"] = MethodMetadata {0, __hostFunction_NativePayNlSdkCxxSpecJSI_getActivationCode};
|
|
81
|
+
methodMap_["loginViaCode"] = MethodMetadata {1, __hostFunction_NativePayNlSdkCxxSpecJSI_loginViaCode};
|
|
82
|
+
methodMap_["loginViaCredentials"] = MethodMetadata {3, __hostFunction_NativePayNlSdkCxxSpecJSI_loginViaCredentials};
|
|
83
|
+
methodMap_["startTransaction"] = MethodMetadata {1, __hostFunction_NativePayNlSdkCxxSpecJSI_startTransaction};
|
|
84
|
+
methodMap_["sendTicketViaEmail"] = MethodMetadata {3, __hostFunction_NativePayNlSdkCxxSpecJSI_sendTicketViaEmail};
|
|
85
|
+
methodMap_["getTerminalInfo"] = MethodMetadata {0, __hostFunction_NativePayNlSdkCxxSpecJSI_getTerminalInfo};
|
|
86
|
+
methodMap_["getAllowedCurrencies"] = MethodMetadata {0, __hostFunction_NativePayNlSdkCxxSpecJSI_getAllowedCurrencies};
|
|
87
|
+
methodMap_["logout"] = MethodMetadata {0, __hostFunction_NativePayNlSdkCxxSpecJSI_logout};
|
|
88
|
+
methodMap_["sendLogs"] = MethodMetadata {0, __hostFunction_NativePayNlSdkCxxSpecJSI_sendLogs};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
} // namespace facebook::react
|