Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 2.5.0 #134

Merged
merged 1 commit into from
Jan 24, 2022
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ If you are using CocoaPods, update your Podfile:
pod 'StripeTerminal', '~> 2.0'
```

# 2.5.0 2022-01-24
* Adds a new error code, `SCPErrorBluetoothConnectionFailedBatteryLow`, that is passed into the `connectBluetoothReader` completion handler when connection failed due to the reader's battery being critically low.
* Fixes [Issue #124](https://github.com/stripe/stripe-terminal-ios/issues/124): Crash when Bluetooth reader reports low battery but BluetoothReaderDelegate was released.
* Fixes [Issue #121](https://github.com/stripe/stripe-terminal-ios/issues/121): `SCPReader` `isCharging` and `batteryLevel` weren't being updated if the `SCPBluetoothReaderDelegate` `didReportBatteryLevel:` wasn't implemented.

# 2.4.0 2021-11-15
* Add 4 new simulated test cards: `.onlinePinCvm`, `.onlinePinScaRetry`, ` .offlinePinCvm`, & `.offlinePinScaRetry` to [ `SCPSimulatedCardType`](https://stripe.dev/stripe-terminal-ios/docs/Enums/SCPSimulatedCardType.html)
* Fixes [Issue #119](https://github.com/stripe/stripe-terminal-ios/issues/119): Refund metadata not being set. The fix only applies to Bluetooth readers for now. Internet readers will still be missing the metadata.
Expand Down
34 changes: 17 additions & 17 deletions Example/Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
02370F5D244C94D00056D896 /* CancelableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02370F5C244C94D00056D896 /* CancelableViewController.swift */; };
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 */; };
126DD38E96AEC7EAF48DCC93 /* Pods_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 94549F757A3E218D03F19B9A /* Pods_Example.framework */; };
199A008D245A2D7000E89BE9 /* TableViewController+StripeTerminal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 199A008C245A2D6F00E89BE9 /* TableViewController+StripeTerminal.swift */; };
241B90F9249027DE0083C908 /* ReaderRegistrationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 241B90F8249027DE0083C908 /* ReaderRegistrationViewController.swift */; };
2446E3EF25AF499B00FB4510 /* SetupIntentViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2446E3EE25AF499B00FB4510 /* SetupIntentViewController.swift */; };
Expand All @@ -20,7 +21,6 @@
24FAAAFF2345067A00D47D40 /* ReaderConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24FAAAFE2345067A00D47D40 /* ReaderConfiguration.swift */; };
259FDFDF2485AF0F0097686C /* EventDisplayingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 259FDFDE2485AF0F0097686C /* EventDisplayingViewController.swift */; };
25CB2CF724941F8D0018535C /* StartSetReaderDisplayViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 25CB2CF624941F8D0018535C /* StartSetReaderDisplayViewController.swift */; };
422C549665023DD4188E7BAA /* Pods_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A6AB2AE0004B07EFD13A6F0C /* Pods_Example.framework */; };
6F8BE0922177B403009511E5 /* DiscoveryMethodViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F8BE0912177B403009511E5 /* DiscoveryMethodViewController.swift */; };
A63E8431260D073B006CB90C /* CreateLocationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A63E8430260D073B006CB90C /* CreateLocationViewController.swift */; };
A63E8435260D0A0D006CB90C /* SelectLocationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A63E8434260D0A0D006CB90C /* SelectLocationViewController.swift */; };
Expand Down Expand Up @@ -65,7 +65,6 @@
022FB25A245868EF00F4C321 /* StripeTerminal.xcframework */ = {isa = PBXFileReference; explicitFileType = wrapper.xcframework; path = StripeTerminal.xcframework; sourceTree = SOURCE_ROOT; };
02370F5C244C94D00056D896 /* CancelableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CancelableViewController.swift; sourceTree = "<group>"; };
02DA8E3924532E4900235921 /* DelegateAnnouncer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DelegateAnnouncer.swift; sourceTree = "<group>"; };
130D543A521A5125E6E05AD0 /* 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>"; };
199A008C245A2D6F00E89BE9 /* TableViewController+StripeTerminal.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "TableViewController+StripeTerminal.swift"; sourceTree = "<group>"; };
241B90F8249027DE0083C908 /* ReaderRegistrationViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReaderRegistrationViewController.swift; sourceTree = "<group>"; };
2446E3EE25AF499B00FB4510 /* SetupIntentViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SetupIntentViewController.swift; sourceTree = "<group>"; };
Expand All @@ -74,11 +73,12 @@
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>"; };
5B4AFE687BD4F8725A10F2C7 /* 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>"; };
6F8BE0912177B403009511E5 /* DiscoveryMethodViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DiscoveryMethodViewController.swift; sourceTree = "<group>"; };
94549F757A3E218D03F19B9A /* Pods_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
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>"; };
A6AB2AE0004B07EFD13A6F0C /* Pods_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
B3C24C6B23285BF6003271BD /* ifaddrs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ifaddrs.swift; sourceTree = "<group>"; };
B3C53B8B23286DA9003A707B /* Example-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Example-Bridging-Header.h"; sourceTree = "<group>"; };
C141842E214B3A3C00F4C0AA /* DeviceTypeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceTypeViewController.swift; sourceTree = "<group>"; };
Expand All @@ -102,7 +102,7 @@
C1DE30D121438E9800A3026F /* UIViewController+UIAlertController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIViewController+UIAlertController.swift"; sourceTree = "<group>"; };
C1DE30D221438E9800A3026F /* UIView+Layout.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIView+Layout.swift"; sourceTree = "<group>"; };
C1F78BDA2144F0830094BE37 /* CustomViews.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomViews.swift; sourceTree = "<group>"; };
E640DDEF2EFD51D6BFDB58E9 /* 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>"; };
C7CD02A197A89037078E5E8B /* 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>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -111,18 +111,18 @@
buildActionMask = 2147483647;
files = (
022FB25B245868EF00F4C321 /* StripeTerminal.xcframework in Frameworks */,
422C549665023DD4188E7BAA /* Pods_Example.framework in Frameworks */,
126DD38E96AEC7EAF48DCC93 /* Pods_Example.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
9DA44A63E5FC3C0DACF68AFE /* Pods */ = {
163424C9172E7C635637C587 /* Pods */ = {
isa = PBXGroup;
children = (
130D543A521A5125E6E05AD0 /* Pods-Example.debug.xcconfig */,
E640DDEF2EFD51D6BFDB58E9 /* Pods-Example.release.xcconfig */,
C7CD02A197A89037078E5E8B /* Pods-Example.debug.xcconfig */,
5B4AFE687BD4F8725A10F2C7 /* Pods-Example.release.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
Expand All @@ -133,7 +133,7 @@
C16F409F2094F07B009CE87C /* Example */,
EE087B524FD387212EBE036B /* Frameworks */,
C16F409E2094F07B009CE87C /* Products */,
9DA44A63E5FC3C0DACF68AFE /* Pods */,
163424C9172E7C635637C587 /* Pods */,
);
sourceTree = "<group>";
};
Expand Down Expand Up @@ -193,7 +193,7 @@
isa = PBXGroup;
children = (
022FB25A245868EF00F4C321 /* StripeTerminal.xcframework */,
A6AB2AE0004B07EFD13A6F0C /* Pods_Example.framework */,
94549F757A3E218D03F19B9A /* Pods_Example.framework */,
);
name = Frameworks;
sourceTree = "<group>";
Expand All @@ -205,12 +205,12 @@
isa = PBXNativeTarget;
buildConfigurationList = C16F40AF2094F07C009CE87C /* Build configuration list for PBXNativeTarget "Example" */;
buildPhases = (
BE6E4C58D1FCBA743B0156B5 /* [CP] Check Pods Manifest.lock */,
B321ADEBC31DECEB66A14B71 /* [CP] Check Pods Manifest.lock */,
C16F40992094F07B009CE87C /* Sources */,
C16F409B2094F07B009CE87C /* Resources */,
0DE2ACED4D7F3843500B5F14 /* Frameworks */,
02A6BF5524CB1C3D0054ADFF /* CopyFiles */,
A0771870F7E5F73181683FA0 /* [CP] Embed Pods Frameworks */,
ABA28035FB60002A567C7B24 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
Expand All @@ -228,7 +228,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0930;
LastUpgradeCheck = 1250;
LastUpgradeCheck = 1310;
ORGANIZATIONNAME = Stripe;
TargetAttributes = {
C16F409C2094F07B009CE87C = {
Expand Down Expand Up @@ -270,7 +270,7 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
A0771870F7E5F73181683FA0 /* [CP] Embed Pods Frameworks */ = {
ABA28035FB60002A567C7B24 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
Expand All @@ -290,7 +290,7 @@
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
BE6E4C58D1FCBA743B0156B5 /* [CP] Check Pods Manifest.lock */ = {
B321ADEBC31DECEB66A14B71 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
Expand Down Expand Up @@ -494,7 +494,7 @@
};
C16F40B02094F07C009CE87C /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 130D543A521A5125E6E05AD0 /* Pods-Example.debug.xcconfig */;
baseConfigurationReference = C7CD02A197A89037078E5E8B /* Pods-Example.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "Apple Development";
Expand All @@ -521,7 +521,7 @@
};
C16F40B12094F07C009CE87C /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = E640DDEF2EFD51D6BFDB58E9 /* Pods-Example.release.xcconfig */;
baseConfigurationReference = 5B4AFE687BD4F8725A10F2C7 /* Pods-Example.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "Apple Development";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1310"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
3 changes: 2 additions & 1 deletion Example/Example/APIClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ class APIClient: NSObject, ConnectionTokenProvider {
parameters: [
"amount": params.amount,
"currency": params.currency,
"description": params.statementDescriptor ?? "Example PaymentIntent"
"description": params.statementDescriptor ?? "Example PaymentIntent",
"payment_method_types": params.paymentMethodTypes
])
.validate(statusCode: 200..<300)
.responseJSON { responseJSON in
Expand Down
23 changes: 23 additions & 0 deletions Example/Example/Assets.xcassets/wisepose.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "wisepose-straight-1000px@1x.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "wisepose-straight-1000px@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "wisepose-straight-1000px@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions Example/Example/CustomViews.swift
Original file line number Diff line number Diff line change
Expand Up @@ -413,12 +413,12 @@ class TextFieldView: UIView {
return label
}()

init(text: String? = nil, header: String? = nil, footer: String? = nil) {
init(text: String? = nil, header: String? = nil, footer: String? = nil, placeholderText: String? = nil) {
super.init(frame: .zero)
buildTextView(header: header, footer: footer)
buildTextView(header: header, footer: footer, placeholderText: placeholderText)
}

private func buildTextView(header: String?, footer: String?) {
private func buildTextView(header: String?, footer: String?, placeholderText: String?) {
backgroundColor = UIColor.white
addSubview(textField)
footerLabel.text = footer
Expand All @@ -442,6 +442,8 @@ class TextFieldView: UIView {
} else {
stack.anchorToSuperviewAnchors(withInsets: insets)
}

textField.placeholder = placeholderText
}

required init?(coder aDecoder: NSCoder) {
Expand Down
17 changes: 17 additions & 0 deletions Example/Example/ReaderDiscoveryViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -386,10 +386,27 @@ class ReaderDiscoveryViewController: TableViewController, CancelableViewControll
cellClass = DisabledSubtitleCell.self
}

var image: UIImage?
switch reader.deviceType {
case .stripeM2:
image = UIImage(named: "stripe_m2")
case .chipper1X, .chipper2X, .wiseCube:
image = UIImage(named: "chipper")
case .verifoneP400:
image = UIImage(named: "verifone")
case .wisePad3:
image = UIImage(named: "wisepad")
case .wisePosE:
image = UIImage(named: "wisepose")
@unknown default:
image = nil
}

// prefer reader's label, fall back to serial number
return Row(text: reader.label ?? reader.serialNumber,
detailText: details.joined(separator: " • "),
selection: selection,
image: image,
cellClass: cellClass
)
}
Expand Down
2 changes: 1 addition & 1 deletion Example/Example/ReaderHeaderView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class ReaderHeaderView: UIView {
case .wisePad3:
imageView.image = UIImage(named: "wisepad")
case .wisePosE:
imageView.image = UIImage(named: "verifone")
imageView.image = UIImage(named: "wisepose")
@unknown default:
imageView.image = nil
}
Expand Down
Loading