expo-openpay 0.1.6 → 0.1.8
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.
|
@@ -60,7 +60,8 @@ class ExpoOpenpayModule : Module() {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
AsyncFunction("createDeviceSessionId") { promise: Promise ->
|
|
63
|
-
|
|
63
|
+
val op = openpay
|
|
64
|
+
if (op == null) {
|
|
64
65
|
promise.reject("OPENPAY_NOT_INITIALIZED", "Openpay is not initialized", Throwable("Openpay init failed or never occured"))
|
|
65
66
|
return@AsyncFunction
|
|
66
67
|
}
|
|
@@ -73,7 +74,7 @@ class ExpoOpenpayModule : Module() {
|
|
|
73
74
|
}
|
|
74
75
|
|
|
75
76
|
try {
|
|
76
|
-
val deviceId =
|
|
77
|
+
val deviceId = op.deviceCollectorDefaultImpl.setup(activity)
|
|
77
78
|
promise.resolve(deviceId)
|
|
78
79
|
} catch (e: Exception) {
|
|
79
80
|
promise.reject("OPENPAY_DEVICE_SESSION_ID_ERROR", e.message, e)
|
|
@@ -81,7 +82,8 @@ class ExpoOpenpayModule : Module() {
|
|
|
81
82
|
}
|
|
82
83
|
|
|
83
84
|
AsyncFunction("tokenizeCard") { cardNumber: String, holderName: String, expirationYear: String, expirationMonth: String, cvv2: String, promise: Promise ->
|
|
84
|
-
|
|
85
|
+
val op = openpay
|
|
86
|
+
if (op == null) {
|
|
85
87
|
promise.reject("OPENPAY_NOT_INITIALIZED", "Openpay is not initialized", Throwable("Openpay init failed or never occured"))
|
|
86
88
|
return@AsyncFunction
|
|
87
89
|
}
|
|
@@ -95,7 +97,7 @@ class ExpoOpenpayModule : Module() {
|
|
|
95
97
|
cvv2(cvv2)
|
|
96
98
|
}
|
|
97
99
|
|
|
98
|
-
|
|
100
|
+
op.createToken(card, object: OperationCallBack<Token> {
|
|
99
101
|
override fun onSuccess(result: OperationResult<Token>) {
|
|
100
102
|
promise.resolve(result.result.id)
|
|
101
103
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-openpay",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "Expo module for Openpay integration",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@svgr/cli": "^8.1.0",
|
|
34
34
|
"@types/react": "~19.0.10",
|
|
35
35
|
"expo": "~53.0.12",
|
|
36
|
-
"expo-module-scripts": "^
|
|
36
|
+
"expo-module-scripts": "^5.0.7",
|
|
37
37
|
"react-native": "0.79.4",
|
|
38
38
|
"react-native-svg": "^15.14.0"
|
|
39
39
|
},
|