Skip to content

Commit

Permalink
vault function comments and changelog
Browse files Browse the repository at this point in the history
Co-authored-by: Ricardo Herrera <[email protected]>
  • Loading branch information
KunJeongPark and richherrera committed Dec 13, 2023
1 parent d8f8f66 commit 578854d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@

# PayPal iOS SDK Release Notes

## unreleased
* PayPalWebPayments
* Add `vault(url:)` method to `PayPalWebCheckoutClient`
* Add `PayPalVaultResult` type to return vault result
* Add `PayPalVaultDelegate` to handle results from vault flow
* Add `PayPalWebCheckoutClientError.paypalVaultResponseError` for missing or invalid response from vaulting

## 1.1.0 (2023-11-16)
* PayPalNativePayments
* Bump `PayPalCheckout` to `1.2.0`
Expand Down
6 changes: 6 additions & 0 deletions Sources/PayPalWebPayments/PayPalWebCheckoutClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ public class PayPalWebCheckoutClient: NSObject {
return checkoutURLComponents?.url
}

/// Starts a web session for vaulting PayPal Payment Method
/// After setupToken successfullly attaches a payment method, you will need to create a payment token with the setup token
/// - Parameters:
/// - url: URL created from string value from setupToken API
/// - Returns: PayPalVaultResult
/// - Throws: PayPalSDK error if vaulting could not complete successfully
public func vault(url: URL) {
webAuthenticationSession.start(
url: url,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class PayPalClient_Tests: XCTestCase {
XCTAssertEqual(vaultError.code, expectedError.code)
expectation.fulfill()
}, cancel: { _ in
expectation.fulfill()
XCTFail("Invoked cancel callback. Should invoke error().")
})
payPalClient.vaultDelegate = mockVaultDelegate
payPalClient.vault(url: url!)
Expand All @@ -111,7 +111,6 @@ class PayPalClient_Tests: XCTestCase {

let mockVaultDelegate = MockPayPalVaultDelegate(success: {_, _ in
XCTFail("Invoked success() callback. Should invoke error().")
expectation.fulfill()
}, error: {_, vaultError in
XCTAssertEqual(vaultError.code, expectedError.code)
expectation.fulfill()
Expand Down

0 comments on commit 578854d

Please sign in to comment.