diff --git a/Stripe.xcodeproj/project.pbxproj b/Stripe.xcodeproj/project.pbxproj index b34d41825da..4bf8b380031 100644 --- a/Stripe.xcodeproj/project.pbxproj +++ b/Stripe.xcodeproj/project.pbxproj @@ -475,6 +475,7 @@ 36F9A11F25F6A3D600591514 /* STPPaymentHandlerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36F9A11E25F6A3D600591514 /* STPPaymentHandlerTests.swift */; }; 36F9A12525F6F21C00591514 /* STPCardFormView+SwiftUI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36F9A12425F6F21C00591514 /* STPCardFormView+SwiftUI.swift */; }; 36FB69D725267E6200F129CE /* STPPaymentHandlerActionParams.swift in Sources */ = {isa = PBXBuildFile; fileRef = 317ABD4525117C9400CC59EF /* STPPaymentHandlerActionParams.swift */; }; + 3CD1D3A127C8682E001575BB /* ConnectionsSDKAvailability.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CD1D3A027C8682D001575BB /* ConnectionsSDKAvailability.swift */; }; 448895AF245255D800F7D0C2 /* STPPaymentMethodPrzelewy24ParamsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 448895AE245255D800F7D0C2 /* STPPaymentMethodPrzelewy24ParamsTests.m */; }; 44BDCFDF245A46CC007EE6D5 /* STPPaymentMethodBancontactParamsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 44BDCFDE245A46CC007EE6D5 /* STPPaymentMethodBancontactParamsTests.m */; }; 6151C237271F4FD600BB7032 /* STPPaymentMethodKlarna.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6151C236271F4FD600BB7032 /* STPPaymentMethodKlarna.swift */; }; @@ -1448,6 +1449,7 @@ 36F6120D254C88C0006656BD /* SheetNavigationBar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SheetNavigationBar.swift; path = Stripe/SheetNavigationBar.swift; sourceTree = SOURCE_ROOT; }; 36F9A11E25F6A3D600591514 /* STPPaymentHandlerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = STPPaymentHandlerTests.swift; sourceTree = ""; }; 36F9A12425F6F21C00591514 /* STPCardFormView+SwiftUI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "STPCardFormView+SwiftUI.swift"; sourceTree = ""; }; + 3CD1D3A027C8682D001575BB /* ConnectionsSDKAvailability.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConnectionsSDKAvailability.swift; sourceTree = ""; }; 448895AE245255D800F7D0C2 /* STPPaymentMethodPrzelewy24ParamsTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = STPPaymentMethodPrzelewy24ParamsTests.m; sourceTree = ""; }; 44BDCFDE245A46CC007EE6D5 /* STPPaymentMethodBancontactParamsTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = STPPaymentMethodBancontactParamsTests.m; sourceTree = ""; }; 4A0D74F918F6106100966D7B /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; @@ -2710,6 +2712,14 @@ name = Link; sourceTree = ""; }; + 3CD1D39927C83548001575BB /* SDKAvailability */ = { + isa = PBXGroup; + children = ( + 3CD1D3A027C8682D001575BB /* ConnectionsSDKAvailability.swift */, + ); + name = SDKAvailability; + sourceTree = ""; + }; 8BD2133A1F0458B7007F6FD1 /* Source */ = { isa = PBXGroup; children = ( @@ -3368,6 +3378,7 @@ F1DEB8941E2066FB0066B8E8 /* Source */ = { isa = PBXGroup; children = ( + 3CD1D39927C83548001575BB /* SDKAvailability */, 3144E124253E7D2200FE2605 /* API Bindings */, 3144E136253E826D00FE2605 /* Categories */, 3144E137253E828700FE2605 /* Helpers */, @@ -3503,7 +3514,7 @@ }; 04CDB4411A5F2E1800B854EE = { CreatedOnToolsVersion = 6.1.1; - LastSwiftMigration = 1250; + LastSwiftMigration = 1320; }; 363BD03E27344436003F9FE4 = { CreatedOnToolsVersion = 12.5; @@ -4197,6 +4208,7 @@ 31319EE125B11C8A00C89E30 /* PaymentSheet+SwiftUI.swift in Sources */, B6E40EAA254253E400A5BABD /* PanModalPresentationController.swift in Sources */, B672437925251CFA002E1AAF /* STPCard.swift in Sources */, + 3CD1D3A127C8682E001575BB /* ConnectionsSDKAvailability.swift in Sources */, B645199A2513EA3E006BF25E /* STPPaymentMethodCardParams.swift in Sources */, 3176C261251A8FDF00300ADE /* STPPushProvisioningDetailsParams.swift in Sources */, 36DFC222251BE3C2003AC264 /* STPConnectAccountAddress.swift in Sources */, diff --git a/Stripe/ConnectionsSDKAvailability.swift b/Stripe/ConnectionsSDKAvailability.swift new file mode 100644 index 00000000000..5a083d152d0 --- /dev/null +++ b/Stripe/ConnectionsSDKAvailability.swift @@ -0,0 +1,21 @@ +// +// ConnectionsSDKAvailability.swift +// StripeiOS +// +// Created by Vardges Avetisyan on 2/24/22. +// Copyright © 2022 Stripe, Inc. All rights reserved. +// + +import Foundation +@_spi(STP) import StripeCore + +@available(iOS 12, *) +struct ConnectionsSDKAvailability { + static func connections() -> ConnectionsSDKInterface? { + guard let klass = NSClassFromString("StripeConnections.ConnectionsSDKImplementation") as? ConnectionsSDKInterface.Type else { + return nil + } + + return klass.init() + } +} diff --git a/StripeConnections.podspec b/StripeConnections.podspec index 9513706488d..570532b8ee5 100644 --- a/StripeConnections.podspec +++ b/StripeConnections.podspec @@ -3,7 +3,7 @@ Pod::Spec.new do |s| # Do not update s.version directly. # Instead, update the VERSION file and run ./ci_scripts/update_version.sh - s.version = '21.11.1' + s.version = '21.12.0' s.summary = 'Securely connect financial accounts to Stripe\'s merchant account.' s.license = { :type => 'MIT', :file => 'LICENSE' } diff --git a/StripeConnections/StripeConnections.xcodeproj/project.pbxproj b/StripeConnections/StripeConnections.xcodeproj/project.pbxproj index 25b348abda8..0038c79b32b 100644 --- a/StripeConnections/StripeConnections.xcodeproj/project.pbxproj +++ b/StripeConnections/StripeConnections.xcodeproj/project.pbxproj @@ -13,6 +13,7 @@ 3C32286A279A009C00A3D4D4 /* LinkAccountSessionFetcherTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C322869279A009C00A3D4D4 /* LinkAccountSessionFetcherTests.swift */; }; 3C34E0E92798EB33002618E4 /* LinkAccountSession.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C34E0E82798EB33002618E4 /* LinkAccountSession.swift */; }; 3C34E0EB2799C3FF002618E4 /* LinkedAccountSessionFetcher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C34E0EA2799C3FF002618E4 /* LinkedAccountSessionFetcher.swift */; }; + 3C34F0C527D25F35003ADCBA /* SoftLinkTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C34F0C427D25F35003ADCBA /* SoftLinkTests.swift */; }; 3C37D6D4274C0DCA0041F1BE /* StripeUICore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3C37D6D3274C0DCA0041F1BE /* StripeUICore.framework */; }; 3C4D2010273AED0900BC6444 /* StripeConnections.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3C4D2006273AED0800BC6444 /* StripeConnections.framework */; }; 3C4D2015273AED0900BC6444 /* ConnectionsSheetTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C4D2014273AED0900BC6444 /* ConnectionsSheetTests.swift */; }; @@ -43,6 +44,7 @@ 3CC4218B274C402600BBEDF4 /* Image.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CC4218A274C402600BBEDF4 /* Image.swift */; }; 3CC42197274C457A00BBEDF4 /* close@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3CC42195274C457A00BBEDF4 /* close@3x.png */; }; 3CC42198274C457A00BBEDF4 /* back_arrow@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3CC42196274C457A00BBEDF4 /* back_arrow@3x.png */; }; + 3CD1D39827C82DC6001575BB /* ConnectionsSDKImplementation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CD1D39727C82DC6001575BB /* ConnectionsSDKImplementation.swift */; }; 3CE96D3427585BC6006B7059 /* ConnectionsAPIClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CE96D3327585BC6006B7059 /* ConnectionsAPIClient.swift */; }; 3CE96D3627585F01006B7059 /* LinkAccountSessionManifest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CE96D3527585F01006B7059 /* LinkAccountSessionManifest.swift */; }; 3CE96D3A27586387006B7059 /* LinkAccountSessionsGenerateHostedUrlBody.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CE96D3927586387006B7059 /* LinkAccountSessionsGenerateHostedUrlBody.swift */; }; @@ -67,6 +69,7 @@ 3C322869279A009C00A3D4D4 /* LinkAccountSessionFetcherTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LinkAccountSessionFetcherTests.swift; sourceTree = ""; }; 3C34E0E82798EB33002618E4 /* LinkAccountSession.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LinkAccountSession.swift; sourceTree = ""; }; 3C34E0EA2799C3FF002618E4 /* LinkedAccountSessionFetcher.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LinkedAccountSessionFetcher.swift; sourceTree = ""; }; + 3C34F0C427D25F35003ADCBA /* SoftLinkTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SoftLinkTests.swift; sourceTree = ""; }; 3C37D6D3274C0DCA0041F1BE /* StripeUICore.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = StripeUICore.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 3C4D2006273AED0800BC6444 /* StripeConnections.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = StripeConnections.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 3C4D2009273AED0800BC6444 /* StripeConnections.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = StripeConnections.h; sourceTree = ""; }; @@ -141,6 +144,7 @@ 3CC4218A274C402600BBEDF4 /* Image.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Image.swift; sourceTree = ""; }; 3CC42195274C457A00BBEDF4 /* close@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "close@3x.png"; sourceTree = ""; }; 3CC42196274C457A00BBEDF4 /* back_arrow@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "back_arrow@3x.png"; sourceTree = ""; }; + 3CD1D39727C82DC6001575BB /* ConnectionsSDKImplementation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConnectionsSDKImplementation.swift; sourceTree = ""; }; 3CE96D3327585BC6006B7059 /* ConnectionsAPIClient.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConnectionsAPIClient.swift; sourceTree = ""; }; 3CE96D3527585F01006B7059 /* LinkAccountSessionManifest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LinkAccountSessionManifest.swift; sourceTree = ""; }; 3CE96D3927586387006B7059 /* LinkAccountSessionsGenerateHostedUrlBody.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LinkAccountSessionsGenerateHostedUrlBody.swift; sourceTree = ""; }; @@ -203,6 +207,7 @@ 3C4D2013273AED0900BC6444 /* StripeConnectionsTests */ = { isa = PBXGroup; children = ( + 3C34F0C427D25F35003ADCBA /* SoftLinkTests.swift */, 3C4D2014273AED0900BC6444 /* ConnectionsSheetTests.swift */, 3C4D2016273AED0900BC6444 /* Info.plist */, 3C19E0F12762E65400F3C4ED /* ConnectionsAnalyticsTest.swift */, @@ -233,6 +238,7 @@ 3C4D2043273AF44D00BC6444 /* Source */ = { isa = PBXGroup; children = ( + 3CD1D39627C82D8B001575BB /* ConnectionsSDK */, 3C9F0BD7276293C100E1FDFA /* Analytics */, 3C82F4A9275A8162008A7162 /* Host */, 3C5430C627457C0300B1E488 /* API Bindings */, @@ -332,6 +338,14 @@ path = Images; sourceTree = ""; }; + 3CD1D39627C82D8B001575BB /* ConnectionsSDK */ = { + isa = PBXGroup; + children = ( + 3CD1D39727C82DC6001575BB /* ConnectionsSDKImplementation.swift */, + ); + path = ConnectionsSDK; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -498,6 +512,7 @@ 3C9F0BD9276293D300E1FDFA /* ConnectionsSheetAnalytics.swift in Sources */, 3C5430CF27457C8600B1E488 /* LinkedAccount.swift in Sources */, 3C5B2CD3273DB3B9005C5A05 /* STPLocalizedString.swift in Sources */, + 3CD1D39827C82DC6001575BB /* ConnectionsSDKImplementation.swift in Sources */, 3C34E0EB2799C3FF002618E4 /* LinkedAccountSessionFetcher.swift in Sources */, 3C4D207B273C626A00BC6444 /* ConnectionsSheet.swift in Sources */, 3C5B2CD0273DB32F005C5A05 /* StripeConnectionsBundleLocator.swift in Sources */, @@ -520,6 +535,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 3C34F0C527D25F35003ADCBA /* SoftLinkTests.swift in Sources */, 3C4D9E89277E3D9E007C741B /* LinkedAccountFetcherTests.swift in Sources */, 3C19E0F22762E65400F3C4ED /* ConnectionsAnalyticsTest.swift in Sources */, 3C32286A279A009C00A3D4D4 /* LinkAccountSessionFetcherTests.swift in Sources */, diff --git a/StripeConnections/StripeConnections/Source/ConnectionsSDK/ConnectionsSDKImplementation.swift b/StripeConnections/StripeConnections/Source/ConnectionsSDK/ConnectionsSDKImplementation.swift new file mode 100644 index 00000000000..18ffe99e3c4 --- /dev/null +++ b/StripeConnections/StripeConnections/Source/ConnectionsSDK/ConnectionsSDKImplementation.swift @@ -0,0 +1,37 @@ +// +// ConnectionsSDKImplementation.swift +// StripeConnections +// +// Created by Vardges Avetisyan on 2/24/22. +// + +import UIKit +@_spi(STP) import StripeCore + +/** + NOTE: If you change the name of this class, make sure to also change it ConnectionsSDKAvailability file + */ +@available(iOS 12, *) +@_spi(STP) public class ConnectionsSDKImplementation: ConnectionsSDKInterface { + + required public init() {} + + public func presentConnectionsSheet(clientSecret: String, + from presentingViewController: UIViewController, + completion: @escaping (ConnectionsSDKResult) -> ()) { + let connectionsSheet = ConnectionsSheet(linkAccountSessionClientSecret: clientSecret) + connectionsSheet.present( + from: presentingViewController, + completion: { result in + switch result { + case .completed(session: _): + completion(.completed) + case .canceled: + completion(.cancelled) + case .failed(let error): + completion(.failed(error: error)) + } + }) + } + +} diff --git a/StripeConnections/StripeConnectionsTests/SoftLinkTests.swift b/StripeConnections/StripeConnectionsTests/SoftLinkTests.swift new file mode 100644 index 00000000000..3a4a5653172 --- /dev/null +++ b/StripeConnections/StripeConnectionsTests/SoftLinkTests.swift @@ -0,0 +1,17 @@ +// +// SoftLinkTests.swift +// StripeConnectionsTests +// +// Created by Vardges Avetisyan on 3/4/22. +// + +import Foundation +@_spi(STP) import StripeCore +import XCTest + +class SoftLinkTest: XCTestCase { + func testLoadingImplementationClass() { + let klass = NSClassFromString("StripeConnections.ConnectionsSDKImplementation") as? ConnectionsSDKInterface.Type + XCTAssertNotNil(klass) + } +} diff --git a/StripeCore/StripeCore.xcodeproj/project.pbxproj b/StripeCore/StripeCore.xcodeproj/project.pbxproj index ed5977503da..ab7c097dbe3 100644 --- a/StripeCore/StripeCore.xcodeproj/project.pbxproj +++ b/StripeCore/StripeCore.xcodeproj/project.pbxproj @@ -25,6 +25,7 @@ 31E6D9642744451B00A89B6D /* NSCharacterSet+StripeCore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31E6D9632744451B00A89B6D /* NSCharacterSet+StripeCore.swift */; }; 31FDFF3226C5E37100E4B743 /* NSError+Stripe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31FDFF3126C5E37100E4B743 /* NSError+Stripe.swift */; }; 363B92662743211C00BA52EC /* Enums+CustomStringConvertible.swift in Sources */ = {isa = PBXBuildFile; fileRef = 363B92652743211C00BA52EC /* Enums+CustomStringConvertible.swift */; }; + 3CD1D3A927C87191001575BB /* ConnectionsSDKInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CD1D3A827C87191001575BB /* ConnectionsSDKInterface.swift */; }; 6142353626E12272004E4B37 /* AnalyticLoggableError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6142353526E12272004E4B37 /* AnalyticLoggableError.swift */; }; 619E233526E9419700E06F1C /* NSError_AnalyticLoggableErrorTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 619E233426E9419700E06F1C /* NSError_AnalyticLoggableErrorTest.swift */; }; 61DF180C2707822300E5ED13 /* PluginDetector.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61DF180B2707822300E5ED13 /* PluginDetector.swift */; }; @@ -148,6 +149,7 @@ 36F4BC9526C1BD8F001518CD /* tk */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = tk; path = tk.lproj/Localizable.strings; sourceTree = ""; }; 36F4BC9D26C1BDE8001518CD /* vi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = vi; path = vi.lproj/Localizable.strings; sourceTree = ""; }; 36F4BCA526C1BE8E001518CD /* id */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = id; path = id.lproj/Localizable.strings; sourceTree = ""; }; + 3CD1D3A827C87191001575BB /* ConnectionsSDKInterface.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConnectionsSDKInterface.swift; sourceTree = ""; }; 6142353526E12272004E4B37 /* AnalyticLoggableError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalyticLoggableError.swift; sourceTree = ""; }; 619E233426E9419700E06F1C /* NSError_AnalyticLoggableErrorTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NSError_AnalyticLoggableErrorTest.swift; sourceTree = ""; }; 61DF180B2707822300E5ED13 /* PluginDetector.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PluginDetector.swift; sourceTree = ""; }; @@ -272,6 +274,14 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 3CD1D39127C82C18001575BB /* Connections Bindings */ = { + isa = PBXGroup; + children = ( + 3CD1D3A827C87191001575BB /* ConnectionsSDKInterface.swift */, + ); + path = "Connections Bindings"; + sourceTree = ""; + }; E614AC95268BE14B00C59B3D /* API Bindings */ = { isa = PBXGroup; children = ( @@ -498,6 +508,7 @@ E6B0F53126866DDD00055EAF /* Source */ = { isa = PBXGroup; children = ( + 3CD1D39127C82C18001575BB /* Connections Bindings */, E6AF1ED5269FD83E0091BE99 /* UI */, E614AC97268BE14B00C59B3D /* Analytics */, E614AC95268BE14B00C59B3D /* API Bindings */, @@ -649,7 +660,7 @@ TargetAttributes = { E69D63FA26855B250090B43D = { CreatedOnToolsVersion = 12.5; - LastSwiftMigration = 1250; + LastSwiftMigration = 1320; }; E69D640326855B260090B43D = { CreatedOnToolsVersion = 12.5; @@ -792,6 +803,7 @@ 31A5269226C46D9600F8AB59 /* STPAppInfo.swift in Sources */, E614ACA0268BE14B00C59B3D /* StripeAPIConfiguration.swift in Sources */, 363B92662743211C00BA52EC /* Enums+CustomStringConvertible.swift in Sources */, + 3CD1D3A927C87191001575BB /* ConnectionsSDKInterface.swift in Sources */, E61ADACB270E6146004ED998 /* NSArray+Stripe.swift in Sources */, E65C44C0273B9DB500F753BC /* STPMultipartFormDataEncoder.swift in Sources */, 315BDBDF2788E2B4007BD11F /* STPDispatchFunctions.swift in Sources */, @@ -949,7 +961,9 @@ isa = XCBuildConfiguration; baseConfigurationReference = E69D641726855B9B0090B43D /* StripeiOS-Debug.xcconfig */; buildSettings = { + CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; + DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = StripeCore/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( @@ -968,7 +982,9 @@ isa = XCBuildConfiguration; baseConfigurationReference = E69D641F26855B9B0090B43D /* StripeiOS-Release.xcconfig */; buildSettings = { + CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; + DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = StripeCore/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( diff --git a/StripeCore/StripeCore/Source/Connections Bindings/ConnectionsSDKInterface.swift b/StripeCore/StripeCore/Source/Connections Bindings/ConnectionsSDKInterface.swift new file mode 100644 index 00000000000..1357eb06dc8 --- /dev/null +++ b/StripeCore/StripeCore/Source/Connections Bindings/ConnectionsSDKInterface.swift @@ -0,0 +1,21 @@ +// +// ConnectionsSDKInterface.swift +// StripeCore +// +// Created by Vardges Avetisyan on 2/24/22. +// + +import UIKit + +@_spi(STP) public enum ConnectionsSDKResult { + case completed + case cancelled + case failed(error: Error) +} + +@_spi(STP) public protocol ConnectionsSDKInterface { + init() + func presentConnectionsSheet(clientSecret: String, + from presentingViewController: UIViewController, + completion: @escaping (ConnectionsSDKResult) -> ()) +} diff --git a/StripeIdentity/StripeIdentity/Resources/Localizations/en.lproj/Localizable.strings b/StripeIdentity/StripeIdentity/Resources/Localizations/en.lproj/Localizable.strings index 2c1a9b290a3..380109c6827 100644 --- a/StripeIdentity/StripeIdentity/Resources/Localizations/en.lproj/Localizable.strings +++ b/StripeIdentity/StripeIdentity/Resources/Localizations/en.lproj/Localizable.strings @@ -160,9 +160,6 @@ /* Button to attempt to re-scan identity document image */ "Try Again" = "Try Again"; -/* Button to reload web view if we were unable to connect. */ -"Try again" = "Try again"; - /* Error message that displays when we're unable to connect to the server. */ "Unable to establish a connection." = "Unable to establish a connection.";