Skip to content

Commit fa9f512

Browse files
authored
Merge 2.0.0-beta1 to main (#301)
* Remove MXO (#291) * Remove MXO * remove Package.resolved file containing incompatible pinstorage version * CHANGELOG entry * Jax feedback and docStrings correction * Remove PatchOrder for MXO, unused files in demo app * Remove more classes used exclusively for MXO * Convert Delegation Pattern to Completion Handler (#293) * PayPal remove delgation pattern for completion handler function for checkout * lint error for paypal start * completion and analytics into notify functions * paypal vault completion, unit tests * remove PayPal delegates, references * Card vault to completion, unit tests * Card approve to completion, unit tests * docstrings for approve completion param * wrap paypal functions in async await * async await wrapper for CardClient functions * remove CardDelegate and references * fix error in notifyCheckoutFailure * Make error names and messages payPal caps consistent * changelog entires * Steven PR feedback: typo in Chagelog * Simplify Cancel Errors (#296) * Simplify cancel errors * CHANGELOG for the cancel errors * Steven PR feedback: change back CardClientError.canceled to .threeDSecureCanceled * CHANGELOG update * Cancel error handling (#297) * http performRequest returns NetworkingClientErrors * CardClient helper function for threeDSCancel, demo app cancel, demo app minor fixes * PayPalClient cancel helper functions and demo app changes * Steven PR feedback: move static helper functions to error enums * Rename CardClientError -> CardError, PayPalWebCheckoutError -> PayPalError * Steven PR feedback: return CoreSDKError in merchant completion handler * CHANGELOG and analytics typo and fix wrong code in graphql error * v2 migration guide (#295) * v2 migration guide * just cocoapods or SPM * fix typos * minor spacing changes * Update with simplified cancel errors * Steven PR feedback - diff to render green/red * include removal of delegate methods in delete block * update with cardClient threeDSecureCanceled error * change to threeDSecureCanceled in migration steps * add comment highlighting cancellation errors * typo fix * clarify separating cancel cases in errors * revert cancel handling instructions * add changes for cancellation helper methods * fix typo in PayPalError.isCheckoutCanceled * Steven PR feedback * Make PayPalError and CardError Code enum consistent (#298) * Changelog: move additive changes from breaking section (#299) * Changelog: move additive changes from breaking section * remove duplicate line for PayPal cancel errors
1 parent 13865f9 commit fa9f512

File tree

69 files changed

+1003
-3240
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+1003
-3240
lines changed

CHANGELOG.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,39 @@
11

22
# PayPal iOS SDK Release Notes
33

4+
## unreleased
5+
* Breaking Changes
6+
* PayPalNativePayments
7+
* Remove entire PayPalNativePayments module
8+
* PayPalWebPayments
9+
* Replace delegate pattern with completion handlers and Swift concurrency
10+
* Remove `PayPalWebCheckoutDelegate` and `PayPalVaultDelegate`
11+
* Remove `start(request:)` method that uses delegate callbacks
12+
* Remove `vault(vaultRequest:)` method that uses delegate callbacks
13+
* Add `start(request:completion(PayPalWebCheckoutResult?, CoreSDKError?) -> Void)` to `PayPalWebCheckoutClient`
14+
* Add `vault(vaultRequest:completion(PayPalVaultResult?, CoreSDKError?) -> Void)` to `PayPalWebCheckoutClient`
15+
* Add `start(request:) async throws -> PayPalCheckoutResult`
16+
* Add `vault(vaultRequest:) async throws -> PayPalVaultResult`
17+
* CardPayments
18+
* Replace delegate pattern with completion handlers and Swift concurrency
19+
* Remove `CardDelegate` and `CardVaultDelegate`
20+
* Remove `approveOrder(request:)` method that uses delegate callbacks
21+
* Remove `vault(vaultRequest:)` method that uses delegate callbacks
22+
* Add `approveOrder(request:completion:(CardResult?, CoreSDKError?) -> Void)` to `CardClient`
23+
* Add `vault(request:completion:(CardVaultResult?, CoreSDKError?) -> Void)` to `CardClient`
24+
* Add `approveOrder(request:) async throws -> CardResult`
25+
* Add `vault(vaultRequest:) async throws -> CardVaultResult`
26+
* PayPalWebPayments
27+
* Rename `PayPalWebCheckoutClientError` to `PayPalError`
28+
* Add `.checkoutCanceledError` and `vaultCanceledError` to `PayPalError`
29+
* Add public static functions `isCheckoutCanceled(Error)` and `isVaultCanceled(Error)` to `PayPalError` to distinguish cancellation errors in PayPal flows.
30+
* Make `PayPalError` public to expose cancellation error handling helpers
31+
* CardPayments
32+
* Rename `CardClientError` to `CardError`
33+
* Add `threeDSecureCanceledError` to `CardError`
34+
* Add public static function `isThreeDSecureCanceled(Error)` to `CardError` to distinguish cancellation error from threeDSecure verification
35+
* Make `CardError` public to expose cancellation error handling helper
36+
437
## 1.5.0 (2024-10-24)
538
* PayPalWebPayments
639
* Deprecate `PayPalVaultRequest(url:setupTokenID:)`

Demo/Demo.xcodeproj/project.pbxproj

Lines changed: 0 additions & 51 deletions
Large diffs are not rendered by default.

Demo/Demo/Helpers/OrderRequestHelpers.swift

Lines changed: 0 additions & 99 deletions
This file was deleted.

Demo/Demo/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<plist version="1.0">
44
<dict>
55
<key>CFBundleShortVersionString</key>
6-
<string>1.5.0</string>
6+
<string>2.0.0-beta1</string>
77
<key>UIApplicationSceneManifest</key>
88
<dict>
99
<key>UIApplicationSupportsMultipleScenes</key>

Demo/Demo/Models/ProcessOrderParams.swift

Lines changed: 0 additions & 6 deletions
This file was deleted.

Demo/Demo/Models/ShippingPreference.swift

Lines changed: 0 additions & 7 deletions
This file was deleted.

Demo/Demo/Models/UpdateOrderParams.swift

Lines changed: 0 additions & 68 deletions
This file was deleted.

Demo/Demo/Networking/DemoMerchantAPI.swift

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -116,18 +116,6 @@ final class DemoMerchantAPI {
116116
return try parse(from: data)
117117
}
118118

119-
/// This function replicates a way a merchant may go about patching an order on their server and is not part of the SDK flow.
120-
/// - Parameters:
121-
/// - updateOrderParams: the parameters to update the order with
122-
/// - Throws: an error explaining why patching the order failed
123-
func updateOrder(_ updateOrderParams: UpdateOrderParams, selectedMerchantIntegration: MerchantIntegration) async throws {
124-
guard let url = buildBaseURL(with: "/orders/" + updateOrderParams.orderID) else {
125-
throw URLResponseError.invalidURL
126-
}
127-
let urlRequest = buildURLRequest(method: "PATCH", url: url, body: updateOrderParams.updateOperations)
128-
_ = try await data(for: urlRequest)
129-
}
130-
131119
/// This function fetches a clientID to initialize any module of the SDK
132120
/// - Parameters:
133121
/// - environment: the current environment

Demo/Demo/SwiftUIComponents/FeatureSelectionView.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,6 @@ struct FeatureSelectionView: View {
4949
} label: {
5050
Text("PayPal Vaulting")
5151
}
52-
NavigationLink {
53-
SwiftUINativeCheckoutDemo()
54-
} label: {
55-
Text("Native Checkout")
56-
}
5752
NavigationLink {
5853
SwiftUIPaymentButtonDemo()
5954
} label: {

Demo/Demo/SwiftUIComponents/PayPalVaultViews/PayPalVaultView.swift

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,18 @@ struct PayPalVaultView: View {
1515
)
1616
SetupTokenResultView(vaultViewModel: paypalVaultViewModel)
1717
if let setupTokenID = paypalVaultViewModel.state.setupToken?.id {
18-
Button("Vault PayPal") {
19-
Task {
20-
await paypalVaultViewModel.vault(setupTokenID: setupTokenID)
18+
ZStack {
19+
Button("Vault PayPal") {
20+
Task {
21+
await paypalVaultViewModel.vault(setupTokenID: setupTokenID)
22+
}
23+
}
24+
.buttonStyle(RoundedBlueButtonStyle())
25+
.padding()
26+
if case .loading = paypalVaultViewModel.state.paypalVaultTokenResponse {
27+
CircularProgressView()
2128
}
2229
}
23-
.buttonStyle(RoundedBlueButtonStyle())
24-
.padding()
2530
}
2631
PayPalVaultResultView(viewModel: paypalVaultViewModel)
2732
if let paypalVaultResult = paypalVaultViewModel.state.paypalVaultToken {

0 commit comments

Comments
 (0)