Skip to content

Commit

Permalink
MXO Deprecation Annotations (#278)
Browse files Browse the repository at this point in the history
* MXO Deprecation Lines

* CHANGELOG entry

* fix lint errors

* Jax PR feedback
  • Loading branch information
KunJeongPark authored Jul 1, 2024
1 parent 93c59e9 commit f5d3a45
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 2 additions & 0 deletions Demo/Demo/SwiftUIComponents/SwiftUINativeCheckoutDemo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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 {
Expand Down
3 changes: 3 additions & 0 deletions Demo/Demo/ViewModels/PayPalViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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) {
Expand All @@ -104,6 +106,7 @@ extension PayPalViewModel: PayPalNativeCheckoutDelegate {
}
}

@available(*, deprecated, message: "PayPalNativePayments Module is deprecated, use PayPalWebPayments Module instead")
extension PayPalViewModel: PayPalNativeShippingDelegate {

func paypal(
Expand Down
1 change: 1 addition & 0 deletions Sources/PayPalNativePayments/NativeCheckoutProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions Sources/PayPalNativePayments/NativeCheckoutStartable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions Sources/PayPalNativePayments/PayPalNativeCheckoutClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand All @@ -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,
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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`
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit f5d3a45

Please sign in to comment.