Skip to content

Commit

Permalink
Prepare StripeConnect for publish
Browse files Browse the repository at this point in the history
  • Loading branch information
mludowise-stripe committed Sep 26, 2024
1 parent 4a1f586 commit 7ee34cb
Show file tree
Hide file tree
Showing 16 changed files with 150 additions and 68 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>StripeConnect Example.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>28</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>E63DA09D2BDE4B67005BF2A0</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
9 changes: 9 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ let package = Package(
.library(
name: "StripeFinancialConnections",
targets: ["StripeFinancialConnections"]
),
.library(
name: "StripeConnect",
targets: ["StripeConnect"]
)
],
targets: [
Expand Down Expand Up @@ -152,6 +156,11 @@ let package = Package(
.process("Resources/Images"),
.process("PrivacyInfo.xcprivacy")
]
),
.target(
name: "StripeConnect",
dependencies: ["StripeCore", "StripeUICore"],
path: "StripeConnect/StripeConnect"
)
]
)
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,34 @@
ReferencedContainer = "container:Stripe3DS2/Stripe3DS2.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "41D17A3F2C5A73A6007C6EE6"
BuildableName = "StripeConnect.framework"
BlueprintName = "StripeConnect"
ReferencedContainer = "container:StripeConnect/StripeConnect.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "NO"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "41D17A492C5A73A7007C6EE6"
BuildableName = "StripeConnectTests.xctest"
BlueprintName = "StripeConnectTests"
ReferencedContainer = "container:StripeConnect/StripeConnect.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
Expand Down
21 changes: 21 additions & 0 deletions StripeConnect.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Pod::Spec.new do |s|
s.name = 'StripeConnect'

# Do not update s.version directly.
# Instead, update the VERSION file and run ./ci_scripts/update_version.sh
s.version = '23.30.0'

s.summary = 'Use Connect embedded components to add connected account dashboard functionality to your app.'
s.license = { type: 'MIT', file: 'LICENSE' }
s.homepage = 'https://docs.stripe.com/connect/get-started-connect-embedded-components'
s.authors = { 'Stripe' => 'support+github@stripe.com' }
s.source = { git: 'https://github.com/stripe/stripe-ios.git', tag: "#{s.version}" }
s.frameworks = 'Foundation', 'WebKit', 'UIKit'
s.requires_arc = true
s.platform = :ios
s.swift_version = '5.0'
s.ios.deployment_target = '13.0'
s.source_files = 'StripeConnect/StripeConnect/**/*.swift'
s.dependency 'StripeCore', s.version.to_s
s.dependency 'StripeUICore', s.version.to_s
end
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import UIKit
Show details of a given payment and allow users to manage disputes and perform refunds.
*/
@_spi(DashboardOnly)
@available(iOS 15, *)
public class AccountManagementViewController: UIViewController {
let webView: ConnectComponentWebView

Expand Down Expand Up @@ -46,6 +47,7 @@ public class AccountManagementViewController: UIViewController {
}

@_spi(DashboardOnly)
@available(iOS 15, *)
public protocol AccountManagementViewControllerDelegate: AnyObject {
/**
Triggered when an error occurs loading the payment details component
Expand All @@ -54,9 +56,10 @@ public protocol AccountManagementViewControllerDelegate: AnyObject {
- error: The error that occurred when loading the component
*/
func accountManagementLoadDidFail(_ accountManagement: AccountManagementViewController,
withError error: Error)
withError error: Error)
}

