Skip to content
Draft
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"images" : [
{
"filename" : "cbcLight.svg",
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "cbcDark.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}
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.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import UIKit
extension STPCardBrand {
func brandIconAttributedString(theme: ElementsAppearance = .default, maxWidth: CGFloat? = nil) -> NSAttributedString {
let brandImageAttachment = NSTextAttachment()
let image: UIImage = self == .unknown ? STPImageLibrary.cardBrandChoiceImage() : STPImageLibrary.cardBrandImage(for: self)
let image: UIImage = self == .unknown ? PaymentSheetImageLibrary.cardBrandChoiceImage() : PaymentSheetImageLibrary.cardBrandImage(for: self)
brandImageAttachment.image = image
// TODO: -3 is a hack for proper vertical alignment, investigate this
let hackyVerticalInset: CGFloat = -3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,13 @@ class PaymentSheetImageLibrary {
class func unknownCardCardImage() -> UIImage {
return cardBrandImage(for: .unknown)
}

/// This returns the icon for an unselected brand when multiple card brands are available.
class func cardBrandChoiceImage()
-> UIImage
{
return self.safeImageNamed("ps_card_cbc", templateIfAvailable: false)
}
}

// MARK: - v2 Images
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import UIKit

@_spi(STP) import StripeCore
@_spi(STP) import StripePaymentsUI
@_spi(STP) import StripeUICore

protocol UpdatePaymentViewControllerDelegate: AnyObject {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import Foundation
@_spi(STP) import StripeCore
@_spi(STP) import StripePayments
@_spi(STP) import StripePaymentsUI
@_spi(STP) import StripeUICore

protocol PayWithLinkWalletViewModelDelegate: AnyObject {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//

@_spi(STP) import StripeCore
@_spi(STP) import StripePaymentsUI
@_spi(STP) import StripeUICore
import UIKit

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ import UIKit
) {
fatalError("init(coder:) has not been implemented")
}

/// Card brand to display.
var cardBrand: STPCardBrand = .unknown {
didSet {
Expand Down
Loading