diff --git a/packages/example/src/screens/HeadlessCheckoutScreen.tsx b/packages/example/src/screens/HeadlessCheckoutScreen.tsx index d74286392..3483a3abf 100644 --- a/packages/example/src/screens/HeadlessCheckoutScreen.tsx +++ b/packages/example/src/screens/HeadlessCheckoutScreen.tsx @@ -1,14 +1,14 @@ -import React, {useEffect, useState} from 'react'; -import {Alert, Image, TouchableOpacity, View} from 'react-native'; +import React, { useEffect, useState } from 'react'; +import { Alert, Image, TouchableOpacity, View } from 'react-native'; import { createClientSession, createPayment, resumePayment, } from '../network/api'; -import {appPaymentParameters} from '../models/IClientSessionRequestBody'; -import type {IPayment} from '../models/IPayment'; -import {getPaymentHandlingStringVal} from '../network/Environment'; -import {ActivityIndicator} from 'react-native'; +import { appPaymentParameters } from '../models/IClientSessionRequestBody'; +import type { IPayment } from '../models/IPayment'; +import { getPaymentHandlingStringVal } from '../network/Environment'; +import { ActivityIndicator } from 'react-native'; import { Asset, AssetsManager, @@ -151,7 +151,7 @@ export const HeadlessCheckoutScreen = (props: any) => { )}\n`, ); setIsLoading(false); - switch(merchantCheckoutAdditionalInfo.additionalInfoName) { + switch (merchantCheckoutAdditionalInfo.additionalInfoName) { case "DisplayStripeAchMandateAdditionalInfo": showAchMandateAlert(); break; @@ -389,8 +389,6 @@ export const HeadlessCheckoutScreen = (props: any) => { console.log("Payment session intent is " + selectedSessionIntent) if (paymentMethod.paymentMethodType === "KLARNA") { props.navigation.navigate('Klarna', { paymentSessionIntent: selectedSessionIntent }); - } else if (paymentMethod.paymentMethodType === "STRIPE_ACH") { - props.navigation.navigate('HeadlessCheckoutStripeAchScreen'); } else { await nativeUIManager.showPaymentMethod(SessionIntent.CHECKOUT); } @@ -429,6 +427,8 @@ export const HeadlessCheckoutScreen = (props: any) => { paymentMethodType: paymentMethod.paymentMethodType, }); } + } else if (implementationType === "STRIPE_ACH" && paymentMethod.paymentMethodType === "STRIPE_ACH") { + props.navigation.navigate('HeadlessCheckoutStripeAchScreen'); } else { Alert.alert( 'Warning!', @@ -437,7 +437,7 @@ export const HeadlessCheckoutScreen = (props: any) => { { text: 'Cancel', style: 'cancel', - onPress: () => {}, + onPress: () => { }, }, ], { @@ -501,7 +501,7 @@ export const HeadlessCheckoutScreen = (props: any) => { .toLowerCase() .replace('_', '-')}`}> { } else { return ( vaultedPaymentMethods.map((item) => { - return setSelectedVaultedPaymentMethod(item)} - > - {getVaultedPaymentData(item)} - + return + setSelectedVaultedPaymentMethod(item)} + > + • {getVaultedPaymentData(item)} + + }) ); } @@ -315,7 +317,7 @@ export default HeadlessCheckoutVaultScreen = (props: any) => { case "STRIPE_ACH": { const bankName = item.paymentInstrumentData?.bankName ?? "-"; suffix = "(" + bankName + ")" - const last4Digits = item.paymentInstrumentData?.last4Digits; + const last4Digits = item.paymentInstrumentData?.accountNumberLast4Digits; if (last4Digits !== undefined) { suffix += " ••••" + last4Digits } diff --git a/packages/sdk/android/src/main/java/com/primerioreactnative/PrimerRNEventListener.kt b/packages/sdk/android/src/main/java/com/primerioreactnative/PrimerRNEventListener.kt index 67ecba201..dbf38d68c 100644 --- a/packages/sdk/android/src/main/java/com/primerioreactnative/PrimerRNEventListener.kt +++ b/packages/sdk/android/src/main/java/com/primerioreactnative/PrimerRNEventListener.kt @@ -15,9 +15,9 @@ import io.primer.android.completion.PrimerResumeDecisionHandler import io.primer.android.domain.PrimerCheckoutData import io.primer.android.domain.action.models.PrimerClientSession import io.primer.android.domain.error.models.PrimerError -import io.primer.android.domain.payments.additionalInfo.MultibancoCheckoutAdditionalInfo -import io.primer.android.domain.payments.additionalInfo.PrimerCheckoutAdditionalInfo -import io.primer.android.domain.payments.additionalInfo.PromptPayCheckoutAdditionalInfo +import io.primer.android.vouchers.multibanco.MultibancoCheckoutAdditionalInfo +import io.primer.android.payments.core.additionalInfo.PrimerCheckoutAdditionalInfo +import io.primer.android.qrcode.QrCodeCheckoutAdditionalInfo import io.primer.android.domain.tokenization.models.PrimerPaymentMethodData import io.primer.android.domain.tokenization.models.PrimerPaymentMethodTokenData import kotlinx.serialization.encodeToString @@ -173,7 +173,7 @@ class PrimerRNEventListener : PrimerCheckoutListener { override fun onAdditionalInfoReceived(additionalInfo: PrimerCheckoutAdditionalInfo) { if (implementedRNCallbacks?.isOnCheckoutAdditionalInfoImplemented == true) { - if (additionalInfo is PromptPayCheckoutAdditionalInfo) { + if (additionalInfo is QrCodeCheckoutAdditionalInfo) { sendEvent?.invoke( PrimerEvents.ON_CHECKOUT_RECEIVED_ADDITIONAL_INFO.eventName, JSONObject(Json.encodeToString(additionalInfo.toCheckoutAdditionalInfoRN())).apply { diff --git a/packages/sdk/android/src/main/java/com/primerioreactnative/PrimerRNHeadlessUniversalCheckoutListener.kt b/packages/sdk/android/src/main/java/com/primerioreactnative/PrimerRNHeadlessUniversalCheckoutListener.kt index b6ddde952..e4fbf7ab4 100644 --- a/packages/sdk/android/src/main/java/com/primerioreactnative/PrimerRNHeadlessUniversalCheckoutListener.kt +++ b/packages/sdk/android/src/main/java/com/primerioreactnative/PrimerRNHeadlessUniversalCheckoutListener.kt @@ -24,10 +24,10 @@ import io.primer.android.components.domain.core.models.PrimerHeadlessUniversalCh import io.primer.android.domain.PrimerCheckoutData import io.primer.android.domain.action.models.PrimerClientSession import io.primer.android.domain.error.models.PrimerError -import io.primer.android.domain.payments.additionalInfo.MultibancoCheckoutAdditionalInfo -import io.primer.android.domain.payments.additionalInfo.PrimerCheckoutAdditionalInfo -import io.primer.android.domain.payments.additionalInfo.PromptPayCheckoutAdditionalInfo -import io.primer.android.domain.payments.additionalInfo.AchAdditionalInfo +import io.primer.android.vouchers.multibanco.MultibancoCheckoutAdditionalInfo +import io.primer.android.payments.core.additionalInfo.PrimerCheckoutAdditionalInfo +import io.primer.android.qrcode.QrCodeCheckoutAdditionalInfo +import io.primer.android.stripe.ach.api.additionalInfo.AchAdditionalInfo import io.primer.android.domain.tokenization.models.PrimerPaymentMethodData import io.primer.android.domain.tokenization.models.PrimerPaymentMethodTokenData import io.primer.android.Primer @@ -250,7 +250,7 @@ class PrimerRNHeadlessUniversalCheckoutListener( override fun onCheckoutAdditionalInfoReceived(additionalInfo: PrimerCheckoutAdditionalInfo) { if (implementedRNCallbacks?.isOnCheckoutAdditionalInfoImplemented == true) { when (additionalInfo) { - is PromptPayCheckoutAdditionalInfo -> { + is QrCodeCheckoutAdditionalInfo -> { sendEvent?.invoke( PrimerHeadlessUniversalCheckoutEvent.ON_CHECKOUT_ADDITIONAL_INFO.eventName, JSONObject(json.encodeToString(additionalInfo.toCheckoutAdditionalInfoRN())).apply { diff --git a/packages/sdk/android/src/main/java/com/primerioreactnative/components/datamodels/manager/raw/cardRedirect/PrimerRNCardRedirectData.kt b/packages/sdk/android/src/main/java/com/primerioreactnative/components/datamodels/manager/raw/cardRedirect/PrimerRNCardRedirectData.kt index 9adb740b0..9d2a27993 100644 --- a/packages/sdk/android/src/main/java/com/primerioreactnative/components/datamodels/manager/raw/cardRedirect/PrimerRNCardRedirectData.kt +++ b/packages/sdk/android/src/main/java/com/primerioreactnative/components/datamodels/manager/raw/cardRedirect/PrimerRNCardRedirectData.kt @@ -1,6 +1,6 @@ package com.primerioreactnative.components.datamodels.manager.raw.cardRedirect -import io.primer.android.components.domain.core.models.bancontact.PrimerBancontactCardData +import io.primer.android.bancontact.PrimerBancontactCardData import kotlinx.serialization.Serializable @Serializable diff --git a/packages/sdk/android/src/main/java/com/primerioreactnative/components/datamodels/manager/raw/phoneNumber/PrimerRNPhoneNumberData.kt b/packages/sdk/android/src/main/java/com/primerioreactnative/components/datamodels/manager/raw/phoneNumber/PrimerRNPhoneNumberData.kt index 19d9fa673..024453ecd 100644 --- a/packages/sdk/android/src/main/java/com/primerioreactnative/components/datamodels/manager/raw/phoneNumber/PrimerRNPhoneNumberData.kt +++ b/packages/sdk/android/src/main/java/com/primerioreactnative/components/datamodels/manager/raw/phoneNumber/PrimerRNPhoneNumberData.kt @@ -1,6 +1,6 @@ package com.primerioreactnative.components.datamodels.manager.raw.phoneNumber -import io.primer.android.components.domain.core.models.phoneNumber.PrimerPhoneNumberData +import io.primer.android.phoneNumber.PrimerPhoneNumberData import kotlinx.serialization.Serializable @Serializable diff --git a/packages/sdk/android/src/main/java/com/primerioreactnative/components/datamodels/manager/raw/retailOutlets/PrimerRNRetailOutletData.kt b/packages/sdk/android/src/main/java/com/primerioreactnative/components/datamodels/manager/raw/retailOutlets/PrimerRNRetailOutletData.kt index 5b3e05fb8..bff82f53b 100644 --- a/packages/sdk/android/src/main/java/com/primerioreactnative/components/datamodels/manager/raw/retailOutlets/PrimerRNRetailOutletData.kt +++ b/packages/sdk/android/src/main/java/com/primerioreactnative/components/datamodels/manager/raw/retailOutlets/PrimerRNRetailOutletData.kt @@ -1,6 +1,6 @@ package com.primerioreactnative.components.datamodels.manager.raw.retailOutlets -import io.primer.android.components.domain.core.models.retailOutlet.PrimerRetailerData +import io.primer.android.PrimerRetailerData import kotlinx.serialization.Serializable @Serializable diff --git a/packages/sdk/android/src/main/java/com/primerioreactnative/components/datamodels/manager/raw/retailOutlets/RNRetailOutletsList.kt b/packages/sdk/android/src/main/java/com/primerioreactnative/components/datamodels/manager/raw/retailOutlets/RNRetailOutletsList.kt index bb3585c9f..1024ad5c5 100644 --- a/packages/sdk/android/src/main/java/com/primerioreactnative/components/datamodels/manager/raw/retailOutlets/RNRetailOutletsList.kt +++ b/packages/sdk/android/src/main/java/com/primerioreactnative/components/datamodels/manager/raw/retailOutlets/RNRetailOutletsList.kt @@ -1,6 +1,6 @@ package com.primerioreactnative.components.datamodels.manager.raw.retailOutlets -import io.primer.android.data.payments.configure.retailOutlets.RetailOutletsList +import io.primer.android.RetailOutletsList import kotlinx.serialization.Serializable @Serializable diff --git a/packages/sdk/android/src/main/java/com/primerioreactnative/components/manager/ach/PrimerRNHeadlessUniversalCheckoutStripeAchUserDetailsComponent.kt b/packages/sdk/android/src/main/java/com/primerioreactnative/components/manager/ach/PrimerRNHeadlessUniversalCheckoutStripeAchUserDetailsComponent.kt index 603e84fee..2018a3e43 100644 --- a/packages/sdk/android/src/main/java/com/primerioreactnative/components/manager/ach/PrimerRNHeadlessUniversalCheckoutStripeAchUserDetailsComponent.kt +++ b/packages/sdk/android/src/main/java/com/primerioreactnative/components/manager/ach/PrimerRNHeadlessUniversalCheckoutStripeAchUserDetailsComponent.kt @@ -24,11 +24,11 @@ import com.primerioreactnative.datamodels.extensions.ach.toUserDetailsRetrievedR import com.primerioreactnative.utils.convertJsonToArray import com.primerioreactnative.utils.convertJsonToMap import com.primerioreactnative.utils.errorTo -import io.primer.android.components.manager.ach.PrimerHeadlessUniversalCheckoutAchManager +import io.primer.android.components.ach.PrimerHeadlessUniversalCheckoutAchManager import io.primer.android.components.manager.core.composable.PrimerValidationStatus -import io.primer.android.components.presentation.paymentMethods.nativeUi.stripe.ach.StripeAchUserDetailsComponent -import io.primer.android.components.presentation.paymentMethods.nativeUi.stripe.ach.composable.AchUserDetailsCollectableData -import io.primer.android.components.presentation.paymentMethods.nativeUi.stripe.ach.composable.AchUserDetailsStep +import io.primer.android.stripe.ach.api.component.StripeAchUserDetailsComponent +import io.primer.android.stripe.ach.api.composable.AchUserDetailsCollectableData +import io.primer.android.stripe.ach.api.composable.AchUserDetailsStep import io.primer.android.domain.error.models.PrimerError import com.primerioreactnative.utils.toWritableArray import com.primerioreactnative.utils.toWritableMap diff --git a/packages/sdk/android/src/main/java/com/primerioreactnative/components/manager/asset/PrimerRNHeadlessUniversalCheckoutAssetManager.kt b/packages/sdk/android/src/main/java/com/primerioreactnative/components/manager/asset/PrimerRNHeadlessUniversalCheckoutAssetManager.kt index 207a239fd..cd566b4e7 100644 --- a/packages/sdk/android/src/main/java/com/primerioreactnative/components/manager/asset/PrimerRNHeadlessUniversalCheckoutAssetManager.kt +++ b/packages/sdk/android/src/main/java/com/primerioreactnative/components/manager/asset/PrimerRNHeadlessUniversalCheckoutAssetManager.kt @@ -18,7 +18,7 @@ import com.primerioreactnative.utils.toWritableMap import io.primer.android.ExperimentalPrimerApi import io.primer.android.components.SdkUninitializedException import io.primer.android.components.ui.assets.PrimerHeadlessUniversalCheckoutAssetsManager -import io.primer.android.ui.CardNetwork +import io.primer.android.configuration.data.model.CardNetwork import kotlinx.serialization.encodeToString import kotlinx.serialization.json.Json import org.json.JSONObject diff --git a/packages/sdk/android/src/main/java/com/primerioreactnative/components/manager/banks/PrimerRNHeadlessUniversalCheckoutBanksComponent.kt b/packages/sdk/android/src/main/java/com/primerioreactnative/components/manager/banks/PrimerRNHeadlessUniversalCheckoutBanksComponent.kt index 4e0b7f6df..a23a0a635 100644 --- a/packages/sdk/android/src/main/java/com/primerioreactnative/components/manager/banks/PrimerRNHeadlessUniversalCheckoutBanksComponent.kt +++ b/packages/sdk/android/src/main/java/com/primerioreactnative/components/manager/banks/PrimerRNHeadlessUniversalCheckoutBanksComponent.kt @@ -26,7 +26,7 @@ import com.primerioreactnative.utils.convertJsonToArray import com.primerioreactnative.utils.errorTo import io.primer.android.components.manager.banks.composable.BanksCollectableData import io.primer.android.components.manager.banks.composable.BanksStep -import io.primer.android.components.manager.componentWithRedirect.PrimerHeadlessUniversalCheckoutComponentWithRedirectManager +import io.primer.android.components.componentWithRedirect.PrimerHeadlessUniversalCheckoutComponentWithRedirectManager import io.primer.android.components.manager.componentWithRedirect.component.BanksComponent import io.primer.android.components.manager.core.composable.PrimerValidationStatus import com.primerioreactnative.utils.toWritableArray diff --git a/packages/sdk/android/src/main/java/com/primerioreactnative/components/manager/klarna/PrimerKlarnaPaymentViewManager.kt b/packages/sdk/android/src/main/java/com/primerioreactnative/components/manager/klarna/PrimerKlarnaPaymentViewManager.kt index ac9525f9c..7a9bfa442 100644 --- a/packages/sdk/android/src/main/java/com/primerioreactnative/components/manager/klarna/PrimerKlarnaPaymentViewManager.kt +++ b/packages/sdk/android/src/main/java/com/primerioreactnative/components/manager/klarna/PrimerKlarnaPaymentViewManager.kt @@ -9,7 +9,7 @@ import android.widget.TextView import com.facebook.react.bridge.ReactApplicationContext import com.facebook.react.uimanager.ThemedReactContext import com.facebook.react.uimanager.ViewGroupManager -import io.primer.android.components.presentation.paymentMethods.nativeUi.klarna.PrimerKlarnaPaymentView +import io.primer.android.klarna.api.ui.PrimerKlarnaPaymentView import java.lang.ref.WeakReference import java.util.Timer import java.util.TimerTask diff --git a/packages/sdk/android/src/main/java/com/primerioreactnative/components/manager/klarna/PrimerRNHeadlessUniversalCheckoutKlarnaComponent.kt b/packages/sdk/android/src/main/java/com/primerioreactnative/components/manager/klarna/PrimerRNHeadlessUniversalCheckoutKlarnaComponent.kt index c858ad114..aaa508263 100644 --- a/packages/sdk/android/src/main/java/com/primerioreactnative/components/manager/klarna/PrimerRNHeadlessUniversalCheckoutKlarnaComponent.kt +++ b/packages/sdk/android/src/main/java/com/primerioreactnative/components/manager/klarna/PrimerRNHeadlessUniversalCheckoutKlarnaComponent.kt @@ -29,10 +29,10 @@ import com.primerioreactnative.extensions.putErrors import com.primerioreactnative.extensions.putValidationErrors import io.primer.android.PrimerSessionIntent import io.primer.android.components.manager.core.composable.PrimerValidationStatus -import io.primer.android.components.manager.klarna.PrimerHeadlessUniversalCheckoutKlarnaManager -import io.primer.android.components.presentation.paymentMethods.nativeUi.klarna.composable.KlarnaComponent -import io.primer.android.components.presentation.paymentMethods.nativeUi.klarna.models.KlarnaPaymentCollectableData -import io.primer.android.components.presentation.paymentMethods.nativeUi.klarna.models.KlarnaPaymentStep +import io.primer.android.klarna.PrimerHeadlessUniversalCheckoutKlarnaManager +import io.primer.android.klarna.api.component.KlarnaComponent +import io.primer.android.klarna.api.composable.KlarnaPaymentCollectableData +import io.primer.android.klarna.api.composable.KlarnaPaymentStep import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Job diff --git a/packages/sdk/android/src/main/java/com/primerioreactnative/components/manager/raw/PrimerRNHeadlessUniversalCheckoutRawManager.kt b/packages/sdk/android/src/main/java/com/primerioreactnative/components/manager/raw/PrimerRNHeadlessUniversalCheckoutRawManager.kt index bcc4cc3a8..b43f712f0 100644 --- a/packages/sdk/android/src/main/java/com/primerioreactnative/components/manager/raw/PrimerRNHeadlessUniversalCheckoutRawManager.kt +++ b/packages/sdk/android/src/main/java/com/primerioreactnative/components/manager/raw/PrimerRNHeadlessUniversalCheckoutRawManager.kt @@ -19,7 +19,7 @@ import io.primer.android.components.SdkUninitializedException import io.primer.android.components.domain.exception.UnsupportedPaymentMethodManagerException import io.primer.android.components.manager.raw.PrimerHeadlessUniversalCheckoutRawDataManager import io.primer.android.components.manager.raw.PrimerHeadlessUniversalCheckoutRawDataManagerInterface -import io.primer.android.data.payments.configure.retailOutlets.RetailOutletsList +import io.primer.android.RetailOutletsList import kotlinx.serialization.decodeFromString import kotlinx.serialization.encodeToString import kotlinx.serialization.json.Json diff --git a/packages/sdk/android/src/main/java/com/primerioreactnative/datamodels/PrimerClientSessionRN.kt b/packages/sdk/android/src/main/java/com/primerioreactnative/datamodels/PrimerClientSessionRN.kt index cd633bd9b..2bb7b334b 100644 --- a/packages/sdk/android/src/main/java/com/primerioreactnative/datamodels/PrimerClientSessionRN.kt +++ b/packages/sdk/android/src/main/java/com/primerioreactnative/datamodels/PrimerClientSessionRN.kt @@ -1,6 +1,6 @@ package com.primerioreactnative.datamodels -import io.primer.android.data.configuration.models.CountryCode +import io.primer.android.configuration.data.model.CountryCode import io.primer.android.domain.action.models.* import kotlinx.serialization.Serializable diff --git a/packages/sdk/android/src/main/java/com/primerioreactnative/datamodels/PrimerPaymentInstrumentTokenRN.kt b/packages/sdk/android/src/main/java/com/primerioreactnative/datamodels/PrimerPaymentInstrumentTokenRN.kt index fb330e362..214ffd1b2 100644 --- a/packages/sdk/android/src/main/java/com/primerioreactnative/datamodels/PrimerPaymentInstrumentTokenRN.kt +++ b/packages/sdk/android/src/main/java/com/primerioreactnative/datamodels/PrimerPaymentInstrumentTokenRN.kt @@ -36,28 +36,23 @@ data class PrimerPaymentInstrumentTokenRN( val cardholderName: String? = null, val first6Digits: Int? = null, val last4Digits: Int? = null, + val accountNumberLast4Digits: Int? = null, val expirationMonth: Int? = null, val expirationYear: Int? = null, - val gocardlessMandateId: String? = null, val externalPayerInfo: ExternalPayerInfo? = null, val klarnaCustomerToken: String? = null, val sessionData: SessionData? = null, - // apaya - val mx: String? = null, - val mnc: Int? = null, - val mcc: Int? = null, - val hashedIdentifier: String? = null, - val currencyCode: String? = null, - val productId: String? = null, - // async val paymentMethodType: String? = null, - // bin val binData: BinData? = null, + val bankName: String? = null ) @Serializable data class ExternalPayerInfo( val email: String, + val externalPayerId: String?, + val firstName: String?, + val lastName: String? ) @Serializable diff --git a/packages/sdk/android/src/main/java/com/primerioreactnative/datamodels/extensions/ach/AchUserDetailsCollectableData.kt b/packages/sdk/android/src/main/java/com/primerioreactnative/datamodels/extensions/ach/AchUserDetailsCollectableData.kt index d9bd2f98f..989072626 100644 --- a/packages/sdk/android/src/main/java/com/primerioreactnative/datamodels/extensions/ach/AchUserDetailsCollectableData.kt +++ b/packages/sdk/android/src/main/java/com/primerioreactnative/datamodels/extensions/ach/AchUserDetailsCollectableData.kt @@ -2,7 +2,7 @@ package com.primerioreactnative.datamodels.extensions.ach import com.primerioreactnative.datamodels.NamedComponentValidatableData import com.primerioreactnative.datamodels.ach.AchUserDetailsStepRN -import io.primer.android.components.presentation.paymentMethods.nativeUi.stripe.ach.composable.AchUserDetailsCollectableData +import io.primer.android.stripe.ach.api.composable.AchUserDetailsCollectableData import kotlinx.serialization.Serializable import com.primerioreactnative.datamodels.ach.AchUserDetailsCollectableDataRN diff --git a/packages/sdk/android/src/main/java/com/primerioreactnative/datamodels/extensions/ach/AchUserDetailsStep.kt b/packages/sdk/android/src/main/java/com/primerioreactnative/datamodels/extensions/ach/AchUserDetailsStep.kt index 35af13a7f..de0bdf546 100644 --- a/packages/sdk/android/src/main/java/com/primerioreactnative/datamodels/extensions/ach/AchUserDetailsStep.kt +++ b/packages/sdk/android/src/main/java/com/primerioreactnative/datamodels/extensions/ach/AchUserDetailsStep.kt @@ -1,7 +1,7 @@ package com.primerioreactnative.datamodels.extensions.ach import com.primerioreactnative.datamodels.ach.AchUserDetailsStepRN -import io.primer.android.components.presentation.paymentMethods.nativeUi.stripe.ach.composable.AchUserDetailsStep +import io.primer.android.stripe.ach.api.composable.AchUserDetailsStep internal fun AchUserDetailsStep.UserDetailsCollected.toUserDetailsCollectedRN() = AchUserDetailsStepRN.UserDetailsCollectedRN() diff --git a/packages/sdk/android/src/main/java/com/primerioreactnative/extensions/PaymentInstrumentData.kt b/packages/sdk/android/src/main/java/com/primerioreactnative/extensions/PaymentInstrumentData.kt index d3bca3f6b..1fff7ff48 100644 --- a/packages/sdk/android/src/main/java/com/primerioreactnative/extensions/PaymentInstrumentData.kt +++ b/packages/sdk/android/src/main/java/com/primerioreactnative/extensions/PaymentInstrumentData.kt @@ -4,21 +4,34 @@ import com.primerioreactnative.datamodels.PrimerPaymentInstrumentTokenRN import io.primer.android.data.tokenization.models.PaymentInstrumentData internal fun PaymentInstrumentData.toPaymentInstrumentDataRN() = - PrimerPaymentInstrumentTokenRN.PaymentInstrumentData( - network, - cardholderName, - first6Digits, - last4Digits, - expirationMonth, - expirationYear, - gocardlessMandateId, - externalPayerInfo?.email?.let { PrimerPaymentInstrumentTokenRN.ExternalPayerInfo(it) }, - klarnaCustomerToken, - sessionData?.let { +PrimerPaymentInstrumentTokenRN.PaymentInstrumentData( + network = network, + cardholderName = cardholderName, + first6Digits = first6Digits, + last4Digits = last4Digits, + accountNumberLast4Digits = accountNumberLast4Digits, + expirationMonth = expirationMonth, + expirationYear = expirationYear, + externalPayerInfo = externalPayerInfo?.let { + PrimerPaymentInstrumentTokenRN.ExternalPayerInfo( + email = it.email, + externalPayerId = it.externalPayerId, + firstName = it.firstName, + lastName = it.lastName + ) + }, + klarnaCustomerToken = klarnaCustomerToken, + sessionData = sessionData?.let { PrimerPaymentInstrumentTokenRN.SessionData( - it.recurringDescription, - it.billingAddress?.let { PrimerPaymentInstrumentTokenRN.BillingAddress(it.email) }) + recurringDescription = it.recurringDescription, + billingAddress = it.billingAddress?.let { + PrimerPaymentInstrumentTokenRN.BillingAddress(email = it.email) + } + ) + }, + paymentMethodType = paymentMethodType, + binData = binData?.let { + PrimerPaymentInstrumentTokenRN.BinData(network = it.network) }, - mx, mnc, mcc, hashedIdentifier, currencyCode, productId, paymentMethodType, - binData?.let { PrimerPaymentInstrumentTokenRN.BinData(it.network) } - ) + bankName = bankName +) diff --git a/packages/sdk/android/src/main/java/com/primerioreactnative/extensions/PrimerCheckoutAdditionalInfo.kt b/packages/sdk/android/src/main/java/com/primerioreactnative/extensions/PrimerCheckoutAdditionalInfo.kt index c36c05c55..55d96aa63 100644 --- a/packages/sdk/android/src/main/java/com/primerioreactnative/extensions/PrimerCheckoutAdditionalInfo.kt +++ b/packages/sdk/android/src/main/java/com/primerioreactnative/extensions/PrimerCheckoutAdditionalInfo.kt @@ -4,17 +4,17 @@ import com.primerioreactnative.datamodels.MultibancoCheckoutAdditionalInfoRN import com.primerioreactnative.datamodels.PromptPayCheckoutAdditionalInfoRN import com.primerioreactnative.datamodels.XenditCheckoutVoucherAdditionalInfoRN import com.primerioreactnative.datamodels.AchAdditionalInfoDisplayMandateRN -import io.primer.android.domain.payments.additionalInfo.MultibancoCheckoutAdditionalInfo -import io.primer.android.domain.payments.additionalInfo.PrimerCheckoutAdditionalInfo -import io.primer.android.domain.payments.additionalInfo.PromptPayCheckoutAdditionalInfo -import io.primer.android.domain.payments.additionalInfo.XenditCheckoutVoucherAdditionalInfo -import io.primer.android.domain.payments.additionalInfo.AchAdditionalInfo +import io.primer.android.vouchers.multibanco.MultibancoCheckoutAdditionalInfo +import io.primer.android.payments.core.additionalInfo.PrimerCheckoutAdditionalInfo +import io.primer.android.qrcode.QrCodeCheckoutAdditionalInfo +import io.primer.android.vouchers.retailOutlets.XenditCheckoutVoucherAdditionalInfo +import io.primer.android.stripe.ach.api.additionalInfo.AchAdditionalInfo internal fun PrimerCheckoutAdditionalInfo.toCheckoutAdditionalInfoRN() = when (this) { is MultibancoCheckoutAdditionalInfo -> MultibancoCheckoutAdditionalInfoRN(expiresAt, reference, entity) - is PromptPayCheckoutAdditionalInfo -> - PromptPayCheckoutAdditionalInfoRN(expiresAt, qrCodeUrl, qrCodeBase64) + is QrCodeCheckoutAdditionalInfo -> + PromptPayCheckoutAdditionalInfoRN(expiresAt.orEmpty(), qrCodeUrl, qrCodeBase64) is XenditCheckoutVoucherAdditionalInfo -> XenditCheckoutVoucherAdditionalInfoRN(expiresAt, couponCode, retailerName) is AchAdditionalInfo.DisplayMandate -> diff --git a/packages/sdk/android/src/main/java/com/primerioreactnative/extensions/PrimerIssuingBank.kt b/packages/sdk/android/src/main/java/com/primerioreactnative/extensions/PrimerIssuingBank.kt index da8e4b72f..c87a0811b 100644 --- a/packages/sdk/android/src/main/java/com/primerioreactnative/extensions/PrimerIssuingBank.kt +++ b/packages/sdk/android/src/main/java/com/primerioreactnative/extensions/PrimerIssuingBank.kt @@ -1,7 +1,7 @@ package com.primerioreactnative.extensions import com.primerioreactnative.datamodels.PrimerIssuingBankRN -import io.primer.android.domain.rpc.banks.models.IssuingBank +import io.primer.android.banks.implementation.rpc.domain.models.IssuingBank internal fun IssuingBank.toPrimerIssuingBankRN() = PrimerIssuingBankRN(id, name, disabled, iconUrl) diff --git a/packages/sdk/android/src/main/java/com/primerioreactnative/extensions/klarna/KlarnaPaymentCategory.kt b/packages/sdk/android/src/main/java/com/primerioreactnative/extensions/klarna/KlarnaPaymentCategory.kt index 0b86060f5..599af58ac 100644 --- a/packages/sdk/android/src/main/java/com/primerioreactnative/extensions/klarna/KlarnaPaymentCategory.kt +++ b/packages/sdk/android/src/main/java/com/primerioreactnative/extensions/klarna/KlarnaPaymentCategory.kt @@ -1,7 +1,7 @@ package com.primerioreactnative.extensions.klarna import com.primerioreactnative.datamodels.klarna.KlarnaPaymentCategoryRN -import io.primer.android.components.domain.payments.paymentMethods.nativeUi.klarna.models.KlarnaPaymentCategory +import io.primer.android.klarna.implementation.session.domain.models.KlarnaPaymentCategory internal fun KlarnaPaymentCategory.toKlarnaPaymentCategoryRN() = KlarnaPaymentCategoryRN( diff --git a/packages/sdk/android/src/main/java/com/primerioreactnative/extensions/klarna/KlarnaPaymentCategoryRN.kt b/packages/sdk/android/src/main/java/com/primerioreactnative/extensions/klarna/KlarnaPaymentCategoryRN.kt index b3cf23090..686474a5d 100644 --- a/packages/sdk/android/src/main/java/com/primerioreactnative/extensions/klarna/KlarnaPaymentCategoryRN.kt +++ b/packages/sdk/android/src/main/java/com/primerioreactnative/extensions/klarna/KlarnaPaymentCategoryRN.kt @@ -1,7 +1,7 @@ package com.primerioreactnative.extensions.klarna import com.primerioreactnative.datamodels.klarna.KlarnaPaymentCategoryRN -import io.primer.android.components.domain.payments.paymentMethods.nativeUi.klarna.models.KlarnaPaymentCategory +import io.primer.android.klarna.implementation.session.domain.models.KlarnaPaymentCategory internal fun KlarnaPaymentCategoryRN.toKlarnaPaymentCategory() = KlarnaPaymentCategory( diff --git a/packages/sdk/android/src/main/java/com/primerioreactnative/extensions/klarna/KlarnaPaymentCollectableData.kt b/packages/sdk/android/src/main/java/com/primerioreactnative/extensions/klarna/KlarnaPaymentCollectableData.kt index 40c634bb0..ec3f87142 100644 --- a/packages/sdk/android/src/main/java/com/primerioreactnative/extensions/klarna/KlarnaPaymentCollectableData.kt +++ b/packages/sdk/android/src/main/java/com/primerioreactnative/extensions/klarna/KlarnaPaymentCollectableData.kt @@ -2,8 +2,8 @@ package com.primerioreactnative.extensions.klarna import com.primerioreactnative.datamodels.klarna.KlarnaPaymentCollectableDataRN.PaymentOptionsRN import com.primerioreactnative.datamodels.klarna.KlarnaPaymentCollectableDataRN.FinalizePaymentRN -import io.primer.android.components.presentation.paymentMethods.nativeUi.klarna.models.KlarnaPaymentCollectableData.PaymentOptions -import io.primer.android.components.presentation.paymentMethods.nativeUi.klarna.models.KlarnaPaymentCollectableData.FinalizePayment +import io.primer.android.klarna.api.composable.KlarnaPaymentCollectableData.PaymentOptions +import io.primer.android.klarna.api.composable.KlarnaPaymentCollectableData.FinalizePayment internal fun PaymentOptions.toPaymentOptionsRN() = PaymentOptionsRN( diff --git a/packages/sdk/android/src/main/java/com/primerioreactnative/extensions/klarna/KlarnaPaymentStep.kt b/packages/sdk/android/src/main/java/com/primerioreactnative/extensions/klarna/KlarnaPaymentStep.kt index f2f1d78a9..46140a145 100644 --- a/packages/sdk/android/src/main/java/com/primerioreactnative/extensions/klarna/KlarnaPaymentStep.kt +++ b/packages/sdk/android/src/main/java/com/primerioreactnative/extensions/klarna/KlarnaPaymentStep.kt @@ -5,10 +5,10 @@ import com.primerioreactnative.datamodels.klarna.KlarnaPaymentStepRN.PaymentView import com.primerioreactnative.datamodels.klarna.KlarnaPaymentStepRN.PaymentSessionAuthorizedRN import com.primerioreactnative.datamodels.klarna.KlarnaPaymentStepRN.PaymentSessionFinalizedRN import com.primerioreactnative.extensions.klarna.toKlarnaPaymentCategoryRN -import io.primer.android.components.presentation.paymentMethods.nativeUi.klarna.models.KlarnaPaymentStep.PaymentSessionCreated -import io.primer.android.components.presentation.paymentMethods.nativeUi.klarna.models.KlarnaPaymentStep.PaymentViewLoaded -import io.primer.android.components.presentation.paymentMethods.nativeUi.klarna.models.KlarnaPaymentStep.PaymentSessionAuthorized -import io.primer.android.components.presentation.paymentMethods.nativeUi.klarna.models.KlarnaPaymentStep.PaymentSessionFinalized +import io.primer.android.klarna.api.composable.KlarnaPaymentStep.PaymentSessionCreated +import io.primer.android.klarna.api.composable.KlarnaPaymentStep.PaymentViewLoaded +import io.primer.android.klarna.api.composable.KlarnaPaymentStep.PaymentSessionAuthorized +import io.primer.android.klarna.api.composable.KlarnaPaymentStep.PaymentSessionFinalized internal fun PaymentSessionCreated.toPaymentSessionCreatedRN() = PaymentSessionCreatedRN(paymentCategories = paymentCategories.map { it.toKlarnaPaymentCategoryRN() }) diff --git a/packages/sdk/src/models/PrimerPaymentMethodTokenData.ts b/packages/sdk/src/models/PrimerPaymentMethodTokenData.ts index 65627e047..93611c097 100644 --- a/packages/sdk/src/models/PrimerPaymentMethodTokenData.ts +++ b/packages/sdk/src/models/PrimerPaymentMethodTokenData.ts @@ -30,76 +30,33 @@ export interface IPrimerVaultData { } export interface IPrimerPaymentInstrumentData { - paypalBillingAgreementId?: string; - first6Digits?: string; - last4Digits?: string; - expirationMonth?: string; - expirationYear?: string; + paymentMethodType?: string; + first6Digits?: number; + last4Digits?: number; + expirationMonth?: number; + expirationYear?: number; cardholderName?: string; network?: string; - isNetworkTokenized?: boolean; klarnaCustomerToken?: string; - sessionData?: IKlarnaSessionData; externalPayerInfo?: IExternalPayerInfo; - shippingAddress?: IShippingAddress; binData?: IBinData; - - gocardlessMandateId?: string; - authorizationToken?: string; - hashedIdentifier?: string; - mcc?: string; - mnc?: string; - mx?: string; - currencyCode?: string; - productId?: string; + accountNumberLast4Digits?: number; + bankName?: string; } export interface IKlarnaSessionData { recurringDescription?: string; - purchaseCountry?: string; - purchaseCurrency?: string; - locale?: string; - orderAmount?: string; - orderLines?: IKlarnaSessionOrderLines[]; billingAddress?: IKlarnaBillingAddress; - tokenDetails?: IKlarnaSessionDataTokenDetails; -} - -export interface IKlarnaSessionOrderLines { - type?: string; - name?: string; - quantity?: number; - unitPrice?: number; - totalAmount?: number; - totalDiscountAmount?: number; } export interface IKlarnaBillingAddress { - addressLine1?: string; - addressLine2?: string; - addressLine3?: string; - city?: string; - countryCode?: string; email?: string; - firstName?: string; - lastName?: string; - phoneNumber?: string; - postalCode?: string; - state?: string; - title?: string; -} - -export interface IKlarnaSessionDataTokenDetails { - brand?: string; - maskedNumber?: string; - type: string; - expiryDate?: string; } export interface IExternalPayerInfo { + email: string; externalPayerId?: string; - email?: string; firstName?: string; lastName?: string; }