Skip to content

Commit 578854d

Browse files
vault function comments and changelog
Co-authored-by: Ricardo Herrera <[email protected]>
1 parent d8f8f66 commit 578854d

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

CHANGELOG.md

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

22
# PayPal iOS SDK Release Notes
33

4+
## unreleased
5+
* PayPalWebPayments
6+
* Add `vault(url:)` method to `PayPalWebCheckoutClient`
7+
* Add `PayPalVaultResult` type to return vault result
8+
* Add `PayPalVaultDelegate` to handle results from vault flow
9+
* Add `PayPalWebCheckoutClientError.paypalVaultResponseError` for missing or invalid response from vaulting
10+
411
## 1.1.0 (2023-11-16)
512
* PayPalNativePayments
613
* Bump `PayPalCheckout` to `1.2.0`

Sources/PayPalWebPayments/PayPalWebCheckoutClient.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,12 @@ public class PayPalWebCheckoutClient: NSObject {
9797
return checkoutURLComponents?.url
9898
}
9999

100+
/// Starts a web session for vaulting PayPal Payment Method
101+
/// After setupToken successfullly attaches a payment method, you will need to create a payment token with the setup token
102+
/// - Parameters:
103+
/// - url: URL created from string value from setupToken API
104+
/// - Returns: PayPalVaultResult
105+
/// - Throws: PayPalSDK error if vaulting could not complete successfully
100106
public func vault(url: URL) {
101107
webAuthenticationSession.start(
102108
url: url,

UnitTests/PayPalWebPaymentsTests/PayPalWebCheckoutClient_Tests.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class PayPalClient_Tests: XCTestCase {
8888
XCTAssertEqual(vaultError.code, expectedError.code)
8989
expectation.fulfill()
9090
}, cancel: { _ in
91-
expectation.fulfill()
91+
XCTFail("Invoked cancel callback. Should invoke error().")
9292
})
9393
payPalClient.vaultDelegate = mockVaultDelegate
9494
payPalClient.vault(url: url!)
@@ -111,7 +111,6 @@ class PayPalClient_Tests: XCTestCase {
111111

112112
let mockVaultDelegate = MockPayPalVaultDelegate(success: {_, _ in
113113
XCTFail("Invoked success() callback. Should invoke error().")
114-
expectation.fulfill()
115114
}, error: {_, vaultError in
116115
XCTAssertEqual(vaultError.code, expectedError.code)
117116
expectation.fulfill()

0 commit comments

Comments
 (0)