Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
joyceqin-stripe committed Nov 14, 2024
1 parent 7e3dfd5 commit 71e3b3f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ final class SavedPaymentOptionsViewControllerSnapshotTests: STPSnapshotTestCase
STPPaymentMethod._testUSBankAccount(),
STPPaymentMethod._testSEPA(),
]
let config = SavedPaymentOptionsViewController.Configuration(customerID: "cus_123", showApplePay: true, showLink: true, removeSavedPaymentMethodMessage: nil, merchantDisplayName: "Test Merchant", isCVCRecollectionEnabled: false, isTestMode: false, allowsRemovalOfLastSavedPaymentMethod: false, allowsRemovalOfPaymentMethods: true)
let config = SavedPaymentOptionsViewController.Configuration(customerID: "cus_123", showApplePay: true, showLink: true, removeSavedPaymentMethodMessage: nil, merchantDisplayName: "Test Merchant", isCVCRecollectionEnabled: false, isTestMode: false, allowsRemovalOfLastSavedPaymentMethod: false, allowsRemovalOfPaymentMethods: true, defaultSPMFlag: false)
let intent = Intent.deferredIntent(intentConfig: .init(mode: .payment(amount: 0, currency: "USD", setupFutureUsage: nil, captureMethod: .automatic), confirmHandler: { _, _, _ in }))
let sut = SavedPaymentOptionsViewController(savedPaymentMethods: paymentMethods,
configuration: config,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ class SavedPaymentOptionsViewControllerTests: XCTestCase {
}

// MARK: Helpers
func savedPaymentOptionsConfig(allowsRemovalOfLastSavedPaymentMethod: Bool, allowsRemovalOfPaymentMethods: Bool) -> SavedPaymentOptionsViewController.Configuration {
func savedPaymentOptionsConfig(allowsRemovalOfLastSavedPaymentMethod: Bool, allowsRemovalOfPaymentMethods: Bool, defaultSPMFlag: Bool = false) -> SavedPaymentOptionsViewController.Configuration {
return SavedPaymentOptionsViewController.Configuration(customerID: "cus_123",
showApplePay: true,
showLink: true,
Expand All @@ -303,7 +303,8 @@ class SavedPaymentOptionsViewControllerTests: XCTestCase {
isCVCRecollectionEnabled: true,
isTestMode: true,
allowsRemovalOfLastSavedPaymentMethod: allowsRemovalOfLastSavedPaymentMethod,
allowsRemovalOfPaymentMethods: allowsRemovalOfPaymentMethods)
allowsRemovalOfPaymentMethods: allowsRemovalOfPaymentMethods,
defaultSPMFlag: defaultSPMFlag)
}

func savedPaymentOptionsController(_ configuration: SavedPaymentOptionsViewController.Configuration,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,16 @@ final class UpdateCardViewControllerSnapshotTests: STPSnapshotTestCase {
_test_UpdateCardViewController(darkMode: false, isEmbeddedSingleCard: true, appearance: ._testMSPaintTheme)
}

func _test_UpdateCardViewController(darkMode: Bool, isEmbeddedSingleCard: Bool = false, appearance: PaymentSheet.Appearance = .default) {
func _test_UpdateCardViewController(darkMode: Bool, canEditCard: Bool = true, isEmbeddedSingleCard: Bool = false, appearance: PaymentSheet.Appearance = .default) {
let sut = UpdateCardViewController(paymentMethod: STPFixtures.paymentMethod(),
removeSavedPaymentMethodMessage: "Test removal string",
appearance: appearance,
hostedSurface: .paymentSheet,
canEditCard: canEditCard,
canRemoveCard: true,
isTestMode: false)
isTestMode: false,
defaultSPMFlag: true
)
let bottomSheet: BottomSheetViewController
if isEmbeddedSingleCard {
bottomSheet = BottomSheetViewController(contentViewController: sut, appearance: appearance, isTestMode: true, didCancelNative3DS2: {})
Expand Down

0 comments on commit 71e3b3f

Please sign in to comment.