Skip to content
Open
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
13 changes: 13 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ let package = Package(
.library(
name: "StripeConnect",
targets: ["StripeConnect"]
),
.library(
name: "StripeCryptoOnramp",
targets: ["StripeCryptoOnramp"]
)
],
targets: [
Expand Down Expand Up @@ -161,6 +165,15 @@ let package = Package(
name: "StripeConnect",
dependencies: ["StripeCore", "StripeUICore", "StripeFinancialConnections"],
path: "StripeConnect/StripeConnect"
),
.target(
name: "StripeCryptoOnramp",
dependencies: ["StripeCore", "StripeUICore", "StripeApplePay", "StripeIdentity", "StripePayments", "StripePaymentSheet", "StripePaymentsUI"],
path: "StripeCryptoOnramp/StripeCryptoOnramp",
resources: [
.process("Resources/Localizations"),
.process("Resources/StripeCryptoOnramp.xcassets")
]
)
]
)
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public final class CryptoOnrampCoordinator: NSObject, CryptoOnrampCoordinatorPro

// MARK: - CryptoOnrampCoordinatorProtocol

public static func create(apiClient: STPAPIClient = .shared, appearance: LinkAppearance) async throws -> CryptoOnrampCoordinator {
public static func create(apiClient: STPAPIClient = .shared, appearance: LinkAppearance = .init()) async throws -> CryptoOnrampCoordinator {
let linkController = try await LinkController.create(
apiClient: apiClient,
mode: .payment,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// Created by Michael Liberatore on 7/17/25.
//

import Foundation
@_spi(STP) import StripeCore
@_spi(STP) import StripePaymentSheet

Expand Down
15 changes: 15 additions & 0 deletions Tests/installation_tests/size_test/size_report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,15 @@ def build_from_branch(branch, dir, target_name)
build(dir, target_name)
end

def product_exists_on_branch(branch, product_name)
Dir.chdir(@project_dir) do
# Use system() with output redirection to avoid script's backtick redefinition
system("git show #{branch}:Package.swift 2>/dev/null | grep -q 'name: \"#{product_name}\"'")
end
rescue
false
end

def check_size(modules, measure_branch, base_branch)
# Try to check out the branches - this will fail if there are unstaged changes,
# so this also helps prevent us from unintentionally messing up any uncommitted work:
Expand Down Expand Up @@ -247,6 +256,12 @@ def check_size(modules, measure_branch, base_branch)
max_incremental_uncompressed_size = m['size_report']['max_incremental_uncompressed_size']
end

# Skip if SPM product doesn't exist on current branch
if !product_exists_on_branch(measure_branch, sdk)
puts "#{sdk} is not available as SPM product, skipping".yellow
next
end

begin
# Setup project to include SDK
setup_project(measure_branch, @temp_dir, sdk)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
3BD9802A2741640900B09BCD /* ModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3BD980292741640900B09BCD /* ModelTests.swift */; };
3BD980892743194F00B09BCD /* StripeCardScan in Frameworks */ = {isa = PBXBuildFile; productRef = 3BD980882743194F00B09BCD /* StripeCardScan */; };
3C4D20A9273C644500BC6444 /* StripeFinancialConnections in Frameworks */ = {isa = PBXBuildFile; productRef = 3C4D20A8273C644500BC6444 /* StripeFinancialConnections */; };
49A111742E623BA5008229F5 /* StripeCryptoOnramp in Frameworks */ = {isa = PBXBuildFile; productRef = 49A111732E623BA5008229F5 /* StripeCryptoOnramp */; };
C176898E20616C7E003DE895 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C176898C20616C7E003DE895 /* Main.storyboard */; };
C176899020616C7E003DE895 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C176898F20616C7E003DE895 /* Assets.xcassets */; };
C176899320616C7E003DE895 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C176899120616C7E003DE895 /* LaunchScreen.storyboard */; };
Expand Down Expand Up @@ -83,6 +84,7 @@
E6A36A5A26BA4C34002A4427 /* StripeIdentity in Frameworks */,
31138ECF28DE66F5008AF554 /* StripePaymentSheet in Frameworks */,
3C4D20A9273C644500BC6444 /* StripeFinancialConnections in Frameworks */,
49A111742E623BA5008229F5 /* StripeCryptoOnramp in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -183,6 +185,7 @@
3137B6912743799C00CE7F5C /* StripeApplePay */,
31138ECE28DE66F5008AF554 /* StripePaymentSheet */,
E6C5F5F92CA0FAC100861709 /* StripeConnect */,
49A111732E623BA5008229F5 /* StripeCryptoOnramp */,
);
productName = CocoapodsTest;
productReference = C176898320616C7E003DE895 /* SPMTest.app */;
Expand Down Expand Up @@ -558,6 +561,10 @@
isa = XCSwiftPackageProductDependency;
productName = StripeFinancialConnections;
};
49A111732E623BA5008229F5 /* StripeCryptoOnramp */ = {
isa = XCSwiftPackageProductDependency;
productName = StripeCryptoOnramp;
};
E6A36A5926BA4C34002A4427 /* StripeIdentity */ = {
isa = XCSwiftPackageProductDependency;
productName = StripeIdentity;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import Stripe
import StripeApplePay
import StripeCardScan
@_spi(STP) import StripeCryptoOnramp
@_spi(PrivateBetaConnect) import StripeConnect
import StripeFinancialConnections
import StripeIdentity
Expand Down Expand Up @@ -50,6 +51,10 @@ class ViewController: UIViewController {
let _ = EmbeddedComponentManager {
nil
}

Task {
let _ = try? await CryptoOnrampCoordinator.create()
}
}
}
}
Loading