@available(iOS 15, *)
public extension AccountManagementViewControllerDelegate {
// Default implementation to make optional
func accountManagementLoadDidFail(_ accountManagement: AccountManagementViewController,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import UIKit

@_spi(DashboardOnly)
@available(iOS 15, *)
extension EmbeddedComponentManager {
public enum OverlayStyle: Encodable {
case modal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

//struct StringCodingKey: CodingKey {
// struct StringCodingKey: CodingKey {
// var stringValue: String
// var intValue: Int?
//
Expand All @@ -22,4 +22,4 @@ import Foundation
// init?(intValue: Int) {
// return nil
// }
//}
// }
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ class ConnectComponentWebView: ConnectWebView {
isOpaque = appearance.colors.background == nil
sendMessage(UpdateConnectInstanceSender.init(payload: .init(
locale: webLocale.webIdentifier,
appearance: .init(appearance: appearance,
traitCollection: traitCollection,
appearance: .init(appearance: appearance,
traitCollection: traitCollection,
overlay: overlayStyle)
)))
}
Expand Down Expand Up @@ -173,7 +173,7 @@ private extension ConnectComponentWebView {
locale: webLocale.webIdentifier,
appearance: .init(
appearance: componentManager.appearance,
traitCollection: traitCollection,
traitCollection: traitCollection,
overlay: overlayStyle
)
)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,18 @@
04E6FCEE1B714AC2000C8759 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 04E6FCED1B714AC2000C8759 /* Images.xcassets */; };
04E6FCF11B714AC2000C8759 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 04E6FCEF1B714AC2000C8759 /* LaunchScreen.xib */; };
31138E6F28DBD87B008AF554 /* StripePaymentSheet.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 31138E6E28DBD87B008AF554 /* StripePaymentSheet.xcframework */; };
31138E7028DBD87B008AF554 /* StripePaymentSheet.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 31138E6E28DBD87B008AF554 /* StripePaymentSheet.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
31138E7228DBD87D008AF554 /* StripePaymentsUI.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 31138E7128DBD87D008AF554 /* StripePaymentsUI.xcframework */; };
31138E7328DBD87E008AF554 /* StripePaymentsUI.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 31138E7128DBD87D008AF554 /* StripePaymentsUI.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
31138E7528DBD881008AF554 /* StripePayments.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 31138E7428DBD881008AF554 /* StripePayments.xcframework */; };
31138E7628DBD881008AF554 /* StripePayments.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 31138E7428DBD881008AF554 /* StripePayments.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
3137B69427437E3500CE7F5C /* StripeApplePay.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3137B69327437E3500CE7F5C /* StripeApplePay.xcframework */; };
31CA744B25CCC669007FE8BF /* Stripe3DS2.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 31CA744A25CCC669007FE8BF /* Stripe3DS2.xcframework */; };
31FF1DB1255FA383000EF4B0 /* Stripe.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 04E6FD061B714DDF000C8759 /* Stripe.xcframework */; };
31FF1DB2255FA383000EF4B0 /* Stripe.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 04E6FD061B714DDF000C8759 /* Stripe.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
3B3F01C227445CDE00C53D34 /* StripeUICoreAssetTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B3F01C127445CDE00C53D34 /* StripeUICoreAssetTests.swift */; };
3BD980302741675500B09BCD /* ModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3BD9802F2741675500B09BCD /* ModelTests.swift */; };
3BD9808F27431DFE00B09BCD /* StripeCardScan.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3BD9808E27431DFE00B09BCD /* StripeCardScan.xcframework */; };
3C4D20AD273C673200BC6444 /* StripeFinancialConnections.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3C4D20AC273C673200BC6444 /* StripeFinancialConnections.xcframework */; };
E6AA24ED2744ABE000FD205E /* StripeCameraCore.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = E63B6743274344E400CFEDBA /* StripeCameraCore.xcframework */; };
E6AA24EE2744ABE000FD205E /* StripeCameraCore.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = E63B6743274344E400CFEDBA /* StripeCameraCore.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
E6AFFAF526E972950067462F /* StripeUICore.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = E6AFFAF426E972950067462F /* StripeUICore.xcframework */; };
E6C5F5FE2CA109F100861709 /* StripeConnect.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = E6C5F5FD2CA109F100861709 /* StripeConnect.xcframework */; };
E6F05EAA2687C76F00614D61 /* StripeCore.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = E6F05EA92687C76F00614D61 /* StripeCore.xcframework */; };
/* End PBXBuildFile section */

