Skip to content

Commit e3ceee8

Browse files
committed
Fix images in StripeCryptoOnramp
1 parent 4c6f7e2 commit e3ceee8

File tree

4 files changed

+28
-6
lines changed

4 files changed

+28
-6
lines changed

StripeCryptoOnramp/StripeCryptoOnramp.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
0BF41E8B2E3AB84800CA4171 /* IdType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BF41E8A2E3AB84800CA4171 /* IdType.swift */; };
5050
490D4AAE2E552D6F00FAF4FF /* PlatformSettingsResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4907AF502E54B80000F0C49D /* PlatformSettingsResponse.swift */; };
5151
490D4AC72E5541A600FAF4FF /* CreatePaymentTokenRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 490D4AC62E5541A600FAF4FF /* CreatePaymentTokenRequest.swift */; };
52+
49B34BBB2E5D0ACC0067E44F /* Image.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49B34BBA2E5D0ACC0067E44F /* Image.swift */; };
5253
49B7F6882E57988D0053C83B /* OnrampSessionResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49B7F6872E57988D0053C83B /* OnrampSessionResponse.swift */; };
5354
49D233A82E439EB900F51263 /* CryptoNetwork.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49D233A72E439EB900F51263 /* CryptoNetwork.swift */; };
5455
49D233AA2E439FAA00F51263 /* RegisterWalletRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49D233A92E439FAA00F51263 /* RegisterWalletRequest.swift */; };
@@ -125,6 +126,7 @@
125126
0BF41E8A2E3AB84800CA4171 /* IdType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IdType.swift; sourceTree = "<group>"; };
126127
4907AF502E54B80000F0C49D /* PlatformSettingsResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlatformSettingsResponse.swift; sourceTree = "<group>"; };
127128
490D4AC62E5541A600FAF4FF /* CreatePaymentTokenRequest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreatePaymentTokenRequest.swift; sourceTree = "<group>"; };
129+
49B34BBA2E5D0ACC0067E44F /* Image.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Image.swift; sourceTree = "<group>"; };
128130
49B7F6872E57988D0053C83B /* OnrampSessionResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnrampSessionResponse.swift; sourceTree = "<group>"; };
129131
49D233A72E439EB900F51263 /* CryptoNetwork.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CryptoNetwork.swift; sourceTree = "<group>"; };
130132
49D233A92E439FAA00F51263 /* RegisterWalletRequest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RegisterWalletRequest.swift; sourceTree = "<group>"; };
@@ -197,6 +199,7 @@
197199
49D73DF22E4E499F00E35F1F /* StripeCryptoOnrampBundleLocator.swift */,
198200
49D73DF42E4E49C300E35F1F /* STPLocalizedString+StripeCryptoOnramp.swift */,
199201
49D73DF82E4E49EC00E35F1F /* String+Localized.swift */,
202+
49B34BBA2E5D0ACC0067E44F /* Image.swift */,
200203
);
201204
path = Internal;
202205
sourceTree = "<group>";
@@ -483,6 +486,7 @@
483486
0B63C98E2E4CF8CD005D8BD2 /* ApplePayPaymentStatus.swift in Sources */,
484487
0BF41E892E3AB82E00CA4171 /* KycInfo.swift in Sources */,
485488
0BA705082E4132640044B483 /* KYCDataCollectionResponse.swift in Sources */,
489+
49B34BBB2E5D0ACC0067E44F /* Image.swift in Sources */,
486490
49D233AC2E439FB200F51263 /* RegisterWalletResponse.swift in Sources */,
487491
0B6DF34B2E297E0A008B1800 /* CustomerRequest.swift in Sources */,
488492
0B089E692E5378F7007D160E /* PaymentMethodType.swift in Sources */,

StripeCryptoOnramp/StripeCryptoOnramp/Source/Components/CryptoOnrampCoordinator.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import PassKit
1414
@_spi(STP) import StripePayments
1515
@_spi(STP) import StripePaymentSheet
1616
@_spi(STP) import StripePaymentsUI
17+
@_spi(STP) import StripeUICore
1718

1819
import UIKit
1920

@@ -448,13 +449,13 @@ extension CryptoOnrampCoordinator: ApplePayContextDelegate {
448449
private extension CryptoOnrampCoordinator {
449450
func fetchMerchantImageWithFallback() async -> UIImage {
450451
guard let merchantLogoUrl = await linkController.merchantLogoUrl else {
451-
return .wallet
452+
return Image.wallet.makeImage()
452453
}
453454

454455
do {
455456
return try await DownloadManager.sharedManager.downloadImage(url: merchantLogoUrl)
456457
} catch {
457-
return .wallet
458+
return Image.wallet.makeImage()
458459
}
459460
}
460461

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//
2+
// Image.swift
3+
// StripeCryptoOnramp
4+
//
5+
// Created by Mat Schmid on 8/25/25.
6+
//
7+
8+
import Foundation
9+
@_spi(STP) import StripeUICore
10+
11+
/// The canonical set of all image files in the `StripeCryptoOnramp` module.
12+
@_spi(STP) public enum Image: String, CaseIterable, ImageMaker {
13+
@_spi(STP) public typealias BundleLocator = StripeCryptoOnrampBundleLocator
14+
15+
case wallet = "wallet"
16+
}

StripeCryptoOnramp/StripeCryptoOnramp/Source/Internal/StripeCryptoOnrampBundleLocator.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@
88
import Foundation
99
@_spi(STP) import StripeCore
1010

11+
@_spi(STP) public
1112
final class StripeCryptoOnrampBundleLocator: BundleLocatorProtocol {
12-
static let internalClass: AnyClass = StripeCryptoOnrampBundleLocator.self
13-
static let bundleName = "StripeCryptoOnrampBundle"
13+
public static let internalClass: AnyClass = StripeCryptoOnrampBundleLocator.self
14+
public static let bundleName = "StripeCryptoOnrampBundle"
1415
#if SWIFT_PACKAGE
15-
static let spmResourcesBundle = Bundle.module
16+
public static let spmResourcesBundle = Bundle.module
1617
#endif
17-
static let resourcesBundle = StripeCryptoOnrampBundleLocator.computeResourcesBundle()
18+
public static let resourcesBundle = StripeCryptoOnrampBundleLocator.computeResourcesBundle()
1819
}

0 commit comments

Comments
 (0)