Skip to content
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Project demonstrates multiple flows that ProcessOut framework is capable of.

## Requirements

- A recent version of Xcode (tested with 16.0)
- Xcode 26.2 or later
- [Homebrew](https://brew.sh) package manager

### Installation
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Get started with our ProcessOut [documentation](https://docs.processout.com/) or

- [ProcessOut](https://swiftpackageindex.com/processout/processout-ios/documentation/processout)
- [ProcessOutCheckout3DS](https://swiftpackageindex.com/processout/processout-ios/documentation/processoutcheckout3ds)
- [ProcessOutCoreUI](https://swiftpackageindex.com/processout/processout-ios/documentation/processoutcoreui)
- [ProcessOutNetcetera3DS](https://swiftpackageindex.com/processout/processout-ios/documentation/processoutnetcetera3ds)
- [ProcessOutUI](https://swiftpackageindex.com/processout/processout-ios/documentation/processoutui)

Expand All @@ -17,6 +18,7 @@ Get started with our ProcessOut [documentation](https://docs.processout.com/) or
| ---------------------- | ---------------------------------------------------------------------------- |
| ProcessOut | Allows to interact with ProcessOut API and provides a UI to handle payments. |
| ProcessOutCheckout3DS | Integration with Checkout.com 3D Secure (3DS) mobile SDK. |
| ProcessOutCoreUI | Shared styling primitives used by ProcessOutUI. |
| ProcessOutNetcetera3DS | Integration with Netcetera 3D Secure (3DS) mobile SDK. |
| ProcessOutUI | ProcessOut prebuilt UI to handle payments. |

Expand All @@ -32,7 +34,7 @@ We welcome contributions of any kind including new features, bug fixes, and gene

### Development requirements

- A recent version of Xcode (tested with 16.0)
- Xcode 26.2 or later
- [Homebrew](https://brew.sh/) package manager

### Installation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ public struct POTypedRepresentation<Wrapped, Representation: RawRepresentable> {
self._wrappedValue = wrappedValue
}

@available(*, deprecated, message: "Use typed representation accessible via projectedValue.typed instead.")
public var wrappedValue: Wrapped {
get { _wrappedValue }
set { _wrappedValue = newValue }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public struct POCardTokenizationRequest: Codable, Sendable {
public let contact: POContact?

/// Preferred scheme defined by the Customer.
@available(*, deprecated, message: "Use $preferredScheme.typed instead.")
@POTypedRepresentation<String?, POCardScheme>
public private(set) var preferredScheme: String?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public struct POCardUpdateRequest: Codable, Sendable {

/// Preferred scheme defined by the Customer. This gets priority when processing the Transaction.
/// Pass `nil` to keep existing value.
@available(*, deprecated, message: "Use $preferredScheme.typed instead.")
@POTypedRepresentation<String?, POCardScheme>
public private(set) var preferredScheme: String?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,17 @@ public struct POCard: Codable, Hashable, Sendable {
public let projectId: String

/// Scheme of the card.
@available(*, deprecated, message: "Use $scheme.typed instead.")
@POTypedRepresentation<String, POCardScheme>
public private(set) var scheme: String

/// Co-scheme of the card, such as Carte Bancaire.
@available(*, deprecated, message: "Use $coScheme.typed instead.")
@POTypedRepresentation<String?, POCardScheme>
public private(set) var coScheme: String?

/// Preferred scheme defined by the Customer.
@available(*, deprecated, message: "Use $preferredScheme.typed instead.")
@POTypedRepresentation<String?, POCardScheme>
public private(set) var preferredScheme: String?

Expand Down Expand Up @@ -60,6 +63,7 @@ public struct POCard: Codable, Hashable, Sendable {
public let expYear: Int

/// CVC check status.
@available(*, deprecated, message: "Use $cvcCheck.typed instead.")
@POTypedRepresentation<String, POCardCvcCheck>
public var cvcCheck: String

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
public struct POCardIssuerInformation: Codable, Sendable {

/// Scheme of the card.
@available(*, deprecated, message: "Use $scheme.typed instead.")
@POTypedRepresentation<String, POCardScheme>
public private(set) var scheme: String

/// Co-scheme of the card, such as Carte Bancaire.
@available(*, deprecated, message: "Use $coScheme.typed instead.")
@POTypedRepresentation<String?, POCardScheme>
public private(set) var coScheme: String?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public struct POAssignCustomerTokenRequest: Codable, Sendable { // sourcery: Aut
public let source: String

/// Card scheme or co-scheme that should get priority if it is available.
@available(*, deprecated, message: "Use $preferredScheme.typed instead.")
@POTypedRepresentation<String?, POCardScheme>
public private(set) var preferredScheme: String?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public struct POCustomerToken: Identifiable, Codable, Sendable {
public let invoiceId: String?

/// Source used to create the token (which will usually be a Card).
@available(*, deprecated, message: "Use $type.typed instead.")
@POTypedRepresentation<String, POCustomerTokenType>
public private(set) var type: String

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public struct POInvoiceAuthorizationRequest: Codable, Sendable { // sourcery: Au
public let enableThreeDS2 = true // sourcery:coding: key="enable_three_d_s_2"

/// Card scheme or co-scheme that should get priority if it is available.
@available(*, deprecated, message: "Use $preferredScheme.typed instead.")
@POTypedRepresentation<String?, POCardScheme>
public private(set) var preferredScheme: String?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public struct PO3DS2Configuration: Codable, Hashable, Sendable {
public let directoryServerTransactionId: String

/// Card scheme from the card used to initiate the payment.
@available(*, deprecated, message: "Use $scheme.typed() instead.")
@POTypedRepresentation<PO3DS2ConfigurationCardScheme?, POCardScheme>
public private(set) var scheme: PO3DS2ConfigurationCardScheme?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ private extension POAssignCustomerTokenRequest { // swiftlint:disable:this no_ex
customerId: customerId,
tokenId: tokenId,
source: newSource ?? source,
preferredScheme: preferredScheme,
preferredScheme: $preferredScheme.typed?.rawValue,
verify: verify,
invoiceId: invoiceId,
thirdPartySdkVersion: newSdkVersion ?? thirdPartySdkVersion,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,17 @@ public protocol PONativeAlternativePaymentMethodDelegate: AnyObject, Sendable {

extension PONativeAlternativePaymentMethodDelegate {

#if hasAttribute(diagnose)
@diagnose(DeprecatedDeclaration, as: ignored)
#endif
@MainActor
public func nativeAlternativePayment(didEmitEvent event: PONativeAlternativePaymentMethodEvent) {
nativeAlternativePaymentMethodDidEmitEvent(event)
}

#if hasAttribute(diagnose)
@diagnose(DeprecatedDeclaration, as: ignored)
#endif
@MainActor
public func nativeAlternativePayment(
defaultValuesFor parameters: [PONativeAlternativePaymentMethodParameter]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,3 @@ extension AuthenticationResult: @retroactive @unchecked Sendable { }

/// Marks `ChallengeParameters` as `Sendable` retroactively.
extension ChallengeParameters: @retroactive @unchecked Sendable { }

/// Marks `AuthenticationError` as `Sendable` retroactively.
extension AuthenticationError: @retroactive @unchecked Sendable { }
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ public protocol POCheckout3DSServiceDelegate: AnyObject, Sendable {
/// Provides default implementations to ensure backward compatibility.
extension POCheckout3DSServiceDelegate {

#if hasAttribute(diagnose)
@diagnose(DeprecatedDeclaration, as: ignored)
#endif
@MainActor
public func checkout3DSService(
_ service: POCheckout3DSService,
Expand All @@ -101,6 +104,9 @@ extension POCheckout3DSServiceDelegate {
willCreateAuthenticationRequest(configuration: configuration)
}

#if hasAttribute(diagnose)
@diagnose(DeprecatedDeclaration, as: ignored)
#endif
@MainActor
public func checkout3DSService(
_ service: POCheckout3DSService,
Expand All @@ -109,6 +115,9 @@ extension POCheckout3DSServiceDelegate {
configuration(with: parameters)
}

#if hasAttribute(diagnose)
@diagnose(DeprecatedDeclaration, as: ignored)
#endif
@MainActor
public func checkout3DSService(
_ service: POCheckout3DSService, shouldContinueWith warnings: Set<Warning>
Expand All @@ -118,6 +127,9 @@ extension POCheckout3DSServiceDelegate {
}
}

#if hasAttribute(diagnose)
@diagnose(DeprecatedDeclaration, as: ignored)
#endif
@MainActor
public func checkout3DSService(
_ service: POCheckout3DSService,
Expand All @@ -126,13 +138,19 @@ extension POCheckout3DSServiceDelegate {
didCreateAuthenticationRequest(result: result)
}

#if hasAttribute(diagnose)
@diagnose(DeprecatedDeclaration, as: ignored)
#endif
@MainActor
public func checkout3DSService(
_ service: POCheckout3DSService, willPerformChallengeWith parameters: PO3DS2ChallengeParameters
) {
willHandle(challenge: parameters)
}

#if hasAttribute(diagnose)
@diagnose(DeprecatedDeclaration, as: ignored)
#endif
@MainActor
public func checkout3DSService(
_ service: POCheckout3DSService, didPerformChallenge result: Result<PO3DS2ChallengeResult, POFailure>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by Andrii Vysotskyi on 25.11.2024.
//

import class UIKit.UIApplication
import UIKit
import AVFoundation
@_spi(PO) import ProcessOut

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,17 @@ extension POCardTokenizationDelegate {
// Ignored
}

#if hasAttribute(diagnose)
@diagnose(DeprecatedDeclaration, as: ignored)
#endif
@MainActor
public func cardTokenization(preferredSchemeWith issuerInformation: POCardIssuerInformation) -> POCardScheme? {
preferredScheme(issuerInformation: issuerInformation).map(POCardScheme.init)
}

#if hasAttribute(diagnose)
@diagnose(DeprecatedDeclaration, as: ignored)
#endif
@MainActor
public func cardTokenization(didTokenizeCard card: POCard, shouldSaveCard: Bool) async throws {
try await processTokenizedCard(card: card)
Expand All @@ -99,7 +105,7 @@ extension POCardTokenizationDelegate {

@MainActor
public func preferredScheme(issuerInformation: POCardIssuerInformation) -> String? {
issuerInformation.scheme
issuerInformation.$scheme.typed.rawValue
}

@MainActor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,17 @@ public struct POCardUpdateInformation: Sendable {
public let iin: String?

/// Scheme of the card.
@available(*, deprecated, message: "Use $scheme.typed instead.")
@POTypedRepresentation<String?, POCardScheme>
public private(set) var scheme: String?

/// Co-scheme of the card, such as Carte Bancaire.
@available(*, deprecated, message: "Use $coScheme.typed instead.")
@POTypedRepresentation<String?, POCardScheme>
public private(set) var coScheme: String?

/// Preferred scheme previously selected by customer if any.
@available(*, deprecated, message: "Use $preferredScheme.typed instead.")
@POTypedRepresentation<String?, POCardScheme>
public private(set) var preferredScheme: String?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,8 @@ final class NativeAlternativePaymentDefaultInteractor:
return .group(try await resolve(group: group))
case .unknown:
return nil
@unknown default:
return nil
}
return nil
}
Expand Down Expand Up @@ -918,6 +920,9 @@ final class NativeAlternativePaymentDefaultInteractor:
case .unknown:
assertionFailure("Unable to validate unknown parameter.")
return nil
@unknown default:
assertionFailure("Unable to validate unknown parameter.")
return nil
}
validation = .init(
name: parameter.specification.key,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ struct CardsServiceTests {
let card = try await sut.tokenize(request: request)

// Then
#expect(card.preferredScheme == request.preferredScheme)
#expect(card.$preferredScheme.typed == request.$preferredScheme.typed)
}

// MARK: - Private Properties
Expand Down
8 changes: 4 additions & 4 deletions project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ targets:
ProcessOutTests:
type: bundle.unit-test
platform: iOS
deploymentTarget: "16.0"
deploymentTarget: "17.0"
settings:
TARGET_ROOT: $(PROJECT_DIR)/Tests/ProcessOutTests
dependencies:
Expand All @@ -87,7 +87,7 @@ targets:
ProcessOutUITests:
type: bundle.unit-test
platform: iOS
deploymentTarget: "16.0"
deploymentTarget: "17.0"
settings:
TARGET_ROOT: $(PROJECT_DIR)/Tests/ProcessOutUITests
dependencies:
Expand Down Expand Up @@ -128,7 +128,7 @@ targets:
ProcessOutCheckout3DSTests:
type: bundle.unit-test
platform: iOS
deploymentTarget: "16.0"
deploymentTarget: "17.0"
settings:
TARGET_ROOT: $(PROJECT_DIR)/Tests/ProcessOutCheckout3DSTests
dependencies:
Expand All @@ -137,7 +137,7 @@ targets:
ProcessOutNetcetera3DSTests:
type: bundle.unit-test
platform: iOS
deploymentTarget: "16.0"
deploymentTarget: "17.0"
settings:
TARGET_ROOT: $(PROJECT_DIR)/Tests/ProcessOutNetcetera3DSTests
dependencies:
Expand Down
Loading