Skip to content

Commit 3b2f49c

Browse files
authored
Remove Access Token from MXO Migration guide & Demo (#165)
1 parent 069cdce commit 3b2f49c

File tree

8 files changed

+6
-49
lines changed

8 files changed

+6
-49
lines changed

Demo/Demo.xcodeproj/project.pbxproj

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
536A5CA62898A730005C053D /* NativeCheckoutDemoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 536A5CA52898A730005C053D /* NativeCheckoutDemoViewController.swift */; };
1414
536A5CA82898AA2A005C053D /* SwiftUINativeCheckoutDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 536A5CA72898AA2A005C053D /* SwiftUINativeCheckoutDemo.swift */; };
1515
53B9E8EA28C93B4400719239 /* OrderRequestHelpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53B9E8E928C93B4400719239 /* OrderRequestHelpers.swift */; };
16-
53DBDAA52885D83100E0ABA1 /* AccessTokenResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53DBDAA42885D83100E0ABA1 /* AccessTokenResponse.swift */; };
17-
53DBDAA72885D86F00E0ABA1 /* AccessTokenRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53DBDAA62885D86F00E0ABA1 /* AccessTokenRequest.swift */; };
1816
8052E2A529B684BA00B33FBC /* PPRiskMagnes.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8052E2A229B684A600B33FBC /* PPRiskMagnes.xcframework */; };
1917
8052E2A629B684BA00B33FBC /* PPRiskMagnes.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 8052E2A229B684A600B33FBC /* PPRiskMagnes.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
2018
80561B3826FB5F0F0023138C /* CardDemoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80561B3726FB5F0F0023138C /* CardDemoViewController.swift */; };
@@ -110,8 +108,6 @@
110108
536A5CA52898A730005C053D /* NativeCheckoutDemoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NativeCheckoutDemoViewController.swift; sourceTree = "<group>"; };
111109
536A5CA72898AA2A005C053D /* SwiftUINativeCheckoutDemo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftUINativeCheckoutDemo.swift; sourceTree = "<group>"; };
112110
53B9E8E928C93B4400719239 /* OrderRequestHelpers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderRequestHelpers.swift; sourceTree = "<group>"; };
113-
53DBDAA42885D83100E0ABA1 /* AccessTokenResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccessTokenResponse.swift; sourceTree = "<group>"; };
114-
53DBDAA62885D86F00E0ABA1 /* AccessTokenRequest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccessTokenRequest.swift; sourceTree = "<group>"; };
115111
8052E2A229B684A600B33FBC /* PPRiskMagnes.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = PPRiskMagnes.xcframework; path = ../Frameworks/XCFrameworks/PPRiskMagnes.xcframework; sourceTree = "<group>"; };
116112
80561B3726FB5F0F0023138C /* CardDemoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardDemoViewController.swift; sourceTree = "<group>"; };
117113
80561B3926FB5F1C0023138C /* PayPalWebCheckoutViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PayPalWebCheckoutViewController.swift; sourceTree = "<group>"; };
@@ -279,8 +275,6 @@
279275
80F33CEB26F8E799006811B1 /* Models */ = {
280276
isa = PBXGroup;
281277
children = (
282-
53DBDAA62885D86F00E0ABA1 /* AccessTokenRequest.swift */,
283-
53DBDAA42885D83100E0ABA1 /* AccessTokenResponse.swift */,
284278
5301468B28918B4D00184F22 /* ApprovalResult.swift */,
285279
3B80D50D2A291C0800D2EAC4 /* ClientIDRequest.swift */,
286280
3B80D50F2A291CB100D2EAC4 /* ClientIDResponse.swift */,
@@ -501,13 +495,11 @@
501495
BED04233271084DF00C80954 /* CardFormatter.swift in Sources */,
502496
CB9ED44E28411B120081F4DE /* SwiftUIPaymentButtonDemo.swift in Sources */,
503497
80561B3E26FB72D80023138C /* FeatureBaseViewController.swift in Sources */,
504-
53DBDAA72885D86F00E0ABA1 /* AccessTokenRequest.swift in Sources */,
505498
BE31187C273F00B60021C5A2 /* DemoUIFramework.swift in Sources */,
506499
BE9F36DC274578D100AFC7DA /* FeatureBaseViewControllerRepresentable.swift in Sources */,
507500
BECD84A027036DC2007CCAE4 /* Environment.swift in Sources */,
508501
806F1E3D26B85367007A60E6 /* ViewController.swift in Sources */,
509502
80F33CF126F8E7D9006811B1 /* ProcessOrderParams.swift in Sources */,
510-
53DBDAA52885D83100E0ABA1 /* AccessTokenResponse.swift in Sources */,
511503
53B9E8EA28C93B4400719239 /* OrderRequestHelpers.swift in Sources */,
512504
CB9ED44C283FDA900081F4DE /* PaymentButtonEnums+Extension.swift in Sources */,
513505
BED041B1270CB33900C80954 /* CustomTextField.swift in Sources */,

Demo/Demo/Models/AccessTokenRequest.swift

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

Demo/Demo/Models/AccessTokenResponse.swift

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

Demo/Demo/Networking/DemoMerchantAPI.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ final class DemoMerchantAPI {
1010
static let sharedService = DemoMerchantAPI()
1111
var clientID: String?
1212

13-
// To hardcode an access token and order ID for this demo app, set the below values
13+
// To hardcode an order ID and client ID for this demo app, set the below values
1414
enum InjectedValues {
1515
static let orderID: String? = nil
1616
static let clientID: String? = nil

MOBILE_CHECKOUT_MIGRATION_GUIDE.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This guide outlines how to update your integration from using the soon-to-be-dep
66
In order to use this migration guide, you must:
77

88
1. Have a server-side integration with the [PayPal Orders v2 API](https://developer.paypal.com/docs/api/orders/v2/). Please update to Orders v2 if you're on [Payments V1](https://developer.paypal.com/docs/api/payments/v1/) or [NVP/SOAP](https://developer.paypal.com/api/nvp-soap/).
9-
1. Enable your server to [fetch an Access Token](https://developer.paypal.com/reference/get-an-access-token/).
9+
1. Obtain your client ID. Follow the steps in [Get Started](https://developer.paypal.com/api/rest/#link-getstarted) to create a client ID in your PayPal Developer Dashboard.
1010
1. Enable your server to create an [Order ID](https://developer.paypal.com/docs/api/orders/v2/).
1111
1. Enable your server to [PATCH](https://developer.paypal.com/docs/api/orders/v2/#orders_patch) an order.
1212
* _Note:_ This is **only required** if you create your order ID with [`shipping_preference`](https://developer.paypal.com/docs/api/orders/v2/#definition-order_application_context) = `GET_FROM_FILE`. See step 6 in the guides below.
@@ -32,22 +32,22 @@ In order to use this migration guide, you must:
3232
2. Update Configuration
3333

3434
* Remove `CheckoutConfig` and related `set()` methods.
35-
* Instantiate a `CoreConfig` with your Access Token from the [pre-requisite](#pre-requisites) steps.
35+
* Instantiate a `CoreConfig` with your client ID from the [pre-requisite](#pre-requisites) steps.
3636
* Construct a `PayPalNativeCheckoutClient`.
3737
* Set delegates (more details to follow).
3838

3939
```diff
4040
private func configurePayPalCheckout() {
4141
- let config = CheckoutConfig(
42-
- clientID: "<ACCESS_TOKEN>",
42+
- clientID: "<CLIENT_ID>",
4343
- environment: .sandbox
4444
- )
4545
- Checkout.set(config: config)
4646
- Checkout.setCreateOrderCallback { createOrderAction in
4747
- createOrderAction.set(orderId: "<ORDER_ID>")
4848
- }
4949
50-
+ let coreConfig = CoreConfig(accessToken: "<ACCESS_TOKEN>"", environment: CorePayments.Environment.sandbox)
50+
+ let coreConfig = CoreConfig(clientID: "<CLIENT_ID>"", environment: CorePayments.Environment.sandbox)
5151
+ paypalClient = PayPalNativeCheckoutClient(config: coreConfig)
5252
5353
+ paypalClient?.delegate = self // always required
@@ -180,9 +180,3 @@ In order to use this migration guide, you must:
180180
* CocoaPods
181181
* Remove `pod 'PayPalCheckout'` from your Podfile
182182
* Refresh your local `/Pods`
183-
184-
## Resources
185-
186-
We migrated a sample app for you to reference:
187-
188-
* [iOS PR](https://github.com/scannillo/paypal-xo-sample/pull/1): ➕101 lines ➖39 lines

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ This SDK supports:
3131

3232
## Client ID
3333

34-
The PayPal SDK uses a client ID for authentication.
34+
The PayPal SDK uses a client ID for authentication. This can be found in your [PayPal Developer Dashboard](https://developer.paypal.com/api/rest/#link-getstarted).
3535

3636
## Modules
3737

UnitTests/CardPaymentsTests/CardClient_Tests.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import AuthenticationServices
88
class CardClient_Tests: XCTestCase {
99

1010
let mockClientID = "mockClientId"
11-
let mockAccessToken = "mockAccessToken"
1211

1312
// MARK: - Helper Properties
1413

UnitTests/PaymentsCoreTests/EligibilityAPI_Tests.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import XCTest
55
class EligibilityAPI_Tests: XCTestCase {
66

77
let mockClientID = "mockClientId"
8-
let mockAccessToken = "mockAccessToken"
98
let mockURLSession = MockURLSession()
109
var coreConfig: CoreConfig!
1110
var graphQLClient: GraphQLClient!

0 commit comments

Comments
 (0)