paynl-pos-sdk-react-native 0.0.91 → 0.0.92
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/android/src/main/java/com/paynl/sdk/reactnative/PayNlUtils.kt +2 -0
- package/android/src/newarch/java/com/paynl/sdk/reactnative/PayNlSdkModule.kt +2 -7
- package/android/src/oldarch/java/com/paynl/sdk/reactnative/PayNlSdkModule.kt +2 -2
- package/ios/PayNlPosService.swift +3 -3
- package/package.json +1 -1
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
package com.paynl.sdk.reactnative
|
|
2
2
|
|
|
3
|
-
import PayNlUtils
|
|
4
3
|
import android.os.Bundle
|
|
5
|
-
import android.util.Log
|
|
6
4
|
import com.facebook.react.bridge.Promise
|
|
7
5
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
8
6
|
import com.facebook.react.bridge.LifecycleEventListener
|
|
@@ -16,13 +14,10 @@ import com.paynl.pos.sdk.PosService
|
|
|
16
14
|
import com.paynl.pos.sdk.shared.events.PaymentEvent
|
|
17
15
|
import com.paynl.pos.sdk.shared.exceptions.SVErrorBaseException
|
|
18
16
|
import com.paynl.pos.sdk.shared.exceptions.SV_0000_UNEXPECTED_ERROR
|
|
19
|
-
import com.paynl.pos.sdk.shared.models.paynl.PayNlConfigurationBuilder
|
|
20
17
|
import com.paynl.pos.sdk.shared.models.paynl.PayNlInitResult
|
|
21
18
|
import java.text.DateFormat
|
|
22
19
|
import java.text.SimpleDateFormat
|
|
23
20
|
import java.util.concurrent.CompletableFuture
|
|
24
|
-
import java.util.concurrent.ExecutorService
|
|
25
|
-
import java.util.concurrent.Executors
|
|
26
21
|
|
|
27
22
|
@ReactModule(name = PayNlSdkModule.NAME)
|
|
28
23
|
class PayNlSdkModule(private val reactContext: ReactApplicationContext) :
|
|
@@ -264,8 +259,8 @@ class PayNlSdkModule(private val reactContext: ReactApplicationContext) :
|
|
|
264
259
|
}
|
|
265
260
|
}
|
|
266
261
|
|
|
267
|
-
override fun queryLogs(days:
|
|
268
|
-
val result = posService.queryLogs(days)
|
|
262
|
+
override fun queryLogs(days: Double, promise: Promise) {
|
|
263
|
+
val result = posService.queryLogs(days.toInt())
|
|
269
264
|
promise.resolve(PayNlUtils.parseLogs(result))
|
|
270
265
|
}
|
|
271
266
|
|
|
@@ -283,8 +283,8 @@ class PayNlSdkModule(private val reactContext: ReactApplicationContext) :
|
|
|
283
283
|
}
|
|
284
284
|
|
|
285
285
|
@ReactMethod
|
|
286
|
-
fun queryLogs(days:
|
|
287
|
-
val result = posService.queryLogs(days)
|
|
286
|
+
fun queryLogs(days: Double, promise: Promise) {
|
|
287
|
+
val result = posService.queryLogs(days.toInt())
|
|
288
288
|
promise.resolve(PayNlUtils.parseLogs(result))
|
|
289
289
|
}
|
|
290
290
|
|
|
@@ -234,14 +234,14 @@ import PayNlPOSSdkSwift
|
|
|
234
234
|
|
|
235
235
|
@objc public func queryLogs(days: Double, resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) {
|
|
236
236
|
Task {
|
|
237
|
-
|
|
238
|
-
|
|
237
|
+
let result = self.posService.queryLogs(days: Int(days))
|
|
238
|
+
let output: [[String: Any]] = result.map { log in
|
|
239
239
|
return [
|
|
240
240
|
"date": log.date,
|
|
241
241
|
"level": log.level,
|
|
242
242
|
"message": log.message,
|
|
243
243
|
"line": log.line
|
|
244
|
-
] as
|
|
244
|
+
] as [String: Any]
|
|
245
245
|
}
|
|
246
246
|
|
|
247
247
|
resolve(output)
|