-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into COIOS-834_update_twint_v8.0.2
- Loading branch information
Showing
18 changed files
with
689 additions
and
19 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// | ||
// Copyright (c) 2024 Adyen N.V. | ||
// | ||
// This file is open source and available under the MIT license. See the LICENSE file for more info. | ||
// | ||
|
||
import Foundation | ||
|
||
/// PayByBank US payment method. | ||
public struct PayByBankUSPaymentMethod: PaymentMethod { | ||
public let type: PaymentMethodType | ||
|
||
public var name: String | ||
|
||
public var merchantProvidedDisplayInformation: MerchantCustomDisplayInformation? | ||
|
||
@_spi(AdyenInternal) | ||
public static var logoNames: [String] { | ||
["US-1", "US-2", "US-3", "US-4"] | ||
} | ||
|
||
public func defaultDisplayInformation(using parameters: LocalizationParameters?) -> DisplayInformation { | ||
.init( | ||
title: name, | ||
subtitle: nil, | ||
logoName: type.rawValue, | ||
trailingInfo: .logos( | ||
named: Self.logoNames, | ||
trailingText: "+" | ||
), | ||
accessibilityLabel: name | ||
) | ||
} | ||
|
||
@_spi(AdyenInternal) | ||
public func buildComponent(using builder: PaymentComponentBuilder) -> PaymentComponent? { | ||
builder.build(paymentMethod: self) | ||
} | ||
|
||
private enum CodingKeys: String, CodingKey { | ||
case type | ||
case name | ||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
Adyen/Core/Payment Methods/StoredPayByBankUSPaymentMethod.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// | ||
// Copyright (c) 2024 Adyen N.V. | ||
// | ||
// This file is open source and available under the MIT license. See the LICENSE file for more info. | ||
// | ||
|
||
import Foundation | ||
|
||
/// Stored PayByBank US payment method. | ||
public struct StoredPayByBankUSPaymentMethod: StoredPaymentMethod { | ||
|
||
public let type: PaymentMethodType | ||
|
||
public let name: String | ||
|
||
public let label: String? | ||
|
||
public var merchantProvidedDisplayInformation: MerchantCustomDisplayInformation? | ||
|
||
public let identifier: String | ||
|
||
public let supportedShopperInteractions: [ShopperInteraction] | ||
|
||
@_spi(AdyenInternal) | ||
public func buildComponent(using builder: PaymentComponentBuilder) -> PaymentComponent? { | ||
builder.build(paymentMethod: self) | ||
} | ||
|
||
@_spi(AdyenInternal) | ||
public func defaultDisplayInformation(using parameters: LocalizationParameters?) -> DisplayInformation { | ||
let title: String | ||
let subtitle: String? | ||
|
||
if let label { | ||
title = label | ||
subtitle = name | ||
} else { | ||
title = name | ||
subtitle = nil | ||
} | ||
|
||
return DisplayInformation(title: title, subtitle: subtitle, logoName: type.rawValue) | ||
} | ||
|
||
// MARK: - Decoding | ||
|
||
private enum CodingKeys: String, CodingKey { | ||
case type | ||
case name | ||
case label | ||
case identifier = "id" | ||
case supportedShopperInteractions | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
AdyenComponents/PayByBank/US/PayByBankUSComponent+Configuration.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// | ||
// Copyright (c) 2024 Adyen N.V. | ||
// | ||
// This file is open source and available under the MIT license. See the LICENSE file for more info. | ||
// | ||
|
||
@_spi(AdyenInternal) import Adyen | ||
|
||
extension PayByBankUSComponent { | ||
|
||
public struct Configuration: AnyBasicComponentConfiguration { | ||
|
||
/// The UI style of the component. | ||
public var style: PayByBankUSComponent.Style | ||
|
||
public var localizationParameters: LocalizationParameters? | ||
|
||
/// Initializes a new instance of `PayByBankUSComponent.Configuration` | ||
/// | ||
/// - Parameters: | ||
/// - style: The form style. | ||
/// - localizationParameters: The localization parameters. | ||
public init( | ||
style: PayByBankUSComponent.Style = .init(), | ||
localizationParameters: LocalizationParameters? = nil | ||
) { | ||
self.style = style | ||
self.localizationParameters = localizationParameters | ||
} | ||
} | ||
} |
57 changes: 57 additions & 0 deletions
57
AdyenComponents/PayByBank/US/PayByBankUSComponent+ConfirmationViewController+Model.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// | ||
// Copyright (c) 2024 Adyen N.V. | ||
// | ||
// This file is open source and available under the MIT license. See the LICENSE file for more info. | ||
// | ||
|
||
import Foundation | ||
import UIKit | ||
@_spi(AdyenInternal) import Adyen | ||
|
||
extension PayByBankUSComponent.ConfirmationViewController { | ||
|
||
internal class Model { | ||
|
||
internal let headerImageUrl: URL | ||
internal let supportedBankLogoURLs: [URL] | ||
internal let supportedBanksMoreText: String | ||
internal let title: String | ||
internal let subtitle: String | ||
internal let message: String | ||
internal let submitTitle: String | ||
|
||
internal let style: PayByBankUSComponent.Style | ||
internal let headerImageViewSize = CGSize(width: 80, height: 52) | ||
|
||
internal let continueHandler: () -> Void | ||
|
||
private let imageLoader: ImageLoading = ImageLoaderProvider.imageLoader() | ||
private var imageLoadingTask: AdyenCancellable? { | ||
willSet { imageLoadingTask?.cancel() } | ||
} | ||
|
||
internal init( | ||
title: String, | ||
headerImageUrl: URL, | ||
supportedBankLogoNames: [String], | ||
style: PayByBankUSComponent.Style, | ||
localizationParameters: LocalizationParameters?, | ||
logoUrlProvider: LogoURLProvider, | ||
continueHandler: @escaping () -> Void | ||
) { | ||
self.headerImageUrl = headerImageUrl | ||
self.supportedBankLogoURLs = supportedBankLogoNames.map { logoUrlProvider.logoURL(withName: $0) } | ||
self.supportedBanksMoreText = localizedString(.payByBankAISDDMore, localizationParameters) | ||
self.title = title | ||
self.subtitle = localizedString(.payByBankAISDDDisclaimerHeader, localizationParameters) | ||
self.message = localizedString(.payByBankAISDDDisclaimerBody, localizationParameters) | ||
self.submitTitle = localizedString(.payByBankAISDDSubmit, localizationParameters) | ||
self.style = style | ||
self.continueHandler = continueHandler | ||
} | ||
|
||
internal func loadHeaderImage(for imageView: UIImageView) { | ||
imageLoadingTask = imageView.load(url: headerImageUrl, using: imageLoader) | ||
} | ||
} | ||
} |
Oops, something went wrong.