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.31.1 #1013

Closed
wants to merge 8 commits into from
Closed
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
2 changes: 1 addition & 1 deletion .cz.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.commitizen]
version_scheme = "semver"
version = "2.31.0"
version = "2.31.1"
version_files = [
"Sources/PrimerSDK/Classes/version.swift:let PrimerSDKVersion",
"PrimerSDK.podspec:s.version"
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## 2.31.1 (2024-10-04)

### Fix

- Apple Pay incorrect timeout reporting (#1010)
- Add additional rails to guard against crashes (#1009)
- Fallback to Web flow when Vipps app is not installed (#1008)
- Fix error reporting for apple pay display failure (#997)

## 2.31.0 (2024-08-29)

### Feat
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
//Below are gated by applePayCaptureShippingDetails, default to on when above is true
var applePayCaptureShippingAddress = true
var applePayRequireShippingMethod = true
var applePayAdditionalContactFields: [PrimerApplePayOptions.ShippingOptions.AdditionalShippingContactField]? = [.name, .emailAddress, .phoneNumber]
// var applePayAdditionalContactFields: [PrimerApplePayOptions.ShippingOptions.AdditionalShippingContactField]? = [.name, .emailAddress, .phoneNumber]

func setAccessibilityIds() {
self.view.accessibilityIdentifier = "Background View"
Expand Down Expand Up @@ -429,40 +429,40 @@
}

@IBAction func applePayShippingContactNameSwitchChanged(_ sender: UISwitch) {
if sender.isOn {
var fields = applePayAdditionalContactFields ?? []
if !fields.contains(.name) {
fields.append(.name)
}
applePayAdditionalContactFields = fields
} else {
applePayAdditionalContactFields?.removeAll(where: { $0 == .name })
if applePayAdditionalContactFields?.isEmpty == true {
applePayAdditionalContactFields = nil
}
}
// if sender.isOn {
// var fields = applePayAdditionalContactFields ?? []
// if !fields.contains(.name) {
// fields.append(.name)
// }
// applePayAdditionalContactFields = fields
// } else {
// applePayAdditionalContactFields?.removeAll(where: { $0 == .name })
// if applePayAdditionalContactFields?.isEmpty == true {
// applePayAdditionalContactFields = nil
// }
// }
}


@IBAction func applePayShippingContactEmailField(_ sender: UISwitch) {
if sender.isOn {
var fields = applePayAdditionalContactFields ?? []

Check failure on line 449 in Debug App/Sources/View Controllers/MerchantSessionAndSettingsViewController.swift

View workflow job for this annotation

GitHub Actions / Distribute app to Firebase and Browserstack

cannot find 'applePayAdditionalContactFields' in scope

Check failure on line 449 in Debug App/Sources/View Controllers/MerchantSessionAndSettingsViewController.swift

View workflow job for this annotation

GitHub Actions / Unit Tests - Debug App

cannot find 'applePayAdditionalContactFields' in scope

Check failure on line 449 in Debug App/Sources/View Controllers/MerchantSessionAndSettingsViewController.swift

View workflow job for this annotation

GitHub Actions / Build and upload app to Appetize

cannot find 'applePayAdditionalContactFields' in scope
if !fields.contains(.emailAddress) {

Check failure on line 450 in Debug App/Sources/View Controllers/MerchantSessionAndSettingsViewController.swift

View workflow job for this annotation

GitHub Actions / Distribute app to Firebase and Browserstack

cannot infer contextual base in reference to member 'emailAddress'

Check failure on line 450 in Debug App/Sources/View Controllers/MerchantSessionAndSettingsViewController.swift

View workflow job for this annotation

GitHub Actions / Unit Tests - Debug App

cannot infer contextual base in reference to member 'emailAddress'

Check failure on line 450 in Debug App/Sources/View Controllers/MerchantSessionAndSettingsViewController.swift

View workflow job for this annotation

GitHub Actions / Build and upload app to Appetize

cannot infer contextual base in reference to member 'emailAddress'
fields.append(.emailAddress)

Check failure on line 451 in Debug App/Sources/View Controllers/MerchantSessionAndSettingsViewController.swift

View workflow job for this annotation

GitHub Actions / Distribute app to Firebase and Browserstack

cannot infer contextual base in reference to member 'emailAddress'

Check failure on line 451 in Debug App/Sources/View Controllers/MerchantSessionAndSettingsViewController.swift

View workflow job for this annotation

GitHub Actions / Unit Tests - Debug App

cannot infer contextual base in reference to member 'emailAddress'

Check failure on line 451 in Debug App/Sources/View Controllers/MerchantSessionAndSettingsViewController.swift

View workflow job for this annotation

GitHub Actions / Build and upload app to Appetize

cannot infer contextual base in reference to member 'emailAddress'
}
applePayAdditionalContactFields = fields

Check failure on line 453 in Debug App/Sources/View Controllers/MerchantSessionAndSettingsViewController.swift

View workflow job for this annotation

GitHub Actions / Distribute app to Firebase and Browserstack

cannot find 'applePayAdditionalContactFields' in scope

Check failure on line 453 in Debug App/Sources/View Controllers/MerchantSessionAndSettingsViewController.swift

View workflow job for this annotation

GitHub Actions / Unit Tests - Debug App

cannot find 'applePayAdditionalContactFields' in scope

Check failure on line 453 in Debug App/Sources/View Controllers/MerchantSessionAndSettingsViewController.swift

View workflow job for this annotation

GitHub Actions / Build and upload app to Appetize

cannot find 'applePayAdditionalContactFields' in scope
} else {
applePayAdditionalContactFields?.removeAll(where: { $0 == .emailAddress })

Check failure on line 455 in Debug App/Sources/View Controllers/MerchantSessionAndSettingsViewController.swift

View workflow job for this annotation

GitHub Actions / Distribute app to Firebase and Browserstack

cannot find 'applePayAdditionalContactFields' in scope

Check failure on line 455 in Debug App/Sources/View Controllers/MerchantSessionAndSettingsViewController.swift

View workflow job for this annotation

GitHub Actions / Distribute app to Firebase and Browserstack

cannot infer contextual base in reference to member 'emailAddress'

Check failure on line 455 in Debug App/Sources/View Controllers/MerchantSessionAndSettingsViewController.swift

View workflow job for this annotation

GitHub Actions / Unit Tests - Debug App

cannot find 'applePayAdditionalContactFields' in scope

Check failure on line 455 in Debug App/Sources/View Controllers/MerchantSessionAndSettingsViewController.swift

View workflow job for this annotation

GitHub Actions / Unit Tests - Debug App

cannot infer contextual base in reference to member 'emailAddress'

Check failure on line 455 in Debug App/Sources/View Controllers/MerchantSessionAndSettingsViewController.swift

View workflow job for this annotation

GitHub Actions / Build and upload app to Appetize

cannot find 'applePayAdditionalContactFields' in scope

Check failure on line 455 in Debug App/Sources/View Controllers/MerchantSessionAndSettingsViewController.swift

View workflow job for this annotation

GitHub Actions / Build and upload app to Appetize

cannot infer contextual base in reference to member 'emailAddress'
if applePayAdditionalContactFields?.isEmpty == true {

Check failure on line 456 in Debug App/Sources/View Controllers/MerchantSessionAndSettingsViewController.swift

View workflow job for this annotation

GitHub Actions / Distribute app to Firebase and Browserstack

cannot find 'applePayAdditionalContactFields' in scope

Check failure on line 456 in Debug App/Sources/View Controllers/MerchantSessionAndSettingsViewController.swift

View workflow job for this annotation

GitHub Actions / Unit Tests - Debug App

cannot find 'applePayAdditionalContactFields' in scope

Check failure on line 456 in Debug App/Sources/View Controllers/MerchantSessionAndSettingsViewController.swift

View workflow job for this annotation

GitHub Actions / Build and upload app to Appetize

cannot find 'applePayAdditionalContactFields' in scope
applePayAdditionalContactFields = nil

Check failure on line 457 in Debug App/Sources/View Controllers/MerchantSessionAndSettingsViewController.swift

View workflow job for this annotation

GitHub Actions / Distribute app to Firebase and Browserstack

cannot find 'applePayAdditionalContactFields' in scope

Check failure on line 457 in Debug App/Sources/View Controllers/MerchantSessionAndSettingsViewController.swift

View workflow job for this annotation

GitHub Actions / Unit Tests - Debug App

cannot find 'applePayAdditionalContactFields' in scope

Check failure on line 457 in Debug App/Sources/View Controllers/MerchantSessionAndSettingsViewController.swift

View workflow job for this annotation

GitHub Actions / Build and upload app to Appetize

cannot find 'applePayAdditionalContactFields' in scope
}
}
}

@IBAction func applePayShippingContactPhoneSwitchChanged(_ sender: UISwitch) {
if sender.isOn {
var fields = applePayAdditionalContactFields ?? []

Check failure on line 464 in Debug App/Sources/View Controllers/MerchantSessionAndSettingsViewController.swift

View workflow job for this annotation

GitHub Actions / Distribute app to Firebase and Browserstack

cannot find 'applePayAdditionalContactFields' in scope

Check failure on line 464 in Debug App/Sources/View Controllers/MerchantSessionAndSettingsViewController.swift

View workflow job for this annotation

GitHub Actions / Unit Tests - Debug App

cannot find 'applePayAdditionalContactFields' in scope

Check failure on line 464 in Debug App/Sources/View Controllers/MerchantSessionAndSettingsViewController.swift

View workflow job for this annotation

GitHub Actions / Build and upload app to Appetize

cannot find 'applePayAdditionalContactFields' in scope
if !fields.contains(.phoneNumber) {

Check failure on line 465 in Debug App/Sources/View Controllers/MerchantSessionAndSettingsViewController.swift

View workflow job for this annotation

GitHub Actions / Distribute app to Firebase and Browserstack

cannot infer contextual base in reference to member 'phoneNumber'

Check failure on line 465 in Debug App/Sources/View Controllers/MerchantSessionAndSettingsViewController.swift

View workflow job for this annotation

GitHub Actions / Unit Tests - Debug App

cannot infer contextual base in reference to member 'phoneNumber'

Check failure on line 465 in Debug App/Sources/View Controllers/MerchantSessionAndSettingsViewController.swift

View workflow job for this annotation

GitHub Actions / Build and upload app to Appetize

cannot infer contextual base in reference to member 'phoneNumber'
fields.append(.phoneNumber)
}
applePayAdditionalContactFields = fields
Expand Down
2 changes: 1 addition & 1 deletion PrimerSDK.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "PrimerSDK"
s.version = "2.31.0"
s.version = "2.31.1"
s.summary = "Official iOS SDK for Primer"
s.description = <<-DESC
This library contains the official iOS SDK for Primer. Install this Cocoapod to seemlessly integrate the Primer Checkout & API platform in your app.
Expand Down
2 changes: 1 addition & 1 deletion Sources/PrimerSDK/Classes/version.swift
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// swiftlint:disable:next identifier_name
public let PrimerSDKVersion = "2.31.0"
public let PrimerSDKVersion = "2.31.1"
44 changes: 22 additions & 22 deletions Tests/Primer/ApplePay/ApplePayPresentationManagerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,28 +56,28 @@ final class ApplePayPresentationManagerTests: XCTestCase {
XCTAssertTrue(sut.isPresentable)
}

func testShippingContactFields() throws {
let additionalFields: [PrimerApplePayOptions.ShippingOptions.AdditionalShippingContactField] = [.name, .emailAddress, .phoneNumber]

var applePayOptions = PrimerApplePayOptions(merchantIdentifier: "merchant_id",
merchantName: "merchant_name",
checkProvidedNetworks: true,
shippingOptions: .init(isCaptureShippingAddressEnabled: true,
additionalShippingContactFields: additionalFields, requireShippingMethod: true))
var shippingFields = sut.shippingContactFields(applePayOptions: applePayOptions)

XCTAssertEqual(shippingFields, [.name, .postalAddress, .emailAddress, .phoneNumber])

applePayOptions = PrimerApplePayOptions(merchantIdentifier: "merchant_id",
merchantName: "merchant_name",
checkProvidedNetworks: true,
shippingOptions: .init(isCaptureShippingAddressEnabled: true,
additionalShippingContactFields: nil, requireShippingMethod: true))

shippingFields = sut.shippingContactFields(applePayOptions: applePayOptions)

XCTAssertEqual(shippingFields, [.postalAddress])
}
// func testShippingContactFields() throws {
// let additionalFields: [PrimerApplePayOptions.ShippingOptions.AdditionalShippingContactField] = [.name, .emailAddress, .phoneNumber]
//
// var applePayOptions = PrimerApplePayOptions(merchantIdentifier: "merchant_id",
// merchantName: "merchant_name",
// checkProvidedNetworks: true,
// shippingOptions: .init(isCaptureShippingAddressEnabled: true,
// additionalShippingContactFields: additionalFields, requireShippingMethod: true))
// var shippingFields = sut.shippingContactFields(applePayOptions: applePayOptions)
//
// XCTAssertEqual(shippingFields, [.name, .postalAddress, .emailAddress, .phoneNumber])
//
// applePayOptions = PrimerApplePayOptions(merchantIdentifier: "merchant_id",
// merchantName: "merchant_name",
// checkProvidedNetworks: true,
// shippingOptions: .init(isCaptureShippingAddressEnabled: true,
// additionalShippingContactFields: nil, requireShippingMethod: true))
//
// shippingFields = sut.shippingContactFields(applePayOptions: applePayOptions)
//
// XCTAssertEqual(shippingFields, [.postalAddress])
// }

func testErrorForDisplay() {
let error = sut.errorForDisplay
Expand Down
Loading
Loading