Skip to content

Commit

Permalink
Some refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Guretzki committed Oct 28, 2024
1 parent 881c629 commit d1b9bc1
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 15 deletions.
8 changes: 8 additions & 0 deletions Adyen/Assets/Generated/LocalizationKey.swift
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,14 @@ public struct LocalizationKey {
/// Last 4 digits
public static let accessibilityLastFourDigits = LocalizationKey(key: "adyen.accessibility.lastFourDigits")

public static let payByBankConfirmationSheetTitle = LocalizationKey(key: "adyen.payByBank.confirmationSheet.title")

public static let payByBankConfirmationSheetSubtitle = LocalizationKey(key: "adyen.payByBank.confirmationSheet.subtitle")

public static let payByBankConfirmationSheetMessage = LocalizationKey(key: "adyen.payByBank.confirmationSheet.message")

public static let payByBankConfirmationSheetButtonTitle = LocalizationKey(key: "adyen.payByBank.confirmationSheet.buttonTitle")

internal let key: String

/// :nodoc:
Expand Down
2 changes: 1 addition & 1 deletion Adyen/Core/Payment Methods/PayByBankUSPaymentMethod.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import Foundation

/// PayByBank US payment.
/// PayByBank US payment method.
public struct PayByBankUSPaymentMethod: PaymentMethod {
public let type: PaymentMethodType

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import Foundation

/// Stored PayByBank US payment.
/// Stored PayByBank US payment method.
public struct StoredPayByBankUSPaymentMethod: StoredPaymentMethod {

public let type: PaymentMethodType
Expand Down
4 changes: 2 additions & 2 deletions AdyenCard/Form/FormCardLogosItemView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ internal final class FormCardLogosItemView: FormItemView<FormCardLogosItem>, UIC
collectionView.dataSource = self
}

func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
item.cardLogos.count
}

func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: CardLogoCell.reuseIdentifier, for: indexPath)
if let cell = cell as? CardLogoCell, let logo = item.cardLogos.adyen[safeIndex: indexPath.row] {
cell.update(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,19 +164,14 @@ extension PayByBankUSComponent.ConfirmationViewController {
internal init(
headerImageUrl: URL,
style: PayByBankUSComponent.Style,
localizationParameters: LocalizationParameters?,
continueHandler: @escaping () -> Void
) {
let message: [String] = [
"By connecting your bank account you are authorizing debits",
"to your account for any amount owed for use of our services",
"and/or purchase of our products, until this authorization is revoked."
]

self.headerImageUrl = headerImageUrl
self.title = "Pay by Bank"
self.subtitle = "Use Pay by Bank to pay instantly from any bank account."
self.message = message.joined(separator: " ")
self.submitTitle = "Continue to Pay by Bank"
self.title = localizedString(.payByBankConfirmationSheetTitle, localizationParameters)
self.subtitle = localizedString(.payByBankConfirmationSheetSubtitle, localizationParameters)
self.message = localizedString(.payByBankConfirmationSheetMessage, localizationParameters)
self.submitTitle = localizedString(.payByBankConfirmationSheetButtonTitle, localizationParameters)
self.style = style
self.continueHandler = continueHandler
}
Expand Down
3 changes: 2 additions & 1 deletion AdyenComponents/PayByBank/US/PayByBankUSComponent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
//

@_spi(AdyenInternal) import Adyen
import UIKit
import Foundation
import UIKit

/// A component that handles a Twint payment.
public final class PayByBankUSComponent: PaymentComponent, PresentableComponent {
Expand Down Expand Up @@ -51,6 +51,7 @@ public final class PayByBankUSComponent: PaymentComponent, PresentableComponent
return .init(model: .init(
headerImageUrl: headerImageUrl,
style: configuration.style,
localizationParameters: configuration.localizationParameters,
continueHandler: { [weak self] in
self?.initiatePayment()
}
Expand Down

0 comments on commit d1b9bc1

Please sign in to comment.