Expand All @@ -42,24 +38,6 @@
};
/* End PBXContainerItemProxy section */

/* Begin PBXCopyFilesBuildPhase section */
31FF1DB3255FA383000EF4B0 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
31138E7028DBD87B008AF554 /* StripePaymentSheet.xcframework in Embed Frameworks */,
31138E7328DBD87E008AF554 /* StripePaymentsUI.xcframework in Embed Frameworks */,
E6AA24EE2744ABE000FD205E /* StripeCameraCore.xcframework in Embed Frameworks */,
31FF1DB2255FA383000EF4B0 /* Stripe.xcframework in Embed Frameworks */,
31138E7628DBD881008AF554 /* StripePayments.xcframework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
04E6FCE11B714AC2000C8759 /* CarthageTest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CarthageTest.app; sourceTree = BUILT_PRODUCTS_DIR; };
04E6FCE51B714AC2000C8759 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
Expand All @@ -83,6 +61,7 @@
E63B6743274344E400CFEDBA /* StripeCameraCore.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = StripeCameraCore.xcframework; path = Carthage/Build/StripeCameraCore.xcframework; sourceTree = "<group>"; };
E6A36A5B26BA4E0E002A4427 /* StripeIdentity.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = StripeIdentity.xcframework; path = Carthage/Build/StripeIdentity.xcframework; sourceTree = "<group>"; };
E6AFFAF426E972950067462F /* StripeUICore.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = StripeUICore.xcframework; path = Carthage/Build/StripeUICore.xcframework; sourceTree = "<group>"; };
E6C5F5FD2CA109F100861709 /* StripeConnect.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = StripeConnect.xcframework; path = Carthage/Build/StripeConnect.xcframework; sourceTree = "<group>"; };
E6F05EA92687C76F00614D61 /* StripeCore.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = StripeCore.xcframework; path = Carthage/Build/StripeCore.xcframework; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand All @@ -99,6 +78,7 @@
3C4D20AD273C673200BC6444 /* StripeFinancialConnections.xcframework in Frameworks */,
31138E7228DBD87D008AF554 /* StripePaymentsUI.xcframework in Frameworks */,
3137B69427437E3500CE7F5C /* StripeApplePay.xcframework in Frameworks */,
E6C5F5FE2CA109F100861709 /* StripeConnect.xcframework in Frameworks */,
E6AA24ED2744ABE000FD205E /* StripeCameraCore.xcframework in Frameworks */,
31CA744B25CCC669007FE8BF /* Stripe3DS2.xcframework in Frameworks */,
E6AFFAF526E972950067462F /* StripeUICore.xcframework in Frameworks */,
Expand Down Expand Up @@ -177,6 +157,7 @@
31CA744925CCC669007FE8BF /* Frameworks */ = {
isa = PBXGroup;
children = (
E6C5F5FD2CA109F100861709 /* StripeConnect.xcframework */,
31138E7428DBD881008AF554 /* StripePayments.xcframework */,
31138E7128DBD87D008AF554 /* StripePaymentsUI.xcframework */,
31138E6E28DBD87B008AF554 /* StripePaymentSheet.xcframework */,
Expand All @@ -202,7 +183,6 @@
04E6FCDD1B714AC2000C8759 /* Sources */,
04E6FCDE1B714AC2000C8759 /* Frameworks */,
04E6FCDF1B714AC2000C8759 /* Resources */,
31FF1DB3255FA383000EF4B0 /* Embed Frameworks */,
);
buildRules = (
);
Expand Down Expand Up @@ -435,6 +415,7 @@
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Carthage/Build/iOS",
"$(PROJECT_DIR)/Carthage/Build",
);
INFOPLIST_FILE = CarthageTest/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
Expand All @@ -454,6 +435,7 @@
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Carthage/Build/iOS",
"$(PROJECT_DIR)/Carthage/Build",
);
INFOPLIST_FILE = CarthageTest/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
Expand Down
32 changes: 14 additions & 18 deletions Tests/installation_tests/carthage/CarthageTest/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import Stripe
import StripeApplePay
import StripeCardScan
@_spi(PrivateBetaConnect) import StripeConnect
import StripeFinancialConnections
import UIKit

