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

fix: Align accountNumberLast4Digits with Android #1066

Merged
merged 4 commits into from
Dec 21, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
10 changes: 5 additions & 5 deletions Debug App/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ PODS:
- PrimerIPay88MYSDK (0.1.7)
- PrimerKlarnaSDK (1.1.1)
- PrimerNolPaySDK (1.0.1)
- PrimerSDK (2.32.1):
- PrimerSDK/Core (= 2.32.1)
- PrimerSDK/Core (2.32.1)
- PrimerSDK (2.33.0):
- PrimerSDK/Core (= 2.33.0)
- PrimerSDK/Core (2.33.0)
- PrimerStripeSDK (1.0.0)

DEPENDENCIES:
Expand Down Expand Up @@ -37,9 +37,9 @@ SPEC CHECKSUMS:
PrimerIPay88MYSDK: 436ee0be7e2c97e4e81456ccddee20175e9e3c4d
PrimerKlarnaSDK: 564105170cc7b467bf95c31851813ea41c468f8b
PrimerNolPaySDK: 08b140ed39b378a0b33b4f8746544a402175c0cc
PrimerSDK: 41eb9f627fa189f3edafdb18ea2a671d4403b3e2
PrimerSDK: a64ea688718f9dcf99735fff3ffdb7c97ae1036e
PrimerStripeSDK: c37d4e7c1b5256d67d4890c4cc4b38ddc9427489

PODFILE CHECKSUM: fa17ead44d40b0b09abc2f30a5cc3d8aefe389e1

COCOAPODS: 1.16.2
COCOAPODS: 1.15.2
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,11 @@ class MerchantVaultedPaymentMethodCell: UITableViewCell {
self.paymentMethodLabel.text = "Failed to find logo for \(paymentMethod.paymentMethodType)"
}

paymentMethodLabel.text = "Pay with \(paymentMethodAsset.paymentMethodName) "

if paymentMethod.paymentMethodType == "STRIPE_ACH" {
paymentMethodLabel.text = "Pay with ACH \(paymentMethod.paymentInstrumentData.bankName ?? "-") **** \(paymentMethod.paymentInstrumentData.accountNumberLast4Digits ?? "-")"
} else {
paymentMethodLabel.text = "Pay with \(paymentMethodAsset.paymentMethodName) "
}
} else {
self.paymentMethodLogoView.isHidden = true
self.paymentMethodLabel.isHidden = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ extension Response.Body.Tokenization {
case .stripeAch:
return CardButtonViewModel(
network: self.paymentInstrumentData?.bankName ?? "Bank account",
cardholder: "•••• \(self.paymentInstrumentData?.accountNumberLastFourDigits ?? "")",
cardholder: "•••• \(self.paymentInstrumentData?.accountNumberLast4Digits ?? "")",
last4: "",
expiry: "",
imageName: self.icon,
Expand Down Expand Up @@ -154,14 +154,43 @@ extension Response.Body.Tokenization {
public let sessionInfo: SessionInfo?

public let bankName: String?
public let accountNumberLastFourDigits: String?
public let accountNumberLast4Digits: String?

// swiftlint:disable:next nesting
public struct SessionInfo: Codable {
public let locale: String?
public let platform: String?
public let redirectionUrl: String?
}

// swiftlint:disable:next nesting
enum CodingKeys: String, CodingKey {
case paypalBillingAgreementId
case first6Digits
case last4Digits
case expirationMonth
case expirationYear
case cardholderName
case network
case isNetworkTokenized
case klarnaCustomerToken
case sessionData
case externalPayerInfo
case shippingAddress
case binData
case threeDSecureAuthentication
case gocardlessMandateId
case authorizationToken
// swiftlint:disable:next identifier_name
case mx
case currencyCode
case productId
case paymentMethodConfigId
case paymentMethodType
case sessionInfo
case bankName
case accountNumberLast4Digits = "accountNumberLastFourDigits"
}
}
}

Expand Down
10 changes: 5 additions & 5 deletions Tests/Primer/v2/HeadlessVaultManagerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ final class HeadlessVaultManagerTests: XCTestCase {
paymentMethodType: nil,
sessionInfo: nil,
bankName: nil,
accountNumberLastFourDigits: nil),
accountNumberLast4Digits: nil),
threeDSecureAuthentication: nil,
token: "anything",
tokenType: .multiUse,
Expand Down Expand Up @@ -305,7 +305,7 @@ final class HeadlessVaultManagerTests: XCTestCase {
paymentMethodType: nil,
sessionInfo: nil,
bankName: nil,
accountNumberLastFourDigits: nil),
accountNumberLast4Digits: nil),
threeDSecureAuthentication: nil,
token: "anything",
tokenType: .multiUse,
Expand Down Expand Up @@ -395,7 +395,7 @@ final class HeadlessVaultManagerTests: XCTestCase {
paymentMethodType: nil,
sessionInfo: nil,
bankName: nil,
accountNumberLastFourDigits: nil),
accountNumberLast4Digits: nil),
analyticsId: "analytics-id")
]

Expand Down Expand Up @@ -474,7 +474,7 @@ final class HeadlessVaultManagerTests: XCTestCase {
paymentMethodType: nil,
sessionInfo: nil,
bankName: nil,
accountNumberLastFourDigits: nil),
accountNumberLast4Digits: nil),
analyticsId: "analytics-id")
]

Expand Down Expand Up @@ -515,7 +515,7 @@ final class HeadlessVaultManagerTests: XCTestCase {
paymentMethodType: nil,
sessionInfo: nil,
bankName: nil,
accountNumberLastFourDigits: nil),
accountNumberLast4Digits: nil),
analyticsId: "analytics-id")
]

Expand Down
2 changes: 1 addition & 1 deletion Tests/Utilities/Mocks.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class Mocks {
paymentMethodType: nil,
sessionInfo: nil,
bankName: nil,
accountNumberLastFourDigits: nil)
accountNumberLast4Digits: nil)

static var payment = Response.Body.Payment(
id: "mock_id",
Expand Down
Loading