paynl-pos-sdk-react-native 0.0.39 → 0.0.41
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/gradle.properties +1 -1
- package/android/src/main/java/com/paynl/sdk/reactnative/PayNlUtils.kt +19 -16
- package/android/src/newarch/java/com/paynl/sdk/reactnative/PayNlSdkModule.kt +2 -3
- package/android/src/oldarch/java/com/paynl/sdk/reactnative/PayNlSdkModule.kt +2 -2
- package/package.json +1 -1
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import android.annotation.SuppressLint
|
|
2
2
|
import com.facebook.react.bridge.ReactContext
|
|
3
3
|
import com.facebook.react.bridge.ReadableMap
|
|
4
|
+
import com.facebook.react.bridge.WritableNativeMap
|
|
4
5
|
import com.paynl.pos.sdk.shared.models.paynl.PinPadLayoutParams
|
|
5
6
|
import com.paynl.pos.sdk.shared.models.paynl.transaction.PayNlService
|
|
6
7
|
import com.paynl.pos.sdk.shared.models.paynl.transaction.PayNlTransaction
|
|
7
|
-
import com.paynl.pos.sdk.shared.models.paynl.transaction.
|
|
8
|
+
import com.paynl.pos.sdk.shared.models.paynl.transaction.PayNlTransactionBuilder
|
|
8
9
|
import com.paynl.pos.sdk.shared.models.paynl.transaction.PayNlTransactionAmount
|
|
9
|
-
import com.paynl.pos.sdk.shared.models.paynl.transaction.PayNlTransactionCustomer
|
|
10
10
|
import com.paynl.pos.sdk.shared.models.paynl.transaction.PayNlTransactionNotification
|
|
11
|
-
import com.paynl.pos.sdk.shared.models.paynl.transaction.PayNlTransactionOrder
|
|
12
11
|
import com.paynl.pos.sdk.shared.models.paynl.transaction.PayNlTransactionProduct
|
|
13
|
-
import com.paynl.pos.sdk.shared.models.paynl.transaction.PayNlTransactionStats
|
|
14
12
|
import com.paynl.pos.sdk.shared.dialogs.paymentOverlay.PaymentOverlayParams
|
|
13
|
+
import com.paynl.pos.sdk.shared.models.paynl.transaction.PayNlTransactionAddressBuilder
|
|
14
|
+
import com.paynl.pos.sdk.shared.models.paynl.transaction.PayNlTransactionCustomerBuilder
|
|
15
|
+
import com.paynl.pos.sdk.shared.models.paynl.transaction.PayNlTransactionOrderBuilder
|
|
16
|
+
import com.paynl.pos.sdk.shared.models.paynl.transaction.PayNlTransactionProductBuilder
|
|
17
|
+
import com.paynl.pos.sdk.shared.models.paynl.transaction.PayNlTransactionResult
|
|
18
|
+
import com.paynl.pos.sdk.shared.models.paynl.transaction.PayNlTransactionStatsBuilder
|
|
15
19
|
|
|
16
20
|
class PayNlUtils {
|
|
17
21
|
companion object {
|
|
@@ -196,7 +200,7 @@ class PayNlUtils {
|
|
|
196
200
|
|
|
197
201
|
fun getTransaction(map: ReadableMap): PayNlTransaction? {
|
|
198
202
|
try {
|
|
199
|
-
var builder =
|
|
203
|
+
var builder = PayNlTransactionBuilder()
|
|
200
204
|
val params = map.getMap("transaction") ?: return null
|
|
201
205
|
|
|
202
206
|
val amount = params.getMap("amount") ?: return null
|
|
@@ -218,7 +222,7 @@ class PayNlUtils {
|
|
|
218
222
|
}
|
|
219
223
|
|
|
220
224
|
builder.setStats(params.getMap("stats")?.let {
|
|
221
|
-
val statsBuilder =
|
|
225
|
+
val statsBuilder = PayNlTransactionStatsBuilder()
|
|
222
226
|
it.getString("info")?.let { statsBuilder.setInfo(it) }
|
|
223
227
|
it.getString("tool")?.let { statsBuilder.setTool(it) }
|
|
224
228
|
it.getString("object")?.let { statsBuilder.setObject(it) }
|
|
@@ -230,7 +234,7 @@ class PayNlUtils {
|
|
|
230
234
|
})
|
|
231
235
|
|
|
232
236
|
builder.setCustomer(params.getMap("customer")?.let {
|
|
233
|
-
val customerBuilder =
|
|
237
|
+
val customerBuilder = PayNlTransactionCustomerBuilder()
|
|
234
238
|
it.getString("firstName")?.let { customerBuilder.setFirstName(it) }
|
|
235
239
|
it.getString("lastName")?.let { customerBuilder.setLastName(it) }
|
|
236
240
|
it.getString("phone")?.let { customerBuilder.setPhone(it) }
|
|
@@ -246,21 +250,20 @@ class PayNlUtils {
|
|
|
246
250
|
})
|
|
247
251
|
|
|
248
252
|
builder.setNotification(params.getMap("notification")?.let {
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
return@let notificationBuilder.build()
|
|
253
|
+
return@let PayNlTransactionNotification(
|
|
254
|
+
it.getString("type"),
|
|
255
|
+
it.getString("recipient")
|
|
256
|
+
)
|
|
254
257
|
})
|
|
255
258
|
|
|
256
259
|
builder.setOrder(params.getMap("order")?.let {
|
|
257
|
-
val orderBuilder =
|
|
260
|
+
val orderBuilder = PayNlTransactionOrderBuilder()
|
|
258
261
|
it.getString("countryCode")?.let { orderBuilder.setCountryCode(it) }
|
|
259
262
|
it.getString("deliveryDate")?.let { orderBuilder.setDeliveryDate(it) }
|
|
260
263
|
it.getString("invoiceDate")?.let { orderBuilder.setInvoiceDate(it) }
|
|
261
264
|
|
|
262
265
|
orderBuilder.setDeliveryAddress(it.getMap("deliveryAddress")?.let {
|
|
263
|
-
val addressBuilder =
|
|
266
|
+
val addressBuilder = PayNlTransactionAddressBuilder()
|
|
264
267
|
|
|
265
268
|
it.getString("streetName")?.let { addressBuilder.setStreetName(it) }
|
|
266
269
|
it.getString("streetNumber")?.let { addressBuilder.setStreetNumber(it) }
|
|
@@ -276,7 +279,7 @@ class PayNlUtils {
|
|
|
276
279
|
})
|
|
277
280
|
|
|
278
281
|
orderBuilder.setInvoiceAddress(it.getMap("invoiceAddress")?.let {
|
|
279
|
-
val addressBuilder =
|
|
282
|
+
val addressBuilder = PayNlTransactionAddressBuilder()
|
|
280
283
|
|
|
281
284
|
it.getString("streetName")?.let { addressBuilder.setStreetName(it) }
|
|
282
285
|
it.getString("streetNumber")?.let { addressBuilder.setStreetNumber(it) }
|
|
@@ -299,7 +302,7 @@ class PayNlUtils {
|
|
|
299
302
|
val products = ArrayList<PayNlTransactionProduct>()
|
|
300
303
|
for (i in 0..it.size()) {
|
|
301
304
|
val product = it.getMap(i) ?: continue
|
|
302
|
-
val productBuilder =
|
|
305
|
+
val productBuilder = PayNlTransactionProductBuilder()
|
|
303
306
|
|
|
304
307
|
product.getString("id")?.let { productBuilder.setId(it) }
|
|
305
308
|
product.getString("description")
|
|
@@ -15,9 +15,8 @@ import com.paynl.pos.sdk.PosService
|
|
|
15
15
|
import com.paynl.pos.sdk.shared.events.PaymentEvent
|
|
16
16
|
import com.paynl.pos.sdk.shared.exceptions.SVErrorBaseException
|
|
17
17
|
import com.paynl.pos.sdk.shared.exceptions.SV_0000_UNEXPECTED_ERROR
|
|
18
|
-
import com.paynl.pos.sdk.shared.models.paynl.
|
|
18
|
+
import com.paynl.pos.sdk.shared.models.paynl.PayNlConfigurationBuilder
|
|
19
19
|
import com.paynl.pos.sdk.shared.models.paynl.PayNlInitResult
|
|
20
|
-
import com.paynl.pos.sdk.shared.models.paynl.transaction.PayNlTransactionResult
|
|
21
20
|
import java.text.DateFormat
|
|
22
21
|
import java.text.SimpleDateFormat
|
|
23
22
|
import java.util.concurrent.CompletableFuture
|
|
@@ -55,7 +54,7 @@ class PayNlSdkModule(private val reactContext: ReactApplicationContext) : Native
|
|
|
55
54
|
return
|
|
56
55
|
}
|
|
57
56
|
|
|
58
|
-
val configuration =
|
|
57
|
+
val configuration = PayNlConfigurationBuilder()
|
|
59
58
|
.setIntegrationId(integrationId)
|
|
60
59
|
.setLicenseName(licenseName)
|
|
61
60
|
.setOverlayParams(paymentOverlayParams)
|
|
@@ -21,7 +21,7 @@ import com.paynl.pos.sdk.shared.exceptions.SVErrorBaseException
|
|
|
21
21
|
import com.paynl.pos.sdk.shared.exceptions.SV_0000_UNEXPECTED_ERROR
|
|
22
22
|
import com.paynl.pos.sdk.shared.models.offline.OfflineQueueModel
|
|
23
23
|
import com.paynl.pos.sdk.shared.models.paynl.PayNlInitResult
|
|
24
|
-
import com.paynl.pos.sdk.shared.models.paynl.
|
|
24
|
+
import com.paynl.pos.sdk.shared.models.paynl.PayNlConfigurationBuilder
|
|
25
25
|
|
|
26
26
|
import java.text.DateFormat
|
|
27
27
|
import java.text.SimpleDateFormat
|
|
@@ -61,7 +61,7 @@ class PayNlSdkModule(private val reactContext: ReactApplicationContext) :
|
|
|
61
61
|
return
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
val configuration =
|
|
64
|
+
val configuration = PayNlConfigurationBuilder()
|
|
65
65
|
.setIntegrationId(integrationId)
|
|
66
66
|
.setLicenseName(licenseName)
|
|
67
67
|
.setOverlayParams(paymentOverlayParams)
|