diff --git a/CHANGELOG.md b/CHANGELOG.md index 83314c6f..26ee05b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ # PayPal iOS SDK Release Notes +## unreleased +* PayPalNativePayments (DEPRECATED) + * **Note:** This module is deprecated and will be removed in a future version of the SDK + * Add deprecated warning message to all public classes and methods + ## 1.3.2 (2024-05-23) * PaymentButtons * Add black boundary around white buttons diff --git a/Demo/Demo/SwiftUIComponents/SwiftUINativeCheckoutDemo.swift b/Demo/Demo/SwiftUIComponents/SwiftUINativeCheckoutDemo.swift index b7fea6e9..dd3c7e4d 100644 --- a/Demo/Demo/SwiftUIComponents/SwiftUINativeCheckoutDemo.swift +++ b/Demo/Demo/SwiftUIComponents/SwiftUINativeCheckoutDemo.swift @@ -2,6 +2,7 @@ import Foundation import SwiftUI import PaymentButtons +@available(*, deprecated, message: "PayPalNativePayments Module is deprecated, use PayPalWebPayments Module instead") struct SwiftUINativeCheckoutDemo: View { @StateObject var viewModel = PayPalViewModel() @@ -103,6 +104,7 @@ struct SwiftUINativeCheckoutDemo: View { } } +@available(*, deprecated, message: "PayPalNativePayments Module is deprecated, use PayPalWebPayments Module instead") struct SwiftUINativeCheckoutDemo_Preview: PreviewProvider { static var previews: some View { diff --git a/Demo/Demo/ViewModels/PayPalViewModel.swift b/Demo/Demo/ViewModels/PayPalViewModel.swift index 1b16f03e..f004a97b 100644 --- a/Demo/Demo/ViewModels/PayPalViewModel.swift +++ b/Demo/Demo/ViewModels/PayPalViewModel.swift @@ -2,6 +2,7 @@ import Foundation import PayPalNativePayments import CorePayments +@available(*, deprecated, message: "PayPalNativePayments Module is deprecated, use PayPalWebPayments Module instead") class PayPalViewModel: ObservableObject { enum State { @@ -85,6 +86,7 @@ class PayPalViewModel: ObservableObject { } } +@available(*, deprecated, message: "PayPalNativePayments Module is deprecated, use PayPalWebPayments Module instead") extension PayPalViewModel: PayPalNativeCheckoutDelegate { func paypal(_ payPalClient: PayPalNativeCheckoutClient, didFinishWithResult result: PayPalNativeCheckoutResult) { @@ -104,6 +106,7 @@ extension PayPalViewModel: PayPalNativeCheckoutDelegate { } } +@available(*, deprecated, message: "PayPalNativePayments Module is deprecated, use PayPalWebPayments Module instead") extension PayPalViewModel: PayPalNativeShippingDelegate { func paypal( diff --git a/Sources/PayPalNativePayments/NativeCheckoutProvider.swift b/Sources/PayPalNativePayments/NativeCheckoutProvider.swift index d18c123b..9938f6b8 100644 --- a/Sources/PayPalNativePayments/NativeCheckoutProvider.swift +++ b/Sources/PayPalNativePayments/NativeCheckoutProvider.swift @@ -5,6 +5,7 @@ import PayPalCheckout import CorePayments #endif +@available(*, deprecated, message: "PayPalNativePayments Module is deprecated, use PayPalWebPayments Module instead") class NativeCheckoutProvider: NativeCheckoutStartable { /// Used in POST body for FPTI analytics. diff --git a/Sources/PayPalNativePayments/NativeCheckoutStartable.swift b/Sources/PayPalNativePayments/NativeCheckoutStartable.swift index 4d5b8b1b..9e68d2e9 100644 --- a/Sources/PayPalNativePayments/NativeCheckoutStartable.swift +++ b/Sources/PayPalNativePayments/NativeCheckoutStartable.swift @@ -5,6 +5,7 @@ import PayPalCheckout import CorePayments #endif +@available(*, deprecated, message: "PayPalNativePayments Module is deprecated, use PayPalWebPayments Module instead") protocol NativeCheckoutStartable { /// Used in POST body for FPTI analytics. diff --git a/Sources/PayPalNativePayments/PayPalNativeCheckoutClient.swift b/Sources/PayPalNativePayments/PayPalNativeCheckoutClient.swift index 92279bae..29aa37fb 100644 --- a/Sources/PayPalNativePayments/PayPalNativeCheckoutClient.swift +++ b/Sources/PayPalNativePayments/PayPalNativeCheckoutClient.swift @@ -6,6 +6,7 @@ import CorePayments /// PayPal Paysheet to handle PayPal transaction /// encapsulates instance to communicate with nxo +@available(*, deprecated, message: "PayPalNativePayments Module is deprecated, use PayPalWebPayments Module instead") public class PayPalNativeCheckoutClient { public weak var delegate: PayPalNativeCheckoutDelegate? @@ -21,6 +22,7 @@ public class PayPalNativeCheckoutClient { /// Initialize a PayPalNativeCheckoutClient to process PayPal transaction /// - Parameters: /// - config: The CoreConfig object + @available(*, deprecated, message: "PayPalNativePayments Module is deprecated, use PayPalWebPayments Module instead") public convenience init(config: CoreConfig) { self.init( config: config, @@ -40,6 +42,7 @@ public class PayPalNativeCheckoutClient { /// - Parameters: /// - request: The PayPalNativeCheckoutRequest for the transaction /// - presentingViewController: the ViewController to present PayPalPaysheet on, if not provided, the Paysheet will be presented on your top-most ViewController + @available(*, deprecated, message: "PayPalNativePayments Module is deprecated, use PayPalWebPayments Module instead") public func start( request: PayPalNativeCheckoutRequest, presentingViewController: UIViewController? = nil diff --git a/Sources/PayPalNativePayments/PayPalNativeCheckoutDelegate.swift b/Sources/PayPalNativePayments/PayPalNativeCheckoutDelegate.swift index 41b102d5..ae0636ca 100644 --- a/Sources/PayPalNativePayments/PayPalNativeCheckoutDelegate.swift +++ b/Sources/PayPalNativePayments/PayPalNativeCheckoutDelegate.swift @@ -5,6 +5,7 @@ import CorePayments import PayPalCheckout /// A required delegate to handle events from `PayPalNativeCheckoutClient.start()` +@available(*, deprecated, message: "PayPalNativePayments Module is deprecated, use PayPalWebPayments Module instead") public protocol PayPalNativeCheckoutDelegate: AnyObject { /// Notify that the PayPal flow finished with a successful result @@ -31,6 +32,7 @@ public protocol PayPalNativeCheckoutDelegate: AnyObject { /// A delegate to receive notifications if the user changes their shipping information. /// /// This is **only required** if the order ID was created with `shipping_preferences = GET_FROM_FILE`. [See Orders V2 documentation](https://developer.paypal.com/docs/api/orders/v2/#definition-order_application_context). If the order ID was created with `shipping_preferences = NO_SHIPPING` or `SET_PROVIDED_ADDRESS`, don't implement this protocol. +@available(*, deprecated, message: "PayPalNativePayments Module is deprecated, use PayPalWebPayments Module instead") public protocol PayPalNativeShippingDelegate: AnyObject { /// Notify when the users selected shipping address changes. Use `PayPalNativeShippingActions.approve` diff --git a/Sources/PayPalNativePayments/PayPalNativeCheckoutRequest.swift b/Sources/PayPalNativePayments/PayPalNativeCheckoutRequest.swift index 93fc2a08..c7dd4caa 100644 --- a/Sources/PayPalNativePayments/PayPalNativeCheckoutRequest.swift +++ b/Sources/PayPalNativePayments/PayPalNativeCheckoutRequest.swift @@ -1,6 +1,7 @@ import Foundation /// Used to configure options for approving a PayPal native order +@available(*, deprecated, message: "PayPalNativePayments Module is deprecated, use PayPalWebPayments Module instead") public struct PayPalNativeCheckoutRequest { /// The order ID associated with the request. diff --git a/Sources/PayPalNativePayments/PayPalNativeCheckoutResult.swift b/Sources/PayPalNativePayments/PayPalNativeCheckoutResult.swift index 3ea27fb5..e6e1c35a 100644 --- a/Sources/PayPalNativePayments/PayPalNativeCheckoutResult.swift +++ b/Sources/PayPalNativePayments/PayPalNativeCheckoutResult.swift @@ -1,8 +1,9 @@ import Foundation /// The result of a PayPal native payment flow. +@available(*, deprecated, message: "PayPalNativePayments Module is deprecated, use PayPalWebPayments Module instead") public struct PayPalNativeCheckoutResult { - + /// The order ID associated with the transaction. public let orderID: String diff --git a/Sources/PayPalNativePayments/PayPalNativePaysheetActions.swift b/Sources/PayPalNativePayments/PayPalNativePaysheetActions.swift index 9e359ad3..c4f49182 100644 --- a/Sources/PayPalNativePayments/PayPalNativePaysheetActions.swift +++ b/Sources/PayPalNativePayments/PayPalNativePaysheetActions.swift @@ -1,6 +1,7 @@ import PayPalCheckout /// The actions that can be used to update the Paysheet UI after `PayPalNativeShippingDelegate` methods are invoked. +@available(*, deprecated, message: "PayPalNativePayments Module is deprecated, use PayPalWebPayments Module instead") public class PayPalNativePaysheetActions { private let shippingActions: ShippingActionsProtocol diff --git a/Sources/PayPalNativePayments/PayPalNativeShippingAddress.swift b/Sources/PayPalNativePayments/PayPalNativeShippingAddress.swift index 7e18b6f4..fab0cd5e 100644 --- a/Sources/PayPalNativePayments/PayPalNativeShippingAddress.swift +++ b/Sources/PayPalNativePayments/PayPalNativeShippingAddress.swift @@ -6,6 +6,7 @@ import PayPalCheckout /// If you want to show shipping options in the PayPal Native Paysheet, /// provide `purchase_units[].shipping.options` when creating an orderID with /// the [`orders/v2` API](https://developer.paypal.com/docs/api/orders/v2/#definition-purchase_unit) on your server. Otherwise, our Paysheet won't display any shipping options. +@available(*, deprecated, message: "PayPalNativePayments Module is deprecated, use PayPalWebPayments Module instead") public struct PayPalNativeShippingAddress { /// The ID of the shipping address diff --git a/Sources/PayPalNativePayments/PayPalNativeShippingMethod.swift b/Sources/PayPalNativePayments/PayPalNativeShippingMethod.swift index 4c6cba78..003945db 100644 --- a/Sources/PayPalNativePayments/PayPalNativeShippingMethod.swift +++ b/Sources/PayPalNativePayments/PayPalNativeShippingMethod.swift @@ -6,8 +6,9 @@ import PayPalCheckout /// If you want to show shipping options in the PayPal Native Paysheet, /// provide `purchase_units[].shipping.options` when creating an orderID with /// the [`orders/v2` API](https://developer.paypal.com/docs/api/orders/v2/#definition-purchase_unit) on your server. Otherwise, our Paysheet won't display any shipping options. +@available(*, deprecated, message: "PayPalNativePayments Module is deprecated, use PayPalWebPayments Module instead") public struct PayPalNativeShippingMethod { - + /// The method by which the payer wants to get their items. public enum DeliveryType: Int, CaseIterable, Codable { @@ -79,6 +80,7 @@ public struct PayPalNativeShippingMethod { } } +@available(*, deprecated, message: "PayPalNativePayments Module is deprecated, use PayPalWebPayments Module instead") extension PayPalCheckout.ShippingType { func toMerchantFacingShippingType() -> PayPalNativeShippingMethod.DeliveryType {