Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COIOS-774: Pay by Bank - Confirmation Sheet #1876

Merged
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 41 additions & 3 deletions Adyen.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@
81129AE62A4EEF8600E63EBE /* SearchViewController+InterfaceState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81129AE52A4EEF8600E63EBE /* SearchViewController+InterfaceState.swift */; };
81135C922C903DA4008AC8E4 /* JSONEncoder+SortedKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81135C912C903DA4008AC8E4 /* JSONEncoder+SortedKeys.swift */; };
8122B9BD2B9A0FF3002FC4D6 /* ErrorMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8122B9BC2B9A0FF3002FC4D6 /* ErrorMock.swift */; };
81272F182CC7E1DD00D8773A /* PayByBankUSComponent+ConfirmationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81272F172CC7E1CF00D8773A /* PayByBankUSComponent+ConfirmationViewController.swift */; };
81272F1A2CC8FD4600D8773A /* PayByBankUSComponent+Style.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81272F192CC8FD4600D8773A /* PayByBankUSComponent+Style.swift */; };
8128977C2CCA660A00275487 /* StoredPayByBankUSPaymentMethod.swift in Sources */ = {isa = PBXBuildFile; fileRef = 812897752CC8FEC100275487 /* StoredPayByBankUSPaymentMethod.swift */; };
8136619E2BE0F6F7009AA0CD /* Adyen3DS2 in Frameworks */ = {isa = PBXBuildFile; productRef = 8136619D2BE0F6F7009AA0CD /* Adyen3DS2 */; };
813BF1122B2365400096940E /* XCTestCase+FirstResponder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 813BF1102B2364E00096940E /* XCTestCase+FirstResponder.swift */; };
813BF1132B2365400096940E /* XCTestCase+FirstResponder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 813BF1102B2364E00096940E /* XCTestCase+FirstResponder.swift */; };
Expand Down Expand Up @@ -200,7 +203,6 @@
81A6B4E32AD53E3300A089A1 /* OpenExternalAppDetector.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81A6B4E22AD53E3300A089A1 /* OpenExternalAppDetector.swift */; };
81A6B4E72AD54F6C00A089A1 /* OpenExternalAppDetector+Mock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81A6B4E52AD54F4F00A089A1 /* OpenExternalAppDetector+Mock.swift */; };
81A6B4EB2AD5546500A089A1 /* AdyenDependencies.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81A6B4EA2AD5546500A089A1 /* AdyenDependencies.swift */; };
81A741212C8B1E5700EB393D /* StoredPayByBankPaymentMethod.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81A741202C8B1E5700EB393D /* StoredPayByBankPaymentMethod.swift */; };
81A91AB72BEBEA21001E00C8 /* OpenExternalAppDetectorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81A91AB62BEBEA21001E00C8 /* OpenExternalAppDetectorTests.swift */; };
81A91AC02BEC129D001E00C8 /* TwintSDK.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00E5D6602AF527C200CDE118 /* TwintSDK.xcframework */; };
81A91AC12BEC129D001E00C8 /* TwintSDK.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 00E5D6602AF527C200CDE118 /* TwintSDK.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
Expand Down Expand Up @@ -249,6 +251,9 @@
81C5D0CE2AC4170A002E918F /* IssuerListComponentExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81C5D0CC2AC4170A002E918F /* IssuerListComponentExample.swift */; };
81C5D0D02AC428CB002E918F /* IssuerListComponentAdvancedFlowExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81C5D0CF2AC428CB002E918F /* IssuerListComponentAdvancedFlowExample.swift */; };
81C5D0D12AC428CB002E918F /* IssuerListComponentAdvancedFlowExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81C5D0CF2AC428CB002E918F /* IssuerListComponentAdvancedFlowExample.swift */; };
81D218682CC7D23A00B7FC4C /* PayByBankUSPaymentMethod.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81D218672CC7D23400B7FC4C /* PayByBankUSPaymentMethod.swift */; };
81D2186D2CC7D57700B7FC4C /* PayByBankUSComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81D2186C2CC7D57100B7FC4C /* PayByBankUSComponent.swift */; };
81D2186F2CC7D7FE00B7FC4C /* PayByBankUSComponent+Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81D2186E2CC7D7F900B7FC4C /* PayByBankUSComponent+Configuration.swift */; };
81DA70812BDA5F66006CE5D5 /* PaymentMethods+Equatable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81DA70802BDA5F66006CE5D5 /* PaymentMethods+Equatable.swift */; };
81DA70872BDA6075006CE5D5 /* Twint+Spy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81DA70822BDA6075006CE5D5 /* Twint+Spy.swift */; };
81DA70882BDA6075006CE5D5 /* TwintSDKActionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81DA70832BDA6075006CE5D5 /* TwintSDKActionTests.swift */; };
Expand Down Expand Up @@ -1605,6 +1610,9 @@
81129AE52A4EEF8600E63EBE /* SearchViewController+InterfaceState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SearchViewController+InterfaceState.swift"; sourceTree = "<group>"; };
81135C912C903DA4008AC8E4 /* JSONEncoder+SortedKeys.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "JSONEncoder+SortedKeys.swift"; sourceTree = "<group>"; };
8122B9BC2B9A0FF3002FC4D6 /* ErrorMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ErrorMock.swift; sourceTree = "<group>"; };
81272F172CC7E1CF00D8773A /* PayByBankUSComponent+ConfirmationViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "PayByBankUSComponent+ConfirmationViewController.swift"; sourceTree = "<group>"; };
81272F192CC8FD4600D8773A /* PayByBankUSComponent+Style.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "PayByBankUSComponent+Style.swift"; sourceTree = "<group>"; };
812897752CC8FEC100275487 /* StoredPayByBankUSPaymentMethod.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StoredPayByBankUSPaymentMethod.swift; sourceTree = "<group>"; };
813BF1102B2364E00096940E /* XCTestCase+FirstResponder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "XCTestCase+FirstResponder.swift"; sourceTree = "<group>"; };
813EF9DD2A5DA0BC00C65D15 /* FormPickerItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormPickerItem.swift; sourceTree = "<group>"; };
813EF9E12A5DA2D400C65D15 /* FormPickerItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormPickerItemView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1674,6 +1682,9 @@
81C4006F2A4347FD007EC51C /* FormErrorItemTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormErrorItemTests.swift; sourceTree = "<group>"; };
81C5D0CC2AC4170A002E918F /* IssuerListComponentExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IssuerListComponentExample.swift; sourceTree = "<group>"; };
81C5D0CF2AC428CB002E918F /* IssuerListComponentAdvancedFlowExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IssuerListComponentAdvancedFlowExample.swift; sourceTree = "<group>"; };
81D218672CC7D23400B7FC4C /* PayByBankUSPaymentMethod.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PayByBankUSPaymentMethod.swift; sourceTree = "<group>"; };
81D2186C2CC7D57100B7FC4C /* PayByBankUSComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PayByBankUSComponent.swift; sourceTree = "<group>"; };
81D2186E2CC7D7F900B7FC4C /* PayByBankUSComponent+Configuration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "PayByBankUSComponent+Configuration.swift"; sourceTree = "<group>"; };
81D8E2E82A5C06AC00BC12FD /* KeyboardObserverTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyboardObserverTests.swift; sourceTree = "<group>"; };
81DA70802BDA5F66006CE5D5 /* PaymentMethods+Equatable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "PaymentMethods+Equatable.swift"; sourceTree = "<group>"; };
81DA70822BDA6075006CE5D5 /* Twint+Spy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Twint+Spy.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2856,6 +2867,7 @@
210CC97D2A5FC11900F8F672 /* Recovered References */ = {
isa = PBXGroup;
children = (
81A741202C8B1E5700EB393D /* StoredPayByBankPaymentMethod.swift */,
);
name = "Recovered References";
sourceTree = "<group>";
Expand Down Expand Up @@ -3121,6 +3133,25 @@
path = Address;
sourceTree = "<group>";
};
81D2186B2CC7D54F00B7FC4C /* PayByBank */ = {
isa = PBXGroup;
children = (
81D218702CC7D85900B7FC4C /* US */,
);
path = PayByBank;
sourceTree = "<group>";
};
81D218702CC7D85900B7FC4C /* US */ = {
isa = PBXGroup;
children = (
81D2186C2CC7D57100B7FC4C /* PayByBankUSComponent.swift */,
81272F172CC7E1CF00D8773A /* PayByBankUSComponent+ConfirmationViewController.swift */,
81272F192CC8FD4600D8773A /* PayByBankUSComponent+Style.swift */,
81D2186E2CC7D7F900B7FC4C /* PayByBankUSComponent+Configuration.swift */,
);
path = US;
sourceTree = "<group>";
};
81DA70862BDA6075006CE5D5 /* Twint */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -3710,7 +3741,8 @@
E224088622AFA3A80058923E /* StoredInstantPaymentMethod.swift */,
F9D57529237C6084009C18B5 /* StoredBCMCPaymentMethod.swift */,
E71E8F3D257921D10054B03D /* StoredBLIKPaymentMethod.swift */,
81A741202C8B1E5700EB393D /* StoredPayByBankPaymentMethod.swift */,
812897752CC8FEC100275487 /* StoredPayByBankUSPaymentMethod.swift */,
81D218672CC7D23400B7FC4C /* PayByBankUSPaymentMethod.swift */,
E224088C22B0FD220058923E /* StoredPayPalPaymentMethod.swift */,
F9620D9E23C7457F005209FC /* WeChatPayPaymentMethod.swift */,
F926D52B23F59ABE00D058D3 /* QiwiWalletPaymentMethod.swift */,
Expand Down Expand Up @@ -4745,6 +4777,7 @@
children = (
F9175E57259393E800D653BE /* AdyenComponents.h */,
F9175E58259393E800D653BE /* Info.plist */,
81D2186B2CC7D54F00B7FC4C /* PayByBank */,
A0414C1B27888BF300DF3FE9 /* ACH Direct Debit */,
00EACBAA2872E8CA0082B360 /* OnlineBanking */,
C982FFD626945FCE00AED849 /* Affirm */,
Expand Down Expand Up @@ -6903,6 +6936,7 @@
F9354BE723A7B4E200A6760B /* TextStyle.swift in Sources */,
F9A6C41D26550B7100D8CD3E /* AlreadyPaidPaymentComponent.swift in Sources */,
F9D644E024D2E4210059CBE3 /* EmailValidator.swift in Sources */,
8128977C2CCA660A00275487 /* StoredPayByBankUSPaymentMethod.swift in Sources */,
F9639B3324DD96990073F38A /* PaymentStatusRequest.swift in Sources */,
A0DB48662AFD020400348C83 /* AnalyticsRequest.swift in Sources */,
5AD40E75262F04440090E01C /* UIProgressViewHelpers.swift in Sources */,
Expand Down Expand Up @@ -6972,6 +7006,7 @@
A0DE8F6D26CEA04500F2F1E8 /* Installments.swift in Sources */,
F939CD7725EE56BA00018DEC /* LoadingComponent.swift in Sources */,
E7806EBD26147AB700101DBB /* ViewControllerDelegate.swift in Sources */,
81D218682CC7D23A00B7FC4C /* PayByBankUSPaymentMethod.swift in Sources */,
E749FD1E23CF4998000D18BA /* NavigationStyle.swift in Sources */,
81A6B4EB2AD5546500A089A1 /* AdyenDependencies.swift in Sources */,
F9354BED23A7C34D00A6760B /* ButtonStyle.swift in Sources */,
Expand Down Expand Up @@ -7030,7 +7065,6 @@
F9FE253B2625AED6001874BB /* PartialPaymentComponent.swift in Sources */,
A001297C2C0DF2E0009EF80C /* StoredPaymentMethodsDelegate.swift in Sources */,
81C4006D2A41A2BC007EC51C /* FormAddressPickerItemView.swift in Sources */,
81A741212C8B1E5700EB393D /* StoredPayByBankPaymentMethod.swift in Sources */,
E9E3DB03222548E100697074 /* AdyenCoder.swift in Sources */,
A0C9B59B288AE34600D6BDAB /* InstallmentOptions.swift in Sources */,
81BA08412A4AD97400308160 /* FormValidatableValueItemView.swift in Sources */,
Expand Down Expand Up @@ -7409,6 +7443,7 @@
F9175EAC259394FF00D653BE /* ApplePayComponent.swift in Sources */,
F97C838425BF053F00D7F85C /* DokuComponent.swift in Sources */,
C9D8EB9E27452D3B006D8CA1 /* BACSItemsFactory.swift in Sources */,
81D2186D2CC7D57700B7FC4C /* PayByBankUSComponent.swift in Sources */,
F9175ED32593951900D653BE /* MBWayDetails.swift in Sources */,
F9175EAB259394FF00D653BE /* ApplePayDetails.swift in Sources */,
F9175EE22593952600D653BE /* BLIKComponent.swift in Sources */,
Expand All @@ -7420,6 +7455,7 @@
F9175E8A259394E100D653BE /* SEPADirectDebitDetails.swift in Sources */,
F9175EAA259394FF00D653BE /* ApplePayComponentExtensions.swift in Sources */,
E746E67127B3FA700076BB71 /* InstantComponents.swift in Sources */,
81D2186F2CC7D7FE00B7FC4C /* PayByBankUSComponent+Configuration.swift in Sources */,
C982FFD826946F0800AED849 /* AffirmComponent.swift in Sources */,
002B92F5294B6987000B93F4 /* UPIComponentDetails.swift in Sources */,
E7D874F727E0E2DE00D3C00A /* ApplePayPayment.swift in Sources */,
Expand All @@ -7439,6 +7475,7 @@
5A54603F264A5CEC00724A87 /* BoletoComponent.swift in Sources */,
C93B01B72760B03400D311A1 /* BACSConfirmationViewController.swift in Sources */,
C9D8EB9927452355006D8CA1 /* BACSInputFormViewController.swift in Sources */,
81272F1A2CC8FD4600D8773A /* PayByBankUSComponent+Style.swift in Sources */,
C93B01B92760B06300D311A1 /* BACSConfirmationPresenter.swift in Sources */,
A0414C1D278C275C00DF3FE9 /* ACHDirectDebitComponent.swift in Sources */,
00EA4ED7280590050053D938 /* AtomeAddressViewModelBuilder.swift in Sources */,
Expand All @@ -7448,6 +7485,7 @@
8108315D2A4D8C7B0092FAF7 /* IssuerListEmptyView.swift in Sources */,
F9B016F92604F3FF001F23FC /* BasicPersonalInfoFormComponent.swift in Sources */,
C9D8EB9B2745282E006D8CA1 /* BACSInputPresenter.swift in Sources */,
81272F182CC7E1DD00D8773A /* PayByBankUSComponent+ConfirmationViewController.swift in Sources */,
F9175EC32593950D00D653BE /* QiwiWalletDetails.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
3 changes: 3 additions & 0 deletions Adyen/Core/Core Protocols/PaymentComponentBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ public protocol PaymentComponentBuilder: AdyenContextAware {

/// Builds a certain `PaymentComponent` based on a `StoredTwintPaymentMethod`.
func build(paymentMethod: StoredTwintPaymentMethod) -> PaymentComponent?

/// Builds a certain `PaymentComponent` based on a `PayByBankUSPaymentMethod`.
func build(paymentMethod: PayByBankUSPaymentMethod) -> PaymentComponent?

/// Builds a certain `PaymentComponent` based on any `PaymentMethod`, as a default case.
func build(paymentMethod: PaymentMethod) -> PaymentComponent?
Expand Down
2 changes: 2 additions & 0 deletions Adyen/Core/Models/DisplayInformation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ public struct DisplayInformation: Equatable {
/// An optional custom `accessibilityLabel` to use.
@_spi(AdyenInternal)
public let accessibilityLabel: String?

// TODO: Allow adding a custom view - to show the bank icons

/// Initializes a`DisplayInformation`.
///
Expand Down
8 changes: 5 additions & 3 deletions Adyen/Core/Payment Methods/Abstract/AnyPaymentMethod.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ internal enum AnyPaymentMethod: Codable {
case storedPayPal(StoredPayPalPaymentMethod)
case storedBCMC(StoredBCMCPaymentMethod)
case storedBlik(StoredBLIKPaymentMethod)
case storedPayByBankPlaid(StoredPayByBankPlaidPaymentMethod)
case storedPayByBankUS(StoredPayByBankUSPaymentMethod)
case storedAchDirectDebit(StoredACHDirectDebitPaymentMethod)
case storedCashAppPay(StoredCashAppPayPaymentMethod)
case storedTwint(StoredTwintPaymentMethod)
Expand Down Expand Up @@ -42,6 +42,7 @@ internal enum AnyPaymentMethod: Codable {
case upi(UPIPaymentMethod)
case cashAppPay(CashAppPayPaymentMethod)
case twint(TwintPaymentMethod)
case payByBankUS(PayByBankUSPaymentMethod)

case none

Expand Down Expand Up @@ -80,13 +81,14 @@ internal enum AnyPaymentMethod: Codable {
case let .upi(paymentMethod): return paymentMethod
case let .cashAppPay(paymentMethod): return paymentMethod
case let .twint(paymentMethod): return paymentMethod
case let .storedPayByBankPlaid(paymentMethod): return paymentMethod
case let .storedPayByBankUS(paymentMethod): return paymentMethod
case let .payByBankUS(paymentMethod): return paymentMethod
case .none: return nil
}
}

// MARK: - Decoding

internal init(from decoder: Decoder) throws {
self = AnyPaymentMethodDecoder.decode(from: decoder)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ internal enum AnyPaymentMethodDecoder {
.upi: UPIPaymentMethodDecoder(),
.cashAppPay: CashAppPayPaymentMethodDecoder(),
.twint: TwintPaymentMethodDecoder(),
.payByBankPlaid: PayByBankPlaidPaymentMethodDecoder()
.payByBankAISDD: PayByBankUSPaymentMethodDecoder()
]

private static var defaultDecoder: PaymentMethodDecoder = InstantPaymentMethodDecoder()
Expand Down Expand Up @@ -341,21 +341,21 @@ private struct BLIKPaymentMethodDecoder: PaymentMethodDecoder {
}
}

private struct PayByBankPlaidPaymentMethodDecoder: PaymentMethodDecoder {
private struct PayByBankUSPaymentMethodDecoder: PaymentMethodDecoder {
func decode(from decoder: Decoder, isStored: Bool) throws -> AnyPaymentMethod {
if isStored {
return try .storedPayByBankPlaid(StoredPayByBankPlaidPaymentMethod(from: decoder))
return try .storedPayByBankUS(.init(from: decoder))
} else {
return try .instant(InstantPaymentMethod(from: decoder))
return try .payByBankUS(.init(from: decoder))
}
}

func anyPaymentMethod(from paymentMethod: any PaymentMethod) -> AnyPaymentMethod? {
if let method = paymentMethod as? StoredPayByBankPlaidPaymentMethod {
return .storedPayByBankPlaid(method)
if let method = paymentMethod as? StoredPayByBankUSPaymentMethod {
return .storedPayByBankUS(method)
}
if let method = paymentMethod as? InstantPaymentMethod {
return .instant(method)
if let method = paymentMethod as? PayByBankUSPaymentMethod {
return .payByBankUS(method)
}
return nil
}
Expand Down
8 changes: 4 additions & 4 deletions Adyen/Core/Payment Methods/Abstract/PaymentMethodType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public enum PaymentMethodType: RawRepresentable, Hashable, Codable {
case upi
case cashAppPay
case twint
case payByBankPlaid
case payByBankAISDD
case other(String)

// Unsupported
Expand Down Expand Up @@ -130,7 +130,7 @@ public enum PaymentMethodType: RawRepresentable, Hashable, Codable {
case "cashapp": self = .cashAppPay
case "bizum": self = .bizum
case "twint": self = .twint
case "paybybank_AIS_DD": self = .payByBankPlaid
case "paybybank_AIS_DD": self = .payByBankAISDD
default: self = .other(rawValue)
}
}
Expand Down Expand Up @@ -193,7 +193,7 @@ public enum PaymentMethodType: RawRepresentable, Hashable, Codable {
case .cashAppPay: return "cashapp"
case .bizum: return "bizum"
case .twint: return "twint"
case .payByBankPlaid: return "paybybank_AIS_DD"
case .payByBankAISDD: return "paybybank_AIS_DD"
case let .other(value): return value
}
}
Expand Down Expand Up @@ -263,7 +263,7 @@ extension PaymentMethodType {
case .cashAppPay: return "cash app"
case .bizum: return "bizum"
case .twint: return "twint"
case .payByBankPlaid: return "Pay By Bank using Plaid"
case .payByBankAISDD: return "Pay By Bank Direct Debit"
case let .other(name): return name.replacingOccurrences(of: "_", with: " ")
}
}
Expand Down
26 changes: 26 additions & 0 deletions Adyen/Core/Payment Methods/PayByBankUSPaymentMethod.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//
// 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.
goergisn marked this conversation as resolved.
Show resolved Hide resolved
public struct PayByBankUSPaymentMethod: PaymentMethod {
public let type: PaymentMethodType

public var name: String

public var merchantProvidedDisplayInformation: MerchantCustomDisplayInformation?

@_spi(AdyenInternal)
public func buildComponent(using builder: PaymentComponentBuilder) -> PaymentComponent? {
builder.build(paymentMethod: self)
}

private enum CodingKeys: String, CodingKey {
case type
case name
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

import Foundation

/// Stored PayByBank payment.
public struct StoredPayByBankPlaidPaymentMethod: StoredPaymentMethod {
/// Stored PayByBank US payment.
goergisn marked this conversation as resolved.
Show resolved Hide resolved
public struct StoredPayByBankUSPaymentMethod: StoredPaymentMethod {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ This is a fully breaking change, can we keep struct and maybe create a typealias?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found StoredPayByBankPlaidPaymentMethod was added in the base branch. Let's rethink which branch to target when we run api diff? Options:

  • develop (then we might have all long-living branch changes)
  • latest release tag (then every time we have all development changes combined)

Or we can switch off api diff for all PRs not targeting develop and deal with all changes when we merge long-living branch into develop. The only concern I have is that usually it's a common sentiment to merge as fast as possible because "everything was reviewed", everyone has seen the code multiple times and naturally you just want to merge it asap.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that's a tricky one - also thought about it.
I want to see the changes to the target branch but also agree that it would be nice to see the full change set to develop/release.
We could run it twice if the target branch is not develop and we're not in a release branch - so it creates 2 comments (one to the target branch and one to develop) - 🤔


public let type: PaymentMethodType

Expand Down
Loading
Loading