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

[DTPPMOBILE-143] Deprecate Delegation Methods in Paypal SDK #304

Merged
merged 5 commits into from
Nov 26, 2024
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
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"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!


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
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