@@ -373,7 +373,7 @@ import BraintreeDataCollector
373
373
)
374
374
return
375
375
}
376
- self . launchPayPalApp ( with: url, token : token , completion: completion)
376
+ self . launchPayPalApp ( with: url, completion: completion)
377
377
case . webBrowser( let url) :
378
378
self . handlePayPalRequest ( with: url, paymentType: request. paymentType, completion: completion)
379
379
}
@@ -383,7 +383,6 @@ import BraintreeDataCollector
383
383
384
384
private func launchPayPalApp(
385
385
with payPalAppRedirectURL: URL ,
386
- token: String ? = nil ,
387
386
completion: @escaping ( BTPayPalAccountNonce ? , Error ? ) -> Void
388
387
) {
389
388
apiClient. sendAnalyticsEvent (
@@ -394,11 +393,11 @@ import BraintreeDataCollector
394
393
)
395
394
396
395
var urlComponents = URLComponents ( url: payPalAppRedirectURL, resolvingAgainstBaseURL: true )
397
- urlComponents? . queryItems = [
398
- URLQueryItem ( name: isVaultRequest ? " ba_token " : " token " , value: token) ,
396
+ let additionalQueryItems : [ URLQueryItem ] = [
399
397
URLQueryItem ( name: " source " , value: " braintree_sdk " ) ,
400
398
URLQueryItem ( name: " switch_initiated_time " , value: String ( Int ( round ( Date ( ) . timeIntervalSince1970 * 1000 ) ) ) )
401
399
]
400
+ urlComponents? . queryItems? . append ( contentsOf: additionalQueryItems)
402
401
403
402
guard let redirectURL = urlComponents? . url else {
404
403
self . notifyFailure ( with: BTPayPalError . invalidURL ( " Unable to construct PayPal app redirect URL. " ) , completion: completion)
0 commit comments