Skip to content

Commit

Permalink
update parsing app switch url for 1-time checkout flow
Browse files Browse the repository at this point in the history
  • Loading branch information
agedd committed Jan 7, 2025
1 parent daaebca commit b0e5ef7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Sources/BraintreePayPal/BTPayPalApprovalURLParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ struct BTPayPalApprovalURLParser {
url = payPalAppRedirectURL
} else if let approvalURL = body["paymentResource"]["redirectUrl"].asURL() ??
body["agreementSetup"]["approvalUrl"].asURL() {
redirectType = .webBrowser(url: approvalURL)
let launchPayPalApp = body["launchPayPalApp"].asBool() ?? false
redirectType = launchPayPalApp ? .payPalApp(url: approvalURL) : .webBrowser(url: approvalURL)
url = approvalURL
} else {
return nil
Expand Down
2 changes: 1 addition & 1 deletion Sources/BraintreePayPal/BTPayPalCheckoutRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ import BraintreeCore
universalLink: URL? = nil,
isPayPalAppInstalled: Bool = false
) -> [String: Any] {
var baseParameters = super.parameters(with: configuration)
var baseParameters = super.parameters(with: configuration, universalLink: universalLink, isPayPalAppInstalled: isPayPalAppInstalled)
var checkoutParameters: [String: Any] = [
"intent": intent.stringValue,
"amount": amount,
Expand Down

0 comments on commit b0e5ef7

Please sign in to comment.