Skip to content

Commit

Permalink
[DTPPMOBILE-143] Deprecate Delegation Methods in Paypal SDK (#304)
Browse files Browse the repository at this point in the history
* Deprecate delegate protocols and methods
  • Loading branch information
GMALKHA authored Nov 26, 2024
1 parent 13865f9 commit 1d8cb0c
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ jobs:
run: cd SampleApps/SPMTest && swift package resolve
- name: Build & archive SPMTest
run: xcodebuild -project 'SampleApps/SPMTest/SPMTest.xcodeproj' -scheme 'SPMTest' clean build archive CODE_SIGNING_ALLOWED=NO
run: pod lib lint --allow-warnings="deprecated"

2 changes: 2 additions & 0 deletions .github/workflows/swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ jobs:
run: brew install swiftlint
- name: Run SwiftLint
run: swiftlint --strict
disabled_rules:
- deprecated_syntax
2 changes: 2 additions & 0 deletions Sources/CardPayments/CardClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public class CardClient: NSObject {
/// If `didAttempt3DSecureVerification` is `true`, check verification status with `/v3/vault/setup-token/{id}` in your server.
/// - Parameters:
/// - vaultRequest: The request containing setupTokenID and card
@available(*, deprecated, message: "This method is deprecated and will be removed in version 2.0.0. Please use the new completion handler-based approach instead. For more details, visit the v2 migration guide: https://github.com/paypal/paypal-ios/")
public func vault(_ vaultRequest: CardVaultRequest) {
analyticsService = AnalyticsService(coreConfig: config, setupToken: vaultRequest.setupTokenID)
analyticsService?.sendEvent("card-payments:vault-wo-purchase:started")
Expand Down Expand Up @@ -75,6 +76,7 @@ public class CardClient: NSObject {
/// - Parameters:
/// - orderId: Order id for approval
/// - request: The request containing the card
@available(*, deprecated, message: "This method is deprecated and will be removed in version 2.0.0. Please use the new completion handler-based approach instead. For more details, visit the v2 migration guide: https://github.com/paypal/paypal-ios/")
public func approveOrder(request: CardRequest) {
analyticsService = AnalyticsService(coreConfig: config, orderID: request.orderID)
analyticsService?.sendEvent("card-payments:3ds:started")
Expand Down
1 change: 1 addition & 0 deletions Sources/CardPayments/CardClientError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Foundation
import CorePayments
#endif

@available(*, deprecated, renamed: "CardError")
enum CardClientError {

static let domain = "CardClientErrorDomain"
Expand Down
1 change: 1 addition & 0 deletions Sources/CardPayments/CardDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import CorePayments
#endif

/// Card delegate to handle events from CardClient
@available(*, deprecated, message: "This protocol is deprecated and will be removed in version 2.0.0. Please use the new completion handler-based approach instead. For more details, visit the v2 migration guide: https://github.com/paypal/paypal-ios/")
public protocol CardDelegate: AnyObject {

/// Notify that the Card flow finished with a successful result
Expand Down
1 change: 1 addition & 0 deletions Sources/CardPayments/CardVaultDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import CorePayments
#endif

/// CardVault delegate to handle events from CardClient
@available(*, deprecated, message: "This protocol is deprecated and will be removed in version 2.0.0. Please use the new completion handler-based approach instead. For more details, visit the v2 migration guide: https://github.com/paypal/paypal-ios/")
public protocol CardVaultDelegate: AnyObject {

/// Notify that the Card vault flow finished with a successful result
Expand Down
1 change: 1 addition & 0 deletions Sources/PayPalWebPayments/PayPalVaultDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import CorePayments
#endif

/// PayPalVault delegate to vault results from PayPalWebCheckoutClient
@available(*, deprecated, message: "This protocol is deprecated and will be removed in version 2.0.0. Please use the new completion handler-based approach instead. For more details, visit the v2 migration guide: https://github.com/paypal/paypal-ios/")
public protocol PayPalVaultDelegate: AnyObject {

/// Notify that the PayPal vault flow finished with a successful result
Expand Down
1 change: 1 addition & 0 deletions Sources/PayPalWebPayments/PayPalWebCheckoutClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class PayPalWebCheckoutClient: NSObject {
/// Launch the PayPal web flow
/// - Parameters:
/// - request: the PayPalRequest for the transaction
@available(*, deprecated, message: "This method is deprecated and will be removed in version 2.0.0. Please use the new completion handler-based approach instead. For more details, visit the v2 migration guide: https://github.com/paypal/paypal-ios/")
public func start(request: PayPalWebCheckoutRequest) {
analyticsService = AnalyticsService(coreConfig: config, orderID: request.orderID)
analyticsService?.sendEvent("paypal-web-payments:started")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Foundation
import CorePayments
#endif

@available(*, deprecated, renamed: "PayPalError")
enum PayPalWebCheckoutClientError {

static let domain = "PayPalClientErrorDomain"
Expand Down
1 change: 1 addition & 0 deletions Sources/PayPalWebPayments/PayPalWebCheckoutDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import CorePayments
#endif

/// PayPal delegate to handle events from PayPalNativeCheckoutClient
@available(*, deprecated, message: "This protocol is deprecated and will be removed in version 2.0.0. Please use the new completion handler-based approach instead. For more details, visit the v2 migration guide: https://github.com/paypal/paypal-ios/")
public protocol PayPalWebCheckoutDelegate: AnyObject {

/// Notify that the PayPal flow finished with a successful result
Expand Down

0 comments on commit 1d8cb0c

Please sign in to comment.