From 0d523249642da3ce6d9cf3ff3dc6f771f35f353c Mon Sep 17 00:00:00 2001 From: Charlie Cruzan Date: Thu, 14 Sep 2023 07:30:11 -1000 Subject: [PATCH] fix: remove kotlin forEach call --- .../main/java/com/reactnativestripesdk/utils/Mappers.kt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt b/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt index 6141ce638..c4e8e129c 100644 --- a/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt +++ b/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt @@ -807,11 +807,8 @@ internal fun mapFromSetupIntentResult(setupIntent: SetupIntent): WritableMap { map.putMap("lastSetupError", setupError) } - setupIntent.paymentMethodTypes.forEach { code -> - val type: PaymentMethod.Type? = PaymentMethod.Type.values().find { - code == it.code - } - type?.let { + for (code in setupIntent.paymentMethodTypes) { + PaymentMethod.Type.fromCode(code)?.let { paymentMethodTypes.pushString(mapPaymentMethodType(it)) } }