Skip to content

Commit

Permalink
One time checkout app switch changes (#1257)
Browse files Browse the repository at this point in the history
* update logic for when app switch is enabled
  • Loading branch information
saperi22 authored Jan 16, 2025
1 parent 58755a6 commit d6bc4da
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ internal class PayPalInternalClient(
if (!pairingId.isNullOrEmpty()) {
paymentAuthRequest.approvalUrl = createAppSwitchUri(parsedRedirectUri).toString()
} else {
callback.onResult(null, BraintreeException("Missing BA Token for PayPal App Switch."))
callback.onResult(null, BraintreeException("Missing Token for PayPal App Switch."))
}
} else {
paymentAuthRequest.approvalUrl = parsedRedirectUri.toString()
Expand All @@ -182,10 +182,7 @@ internal class PayPalInternalClient(
.build()
}

fun isAppSwitchEnabled(payPalRequest: PayPalRequest): Boolean {
return (payPalRequest is PayPalVaultRequest) &&
payPalRequest.enablePayPalAppSwitch
}
fun isAppSwitchEnabled(payPalRequest: PayPalRequest) = payPalRequest.enablePayPalAppSwitch

fun isPayPalInstalled(context: Context): Boolean {
return deviceInspector.isPayPalInstalled(context)
Expand Down

0 comments on commit d6bc4da

Please sign in to comment.