Expand All @@ -19,25 +20,20 @@ class ViewController: UIViewController {
StripeAPI.defaultPublishableKey = "test"
StripeAPI.paymentRequest(withMerchantIdentifier: "test", country: "US", currency: "USD")

if #available(iOS 12.0, *) {
let _ = FinancialConnectionsSheet(
financialConnectionsSessionClientSecret: "",
returnURL: nil
)
}
let _ = FinancialConnectionsSheet(
financialConnectionsSessionClientSecret: "",
returnURL: nil
)

if #available(iOS 11.2, *) {
let _ = CardImageVerificationSheet(
cardImageVerificationIntentId: "foo",
cardImageVerificationIntentSecret: "foo"
)
}
// Do any additional setup after loading the view, typically from a nib.
}
let _ = CardImageVerificationSheet(
cardImageVerificationIntentId: "foo",
cardImageVerificationIntentSecret: "foo"
)

override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
if #available(iOS 15.0, *) {
let _ = EmbeddedComponentManager {
return nil
}
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@
"${BUILT_PRODUCTS_DIR}/StripeApplePay/StripeApplePay.framework",
"${BUILT_PRODUCTS_DIR}/StripeCameraCore/StripeCameraCore.framework",
"${BUILT_PRODUCTS_DIR}/StripeCardScan/StripeCardScan.framework",
"${BUILT_PRODUCTS_DIR}/StripeConnect/StripeConnect.framework",
"${BUILT_PRODUCTS_DIR}/StripeCore/StripeCore.framework",
"${BUILT_PRODUCTS_DIR}/StripeFinancialConnections/StripeFinancialConnections.framework",
"${BUILT_PRODUCTS_DIR}/StripeIdentity/StripeIdentity.framework",
Expand All @@ -386,6 +387,7 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/StripeApplePay.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/StripeCameraCore.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/StripeCardScan.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/StripeConnect.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/StripeCore.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/StripeFinancialConnections.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/StripeIdentity.framework",
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(PrivateBetaConnect) import StripeConnect
import StripeFinancialConnections
import StripeIdentity
import StripePaymentSheet
Expand All @@ -24,30 +25,25 @@ class ViewController: UIViewController {
let _ = IdentityVerificationSheet(verificationSessionClientSecret: "test")
}

if #available(iOS 12.0, *) {
let _ = FinancialConnectionsSheet(
financialConnectionsSessionClientSecret: "",
returnURL: nil
)
}
let _ = FinancialConnectionsSheet(
financialConnectionsSessionClientSecret: "",
returnURL: nil
)

if #available(iOS 11.2, *) {
let _ = CardImageVerificationSheet(
cardImageVerificationIntentId: "foo",
cardImageVerificationIntentSecret: "foo"
)
}
let _ = CardImageVerificationSheet(
cardImageVerificationIntentId: "foo",
cardImageVerificationIntentSecret: "foo"
)

let _ = PaymentSheet(
paymentIntentClientSecret: "",
configuration: PaymentSheet.Configuration()
)
// Do any additional setup after loading the view, typically from a nib.
}

override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
if #available(iOS 15.0, *) {
let _ = EmbeddedComponentManager {
nil
}
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ target 'CocoapodsTest' do
pod 'StripeCardScan', path: '../../../..'
pod 'StripeApplePay', path: '../../../..'
pod 'StripeCameraCore', path: '../../../..'
pod 'StripeConnect', path: '../../../..'
pod 'StripeCore', path: '../../../..'
pod 'StripeUICore', path: '../../../..'
pod 'StripePayments', path: '../../../..'
Expand Down
Loading

0 comments on commit 7ee34cb

Please sign in to comment.