Skip to content

Commit

Permalink
Remove space for bank and SEPA (#4422)
Browse files Browse the repository at this point in the history
## Summary
<!-- Simple summary of what was changed. -->

This pull request removes the space before the last4 again for bank and
SEPA.

## Motivation
<!-- Why are you making this change? If it's for fixing a bug, if
possible, please include a code snippet or example project that
demonstrates the issue. -->

## Testing
<!-- How was the code tested? Be as specific as possible. -->

## Changelog
<!-- Is this a notable change that affects users? If so, add a line to
`CHANGELOG.md` and prefix the line with one of the following:
    - [Added] for new features.
    - [Changed] for changes in existing functionality.
    - [Deprecated] for soon-to-be removed features.
    - [Removed] for now removed features.
    - [Fixed] for any bug fixes.
    - [Security] in case of vulnerabilities.
-->
  • Loading branch information
tillh-stripe authored Dec 21, 2024
1 parent 4cbd6d4 commit 672dc10
Show file tree
Hide file tree
Showing 32 changed files with 29 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ class CustomerSheetUITest: XCTestCase {

presentCSAndAddSepaFrom(buttonLabel: "None")

app.staticTexts["•••• 3000"].waitForExistenceAndTap(timeout: timeout)
app.staticTexts["••••3000"].waitForExistenceAndTap(timeout: timeout)

let editButton = app.staticTexts["Edit"]
XCTAssertTrue(editButton.waitForExistence(timeout: timeout))
Expand All @@ -273,7 +273,7 @@ class CustomerSheetUITest: XCTestCase {
app.buttons["Reload"].tap()
XCTAssertTrue(app.staticTexts["None"].waitForExistenceAndTap(timeout: 5))
XCTAssertTrue(app.staticTexts["Manage your payment methods"].waitForExistence(timeout: 5))
XCTAssertFalse(app.staticTexts["•••• 3000"].waitForExistence(timeout: 5))
XCTAssertFalse(app.staticTexts["••••3000"].waitForExistence(timeout: 5))
}

func testPrevPM_AddPM_canceled() throws {
Expand Down Expand Up @@ -350,7 +350,7 @@ class CustomerSheetUITest: XCTestCase {
XCTAssertTrue(confirmButton.waitForExistence(timeout: timeout))
confirmButton.tap()

dismissAlertView(alertBody: "Success: •••• 6789, selected", alertTitle: "Complete", buttonToTap: "OK")
dismissAlertView(alertBody: "Success: ••••6789, selected", alertTitle: "Complete", buttonToTap: "OK")
}

func testCustomerSheet_addUSBankAccount_MicroDeposit() throws {
Expand Down Expand Up @@ -783,7 +783,7 @@ class CustomerSheetUITest: XCTestCase {
let confirmButton = app.buttons["Confirm"]
XCTAssertTrue(confirmButton.waitForExistence(timeout: timeout))
confirmButton.tap()
dismissAlertView(alertBody: "Success: •••• 3000, selected", alertTitle: "Complete", buttonToTap: "OK")
dismissAlertView(alertBody: "Success: ••••3000, selected", alertTitle: "Complete", buttonToTap: "OK")
}

func removeFirstPaymentMethodInList(alertBody: String = "Visa •••• 4242", alertTitle: String = "Remove card?") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,10 +340,10 @@ class EmbeddedUITests: PaymentSheetUITestCase {

loadPlayground(app, settings)
app.buttons["Present embedded payment element"].waitForExistenceAndTap()
ensureSPMSelection("•••• 6789", insteadOf: "•••• 4242")
ensureSPMSelection("••••6789", insteadOf: "•••• 4242")

let card4242Button = app.buttons["•••• 4242"]
let bank6789Button = app.buttons["•••• 6789"]
let bank6789Button = app.buttons["••••6789"]

// Switch from 6789 (Bank account) to 4242
app.buttons["View more"].waitForExistenceAndTap()
Expand Down Expand Up @@ -401,9 +401,9 @@ class EmbeddedUITests: PaymentSheetUITestCase {

loadPlayground(app, settings)
app.buttons["Present embedded payment element"].waitForExistenceAndTap()
ensureSPMSelection("•••• 6789", insteadOf: "•••• 4242")
ensureSPMSelection("••••6789", insteadOf: "•••• 4242")

let bank6789Button = app.buttons["•••• 6789"]
let bank6789Button = app.buttons["••••6789"]
let applePayButton = app.buttons["Apple Pay"]

// Ensure card bank acct. is selected, and apple pay is not.
Expand Down Expand Up @@ -491,7 +491,7 @@ class EmbeddedUITests: PaymentSheetUITestCase {

// Verify we show the bank account in the saved PM row
XCTAssertTrue(app.buttons["Edit"].waitForExistence(timeout: 10))
XCTAssertFalse(app.buttons["•••• 6789"].isSelected)
XCTAssertFalse(app.buttons["••••6789"].isSelected)
XCTAssertTrue(app.buttons["Cash App Pay"].isSelected)
XCTAssertTrue(app.staticTexts["Cash App Pay"].waitForExistence(timeout: 10))
}
Expand All @@ -508,10 +508,10 @@ class EmbeddedUITests: PaymentSheetUITestCase {
loadPlayground(app, settings)

app.buttons["Present embedded payment element"].waitForExistenceAndTap()
ensureSPMSelection("•••• 6789", insteadOf: "•••• 4242")
ensureSPMSelection("••••6789", insteadOf: "•••• 4242")

XCTAssertTrue(app.staticTexts["•••• 6789"].waitForExistence(timeout: 10))
XCTAssertTrue(app.buttons["•••• 6789"].isSelected)
XCTAssertTrue(app.staticTexts["••••6789"].waitForExistence(timeout: 10))
XCTAssertTrue(app.buttons["••••6789"].isSelected)
XCTAssertTrue(app.buttons["Checkout"].waitForExistenceAndTap())
XCTAssertTrue(app.staticTexts["Success!"].waitForExistence(timeout: 10))

Expand Down Expand Up @@ -639,7 +639,7 @@ class EmbeddedUITests: PaymentSheetUITestCase {
XCTAssertTrue(app.staticTexts["Add US bank account"].waitForExistence(timeout: 10))
app.buttons["Continue"].waitForExistenceAndTap()
XCTAssertTrue(app.staticTexts["Payment method"].waitForExistence(timeout: 10))
XCTAssertEqual(app.staticTexts["Payment method"].label, "•••• 6789")
XCTAssertEqual(app.staticTexts["Payment method"].label, "••••6789")
XCTAssertTrue(app.buttons["US bank account"].isSelected)
XCTAssertTrue(app.buttons["Checkout"].isEnabled)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ class PaymentSheetStandardLPMUITwoTests: PaymentSheetStandardLPMUICase {
// Reload w/ same customer
reload(app, settings: settings)
// This time, expect SEPA to be pre-selected as the default
XCTAssert(paymentMethodButton.label.hasPrefix("•••• 3201, sepa_debit"))
XCTAssert(paymentMethodButton.label.hasPrefix("••••3201, sepa_debit"))

// Tapping confirm without presenting flowcontroller should show the mandate
app.buttons["Confirm"].tap()
Expand All @@ -575,7 +575,7 @@ class PaymentSheetStandardLPMUITwoTests: PaymentSheetStandardLPMUICase {
// Reload w/ same customer
reload(app, settings: settings)
// If you present the flowcontroller and see the mandate...
XCTAssert(paymentMethodButton.label.hasPrefix("•••• 3201, sepa_debit"))
XCTAssert(paymentMethodButton.label.hasPrefix("••••3201, sepa_debit"))
paymentMethodButton.waitForExistenceAndTap()

XCTAssertTrue(app.otherElements.matching(identifier: "mandatetextview").element.exists)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2699,7 +2699,7 @@ extension PaymentSheetUITestCase {
// Reload and pay with the now-saved US bank account
reload(app, settings: settings)
app.buttons["Present PaymentSheet"].tap()
XCTAssertTrue(app.buttons["•••• 6789"].waitForExistenceAndTap())
XCTAssertTrue(app.buttons["••••6789"].waitForExistenceAndTap())

// Make sure bottom notice mandate is visible
XCTAssertTrue(app.textViews["By continuing, you agree to authorize payments pursuant to these terms."].exists)
Expand Down Expand Up @@ -2758,7 +2758,7 @@ extension PaymentSheetUITestCase {
// Give time for the dismiss animation
sleep(2)
app.buttons["Continue"].waitForExistenceAndTap(timeout: 10)
XCTAssertTrue(app.staticTexts["•••• 6789"].waitForExistence(timeout: 10))
XCTAssertTrue(app.staticTexts["••••6789"].waitForExistence(timeout: 10))
app.buttons["Confirm"].waitForExistenceAndTap(timeout: 10)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class PaymentSheetVerticalUITests: PaymentSheetUITestCase {
// Reload
reload(app, settings: settings)
XCTAssertTrue(paymentMethodButton.waitForExistence(timeout: 10))
XCTAssertEqual(paymentMethodButton.label, "•••• 3000, sepa_debit, John Doe, test@example.com, 123 Main, San Francisco, CA, 94016, US")
XCTAssertEqual(paymentMethodButton.label, "••••3000, sepa_debit, John Doe, test@example.com, 123 Main, San Francisco, CA, 94016, US")
paymentMethodButton.tap()

// Switch to the saved card...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ extension STPPaymentMethod {
case .card:
return "•••• \(card?.last4 ?? "")"
case .SEPADebit:
return "•••• \(sepaDebit?.last4 ?? "")"
// The missing space is not an oversight, but on purpose
return "••••\(sepaDebit?.last4 ?? "")"
case .USBankAccount:
return "•••• \(usBankAccount?.last4 ?? "")"
// The missing space is not an oversight, but on purpose
return "••••\(usBankAccount?.last4 ?? "")"
default:
return type.displayName
}
Expand Down Expand Up @@ -48,7 +50,7 @@ extension STPPaymentMethod {

func paymentOptionLabel(confirmParams: IntentConfirmParams?) -> String {
if let instantDebitsLinkedBank = confirmParams?.instantDebitsLinkedBank {
return "•••• \(instantDebitsLinkedBank.last4 ?? "")"
return "••••\(instantDebitsLinkedBank.last4 ?? "")"
} else {
return paymentSheetLabel
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ final class IntentConfirmParams {

var paymentSheetLabel: String {
if let last4 = (financialConnectionsLinkedBank?.last4 ?? instantDebitsLinkedBank?.last4) {
return "•••• \(last4)"
return "••••\(last4)"
} else {
return paymentMethodParams.paymentSheetLabel
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ final class InstantDebitsPaymentMethodElement: ContainerElement {
self.linkedBank = linkedBank
if let last4ofBankAccount = linkedBank.last4, let bankName = linkedBank.bankName {
linkedBankInfoView.setBankName(text: bankName)
linkedBankInfoView.setLastFourOfBank(text: "•••• \(last4ofBankAccount)")
linkedBankInfoView.setLastFourOfBank(text: "••••\(last4ofBankAccount)")
// TODO: Take the eligibility from the linked bank
linkedBankInfoView.setIncentiveEligible(false)
formElement.toggleElements(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ final class USBankAccountPaymentMethodElement: ContainerElement {
if let last4ofBankAccount = linkedBank?.last4,
let bankName = linkedBank?.bankName {
bankInfoView.setBankName(text: bankName)
bankInfoView.setLastFourOfBank(text: "•••• \(last4ofBankAccount)")
bankInfoView.setLastFourOfBank(text: "••••\(last4ofBankAccount)")
formElement.toggleElements(linkedAccountElements, hidden: false, animated: animated)
} else {
formElement.toggleElements(linkedAccountElements, hidden: true, animated: animated)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ final class BankAccountInfoViewSnapshotTests : STPSnapshotTestCase {
incentive: nil
)
view.setBankName(text: "Stripe Bank")
view.setLastFourOfBank(text: "•••• 4242")
view.setLastFourOfBank(text: "••••4242")
view.setIncentiveEligible(false)

verify(view)
Expand All @@ -33,7 +33,7 @@ final class BankAccountInfoViewSnapshotTests : STPSnapshotTestCase {
incentive: .init(identifier: "link_instant_debits", displayText: "$5")
)
view.setBankName(text: "Stripe Bank")
view.setLastFourOfBank(text: "•••• 4242")
view.setLastFourOfBank(text: "••••4242")
view.setIncentiveEligible(true)

verify(view)
Expand All @@ -46,7 +46,7 @@ final class BankAccountInfoViewSnapshotTests : STPSnapshotTestCase {
incentive: .init(identifier: "link_instant_debits", displayText: "$5")
)
view.setBankName(text: "The Official Stripe Bank")
view.setLastFourOfBank(text: "•••• 4242")
view.setLastFourOfBank(text: "••••4242")
view.setIncentiveEligible(true)

verify(view)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 672dc10

Please sign in to comment.