Skip to content

Commit

Permalink
fix: add missing props to ExternalPayerInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
FlaviuExtPrimer committed Nov 19, 2024
1 parent 676a60e commit 5a7d335
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ data class PrimerPaymentInstrumentTokenRN(
@Serializable
data class ExternalPayerInfo(
val email: String,
val externalPayerId: String?,
val firstName: String?,
val lastName: String?
)

@Serializable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +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,
accountNumberLast4Digits,
expirationMonth,
expirationYear,
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)
},
paymentMethodType,
binData?.let { PrimerPaymentInstrumentTokenRN.BinData(it.network) },
bankName
)
bankName = bankName
)
2 changes: 1 addition & 1 deletion packages/sdk/src/models/PrimerPaymentMethodTokenData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ export interface IKlarnaBillingAddress {
}

export interface IExternalPayerInfo {
email: string;
externalPayerId?: string;
email?: string;
firstName?: string;
lastName?: string;
}
Expand Down

0 comments on commit 5a7d335

Please sign in to comment.