Skip to content

Commit

Permalink
3.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bric-stripe committed Jul 31, 2024
1 parent 17802b5 commit 0e0a849
Show file tree
Hide file tree
Showing 702 changed files with 404,373 additions and 83,166 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ If you are using CocoaPods, update your Podfile:
pod 'StripeTerminal', '~> 3.0'
```

# 3.8.0 2024-07-31
* Built with Xcode 15.2, Swift version 5.9.
* Fix an issue running on iOS 18 where the SDK fails [`collectPaymentMethod`](https://stripe.dev/stripe-terminal-ios/docs/Classes/SCPTerminal.html#/c:objc(cs)SCPTerminal(im)collectPaymentMethod:completion:) with [`SCPErrorUnexpectedSdkError`](https://stripe.dev/stripe-terminal-ios/docs/Enums/SCPError.html#/c:@E@SCPError@SCPErrorUnexpectedSdkError) when collecting amounts greater than 99999.
* Fix an issue where the SDK can report a reader as connected if it had disconnected while installing a required update.
* Fix a rare race condition where [`confirmPaymentIntent`](https://stripe.dev/stripe-terminal-ios/docs/Classes/SCPTerminal.html#/c:objc(cs)SCPTerminal(im)confirmPaymentIntent:completion:) could incorrectly fail with [`SCPErrorReaderBusy`](https://stripe.dev/stripe-terminal-ios/docs/Enums/SCPError.html#/c:@E@SCPError@SCPErrorReaderBusy).
* Fix `supportsReadersOfType` returning `true` for `SCPDeviceTypeAppleBuiltIn` on iOS versions below 16.7 (minimum supported version).

# 3.7.0 2024-06-24
* Built with Xcode 15.2, Swift version 5.9.
* Beta: Surcharging is now available in private beta.
Expand Down
64 changes: 32 additions & 32 deletions Example/Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
014382A900570CA2492DE0BE /* Pods_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 58A8D7FAB5787FF975934285 /* Pods_Example.framework */; };
022B5728250BB8CF00595E19 /* Value1MultilineCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 022B5727250BB8CF00595E19 /* Value1MultilineCell.swift */; };
022FB25B245868EF00F4C321 /* StripeTerminal.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 022FB25A245868EF00F4C321 /* StripeTerminal.xcframework */; };
02370F5D244C94D00056D896 /* CancelableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02370F5C244C94D00056D896 /* CancelableViewController.swift */; };
Expand All @@ -19,7 +20,6 @@
02A6BF5624CB1C4D0054ADFF /* StripeTerminal.xcframework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 022FB25A245868EF00F4C321 /* StripeTerminal.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
02DA8E3A24532E4900235921 /* DelegateAnnouncer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02DA8E3924532E4900235921 /* DelegateAnnouncer.swift */; };
199A008D245A2D7000E89BE9 /* TableViewController+StripeTerminal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 199A008C245A2D6F00E89BE9 /* TableViewController+StripeTerminal.swift */; };
1C2821705F93E5A983FCA2DB /* Pods_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 26F0F483ECB23109BEFEA852 /* Pods_Example.framework */; };
1F65BFFF2AF44F4000043452 /* CollectInputsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F65BFFE2AF44F4000043452 /* CollectInputsViewController.swift */; };
241B90F9249027DE0083C908 /* ReaderRegistrationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 241B90F8249027DE0083C908 /* ReaderRegistrationViewController.swift */; };
2446E3EF25AF499B00FB4510 /* SetupIntentViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2446E3EE25AF499B00FB4510 /* SetupIntentViewController.swift */; };
Expand Down Expand Up @@ -94,7 +94,6 @@
24FAAAFE2345067A00D47D40 /* ReaderConfiguration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReaderConfiguration.swift; sourceTree = "<group>"; };
259FDFDE2485AF0F0097686C /* EventDisplayingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EventDisplayingViewController.swift; sourceTree = "<group>"; };
25CB2CF624941F8D0018535C /* StartSetReaderDisplayViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StartSetReaderDisplayViewController.swift; sourceTree = "<group>"; };
26F0F483ECB23109BEFEA852 /* Pods_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
2E456576084719ED476A4DAB /* DataRequest+StripeJSON.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "DataRequest+StripeJSON.swift"; sourceTree = "<group>"; };
390B93742BED7B9100557850 /* StartCollectDataViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StartCollectDataViewController.swift; sourceTree = "<group>"; };
390B93762BED7BCC00557850 /* StartCollectInputsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StartCollectInputsViewController.swift; sourceTree = "<group>"; };
Expand All @@ -103,9 +102,10 @@
3959705F2A8D85830015F0F3 /* LocationStub.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LocationStub.swift; sourceTree = "<group>"; };
50225C3F2B4DACB300757FC6 /* StartReaderSettingsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StartReaderSettingsViewController.swift; sourceTree = "<group>"; };
50225C5D2B508DFB00757FC6 /* Error+StripeTerminal.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Error+StripeTerminal.swift"; sourceTree = "<group>"; };
5594B01D3C513896FBAE7B62 /* Pods-Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.debug.xcconfig"; path = "Target Support Files/Pods-Example/Pods-Example.debug.xcconfig"; sourceTree = "<group>"; };
62EEFAC8FB9D7D26D03FD005 /* Pods-Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.release.xcconfig"; path = "Target Support Files/Pods-Example/Pods-Example.release.xcconfig"; sourceTree = "<group>"; };
58A8D7FAB5787FF975934285 /* Pods_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
6231E26A35370B38EA3E2429 /* Pods-Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.debug.xcconfig"; path = "Target Support Files/Pods-Example/Pods-Example.debug.xcconfig"; sourceTree = "<group>"; };
6F8BE0912177B403009511E5 /* DiscoveryMethodViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DiscoveryMethodViewController.swift; sourceTree = "<group>"; };
764DEAE972712FF67469A865 /* Pods-Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.release.xcconfig"; path = "Target Support Files/Pods-Example/Pods-Example.release.xcconfig"; sourceTree = "<group>"; };
A63E8430260D073B006CB90C /* CreateLocationViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreateLocationViewController.swift; sourceTree = "<group>"; };
A63E8434260D0A0D006CB90C /* SelectLocationViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SelectLocationViewController.swift; sourceTree = "<group>"; };
A63E8456260D23C9006CB90C /* StripeCountries.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StripeCountries.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -139,18 +139,18 @@
buildActionMask = 2147483647;
files = (
022FB25B245868EF00F4C321 /* StripeTerminal.xcframework in Frameworks */,
1C2821705F93E5A983FCA2DB /* Pods_Example.framework in Frameworks */,
014382A900570CA2492DE0BE /* Pods_Example.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
415B1929A5E6D54B40E8C99B /* Pods */ = {
A13E74913A7B228348ABB1FA /* Pods */ = {
isa = PBXGroup;
children = (
5594B01D3C513896FBAE7B62 /* Pods-Example.debug.xcconfig */,
62EEFAC8FB9D7D26D03FD005 /* Pods-Example.release.xcconfig */,
6231E26A35370B38EA3E2429 /* Pods-Example.debug.xcconfig */,
764DEAE972712FF67469A865 /* Pods-Example.release.xcconfig */,
);
name = Pods;
path = Pods;
Expand All @@ -162,7 +162,7 @@
C16F409F2094F07B009CE87C /* Example */,
EE087B524FD387212EBE036B /* Frameworks */,
C16F409E2094F07B009CE87C /* Products */,
415B1929A5E6D54B40E8C99B /* Pods */,
A13E74913A7B228348ABB1FA /* Pods */,
);
sourceTree = "<group>";
};
Expand Down Expand Up @@ -236,7 +236,7 @@
isa = PBXGroup;
children = (
022FB25A245868EF00F4C321 /* StripeTerminal.xcframework */,
26F0F483ECB23109BEFEA852 /* Pods_Example.framework */,
58A8D7FAB5787FF975934285 /* Pods_Example.framework */,
);
name = Frameworks;
sourceTree = "<group>";
Expand All @@ -248,12 +248,12 @@
isa = PBXNativeTarget;
buildConfigurationList = C16F40AF2094F07C009CE87C /* Build configuration list for PBXNativeTarget "Example" */;
buildPhases = (
1E91FBCB8F1304BD0912714D /* [CP] Check Pods Manifest.lock */,
A9527A8A96FF6E6B22AC19FD /* [CP] Check Pods Manifest.lock */,
C16F40992094F07B009CE87C /* Sources */,
C16F409B2094F07B009CE87C /* Resources */,
0DE2ACED4D7F3843500B5F14 /* Frameworks */,
02A6BF5524CB1C3D0054ADFF /* CopyFiles */,
5AC384458D9812084A027BF0 /* [CP] Embed Pods Frameworks */,
4C15D464DEE2CE3DF83FB8D4 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
Expand Down Expand Up @@ -314,46 +314,46 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
1E91FBCB8F1304BD0912714D /* [CP] Check Pods Manifest.lock */ = {
4C15D464DEE2CE3DF83FB8D4 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework",
"${BUILT_PRODUCTS_DIR}/Static/Static.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Example-checkManifestLockResult.txt",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Static.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
5AC384458D9812084A027BF0 /* [CP] Embed Pods Frameworks */ = {
A9527A8A96FF6E6B22AC19FD /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework",
"${BUILT_PRODUCTS_DIR}/Static/Static.framework",
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Static.framework",
"$(DERIVED_FILE_DIR)/Pods-Example-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-frameworks.sh\"\n";
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
Expand Down Expand Up @@ -554,7 +554,7 @@
};
C16F40B02094F07C009CE87C /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 5594B01D3C513896FBAE7B62 /* Pods-Example.debug.xcconfig */;
baseConfigurationReference = 6231E26A35370B38EA3E2429 /* Pods-Example.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "Apple Development";
Expand Down Expand Up @@ -587,7 +587,7 @@
};
C16F40B12094F07C009CE87C /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 62EEFAC8FB9D7D26D03FD005 /* Pods-Example.release.xcconfig */;
baseConfigurationReference = 764DEAE972712FF67469A865 /* Pods-Example.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "Apple Development";
Expand Down
9 changes: 6 additions & 3 deletions Example/Example/CollectDataViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,28 +39,31 @@ class CollectDataViewController: EventDisplayingViewController {
if let error = error {
collectDataEvent.result = .errored
collectDataEvent.object = .error(error as NSError)
self?.events.append(collectDataEvent)
self?.complete()
} else if let data = collectedData {
collectDataEvent.result = .succeeded
collectDataEvent.object = .collectedData(data)
self?.events.append(collectDataEvent)

#if SCP_RETRIEVES_COLLECTED_DATA
if let id = data.stripeId {
var retrieveCollectedDataEvent = LogEvent(method: .collectData)
var retrieveCollectedDataEvent = LogEvent(method: .retrieveCollectedData)
self?.events.append(retrieveCollectedDataEvent)
AppDelegate.apiClient?.retrieveReaderCollectedData(id: id, completion: { json, error in
if let error = error {
retrieveCollectedDataEvent.result = .errored
retrieveCollectedDataEvent.object = .error(error as NSError)
} else if let json = json {
retrieveCollectedDataEvent.result = .succeeded
retrieveCollectedDataEvent.object = .json(json)
}
self?.events.append(retrieveCollectedDataEvent)
self?.complete()
})
}
#endif
}
self?.events.append(collectDataEvent)
self?.complete()
})
}
}
9 changes: 8 additions & 1 deletion Example/Example/LogEventViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ struct LogEvent: CustomStringConvertible, Event {
case cancelCollectInputs = "terminal.cancelCollectInputs"
case collectData = "terminal.collectData"
case cancelCollectData = "terminal.cancelCollectData"
case retrieveCollectedData = "terminal.retrieveCollectedData"
}

enum AssociatedObject {
Expand Down Expand Up @@ -268,9 +269,15 @@ struct LogEvent: CustomStringConvertible, Event {
case .errored: string = "Cancel CollectData Failed"
case .message(let message): string = message
}
case .retrieveCollectedData:
switch result {
case .started: string = "Retrieve Collected Data"
case .succeeded: string = "Retrieved Collected Data"
case .errored: string = "Retrieve Collected Data Failed"
case .message(let message): string = message
}
}


return string
}

Expand Down
5 changes: 3 additions & 2 deletions Example/Example/ReaderDiscoveryViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,9 @@ class ReaderDiscoveryViewController: TableViewController, CancelableViewControll
readers = []

// If local mobile, make sure the iOS device supports it.
if discoveryConfig.discoveryMethod == .localMobile {
let supported = Terminal.shared.supportsReaders(of: .appleBuiltIn, discoveryMethod: .localMobile, simulated: discoveryConfig.simulated)
if discoveryConfig.discoveryMethod == .localMobile || discoveryConfig.discoveryMethod == .usb {
let deviceType = discoveryConfig.discoveryMethod == .localMobile ? DeviceType.appleBuiltIn : DeviceType.stripeM2
let supported = Terminal.shared.supportsReaders(of: deviceType, discoveryMethod: discoveryConfig.discoveryMethod, simulated: discoveryConfig.simulated)
switch supported {
case .success:
break
Expand Down
2 changes: 1 addition & 1 deletion Example/Example/ReaderViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ class ReaderViewController: TableViewController, CancelingViewController {
break
}

if deviceType != .chipper2X && deviceType != .stripeM2 && deviceType != .appleBuiltIn {
if deviceType != .chipper2X && deviceType != .stripeM2 {
workflowRows.append(Row(text: "In-Person refund", detailText: "Refund a charge made by an Interac debit card.", selection: { [unowned self] in
self.showStartRefund()
}, accessory: .disclosureIndicator, cellClass: SubtitleCell.self))
Expand Down
10 changes: 5 additions & 5 deletions Example/StripeTerminal.xcframework/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,34 @@
<key>DebugSymbolsPath</key>
<string>dSYMs</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>StripeTerminal.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>StripeTerminal.framework/StripeTerminal</string>
<key>DebugSymbolsPath</key>
<string>dSYMs</string>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>StripeTerminal.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
The current version of this library.
*/
static NSString *const SCPSDKVersion = @"3.7.0";
static NSString *const SCPSDKVersion = @"3.8.0";

@class SCPCancelable,
SCPCreateConfiguration,
Expand Down
Binary file not shown.
Loading

0 comments on commit 0e0a849

Please sign in to comment.