paynl-pos-sdk-react-native 0.0.40 → 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 +17 -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
|
@@ -5,15 +5,17 @@ import com.facebook.react.bridge.WritableNativeMap
|
|
|
5
5
|
import com.paynl.pos.sdk.shared.models.paynl.PinPadLayoutParams
|
|
6
6
|
import com.paynl.pos.sdk.shared.models.paynl.transaction.PayNlService
|
|
7
7
|
import com.paynl.pos.sdk.shared.models.paynl.transaction.PayNlTransaction
|
|
8
|
-
import com.paynl.pos.sdk.shared.models.paynl.transaction.
|
|
8
|
+
import com.paynl.pos.sdk.shared.models.paynl.transaction.PayNlTransactionBuilder
|
|
9
9
|
import com.paynl.pos.sdk.shared.models.paynl.transaction.PayNlTransactionAmount
|
|
10
|
-
import com.paynl.pos.sdk.shared.models.paynl.transaction.PayNlTransactionCustomer
|
|
11
10
|
import com.paynl.pos.sdk.shared.models.paynl.transaction.PayNlTransactionNotification
|
|
12
|
-
import com.paynl.pos.sdk.shared.models.paynl.transaction.PayNlTransactionOrder
|
|
13
11
|
import com.paynl.pos.sdk.shared.models.paynl.transaction.PayNlTransactionProduct
|
|
14
|
-
import com.paynl.pos.sdk.shared.models.paynl.transaction.PayNlTransactionStats
|
|
15
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
|
|
16
17
|
import com.paynl.pos.sdk.shared.models.paynl.transaction.PayNlTransactionResult
|
|
18
|
+
import com.paynl.pos.sdk.shared.models.paynl.transaction.PayNlTransactionStatsBuilder
|
|
17
19
|
|
|
18
20
|
class PayNlUtils {
|
|
19
21
|
companion object {
|
|
@@ -198,7 +200,7 @@ class PayNlUtils {
|
|
|
198
200
|
|
|
199
201
|
fun getTransaction(map: ReadableMap): PayNlTransaction? {
|
|
200
202
|
try {
|
|
201
|
-
var builder =
|
|
203
|
+
var builder = PayNlTransactionBuilder()
|
|
202
204
|
val params = map.getMap("transaction") ?: return null
|
|
203
205
|
|
|
204
206
|
val amount = params.getMap("amount") ?: return null
|
|
@@ -220,7 +222,7 @@ class PayNlUtils {
|
|
|
220
222
|
}
|
|
221
223
|
|
|
222
224
|
builder.setStats(params.getMap("stats")?.let {
|
|
223
|
-
val statsBuilder =
|
|
225
|
+
val statsBuilder = PayNlTransactionStatsBuilder()
|
|
224
226
|
it.getString("info")?.let { statsBuilder.setInfo(it) }
|
|
225
227
|
it.getString("tool")?.let { statsBuilder.setTool(it) }
|
|
226
228
|
it.getString("object")?.let { statsBuilder.setObject(it) }
|
|
@@ -232,7 +234,7 @@ class PayNlUtils {
|
|
|
232
234
|
})
|
|
233
235
|
|
|
234
236
|
builder.setCustomer(params.getMap("customer")?.let {
|
|
235
|
-
val customerBuilder =
|
|
237
|
+
val customerBuilder = PayNlTransactionCustomerBuilder()
|
|
236
238
|
it.getString("firstName")?.let { customerBuilder.setFirstName(it) }
|
|
237
239
|
it.getString("lastName")?.let { customerBuilder.setLastName(it) }
|
|
238
240
|
it.getString("phone")?.let { customerBuilder.setPhone(it) }
|
|
@@ -248,21 +250,20 @@ class PayNlUtils {
|
|
|
248
250
|
})
|
|
249
251
|
|
|
250
252
|
builder.setNotification(params.getMap("notification")?.let {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
return@let notificationBuilder.build()
|
|
253
|
+
return@let PayNlTransactionNotification(
|
|
254
|
+
it.getString("type"),
|
|
255
|
+
it.getString("recipient")
|
|
256
|
+
)
|
|
256
257
|
})
|
|
257
258
|
|
|
258
259
|
builder.setOrder(params.getMap("order")?.let {
|
|
259
|
-
val orderBuilder =
|
|
260
|
+
val orderBuilder = PayNlTransactionOrderBuilder()
|
|
260
261
|
it.getString("countryCode")?.let { orderBuilder.setCountryCode(it) }
|
|
261
262
|
it.getString("deliveryDate")?.let { orderBuilder.setDeliveryDate(it) }
|
|
262
263
|
it.getString("invoiceDate")?.let { orderBuilder.setInvoiceDate(it) }
|
|
263
264
|
|
|
264
265
|
orderBuilder.setDeliveryAddress(it.getMap("deliveryAddress")?.let {
|
|
265
|
-
val addressBuilder =
|
|
266
|
+
val addressBuilder = PayNlTransactionAddressBuilder()
|
|
266
267
|
|
|
267
268
|
it.getString("streetName")?.let { addressBuilder.setStreetName(it) }
|
|
268
269
|
it.getString("streetNumber")?.let { addressBuilder.setStreetNumber(it) }
|
|
@@ -278,7 +279,7 @@ class PayNlUtils {
|
|
|
278
279
|
})
|
|
279
280
|
|
|
280
281
|
orderBuilder.setInvoiceAddress(it.getMap("invoiceAddress")?.let {
|
|
281
|
-
val addressBuilder =
|
|
282
|
+
val addressBuilder = PayNlTransactionAddressBuilder()
|
|
282
283
|
|
|
283
284
|
it.getString("streetName")?.let { addressBuilder.setStreetName(it) }
|
|
284
285
|
it.getString("streetNumber")?.let { addressBuilder.setStreetNumber(it) }
|
|
@@ -301,7 +302,7 @@ class PayNlUtils {
|
|
|
301
302
|
val products = ArrayList<PayNlTransactionProduct>()
|
|
302
303
|
for (i in 0..it.size()) {
|
|
303
304
|
val product = it.getMap(i) ?: continue
|
|
304
|
-
val productBuilder =
|
|
305
|
+
val productBuilder = PayNlTransactionProductBuilder()
|
|
305
306
|
|
|
306
307
|
product.getString("id")?.let { productBuilder.setId(it) }
|
|
307
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)
|