Skip to content

Commit

Permalink
Merge pull request #1889 from Adyen/feature/pay-by-bank-drop-in-logo
Browse files Browse the repository at this point in the history
Pay by Bank - Align number of logos in Payment Methods List with iOS
  • Loading branch information
ozgur00 authored Nov 12, 2024
2 parents ddee485 + 7d7d0ed commit 393fb34
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ internal class PaymentMethodsListViewModel(

private fun makeBrandList(): List<LogoTextItem> {
return listOf(
PayByBankUSBrandLogo.entries.take(PAY_BY_BANK_BRAND_LOGO_SIZE).map {
PayByBankUSBrandLogo.entries.map {
LogoItem(
it.path,
dropInParams.environment,
Expand All @@ -279,7 +279,6 @@ internal class PaymentMethodsListViewModel(
companion object {
private const val CARD_LOGO_TYPE = "card"
private const val GOOGLE_PAY_LOGO_TYPE = PaymentMethodTypes.GOOGLE_PAY
private const val PAY_BY_BANK_BRAND_LOGO_SIZE = 3
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ internal class DefaultPayByBankUSDelegate(
override fun getPaymentMethodType(): String = paymentMethod.type ?: PaymentMethodTypes.UNKNOWN

private fun createOutputData() = PayByBankUSOutputData(
brandList = getBrandList()
brandList = getBrandList(),
)

private fun createComponentState(): PayByBankUSComponentState {
Expand Down Expand Up @@ -142,11 +142,13 @@ internal class DefaultPayByBankUSDelegate(

private fun getBrandList(): List<LogoTextItem> {
return listOf(
LogoItem(PayByBankUSBrandLogo.US_1.path, componentParams.environment),
LogoItem(PayByBankUSBrandLogo.US_2.path, componentParams.environment),
LogoItem(PayByBankUSBrandLogo.US_3.path, componentParams.environment),
LogoItem(PayByBankUSBrandLogo.US_4.path, componentParams.environment),
TextItem(R.string.checkout_pay_by_bank_us_more),
)
PayByBankUSBrandLogo.entries.map {
LogoItem(
it.path,
componentParams.environment,
)
},
listOf(TextItem(R.string.checkout_pay_by_bank_us_more)),
).flatten()
}
}

0 comments on commit 393fb34

Please sign in to comment.