[V7] Add fallbackURLScheme support to PayPal app switch flow
Summary of changes
We will give merchants a field to add a uri scheme for paypal to use as a backup if deeplink to merchant fails. Changes made include
- Adding the new parameter
- Sending up the value
- Checking if uri scheme value in BT validation on return.
Original PR: https://github.com/braintree/braintree_ios/pull/1673
This code was initially a reopen of https://github.com/braintree/braintree_ios/pull/1673, but as the repo underwent massive architectural changes, the cost-benefit of resolving merge conflicts proved to be higher than manually cherry-picking the changes and applying them in a new branch
Checklist
- [x] Added a changelog entry
- [x] Tested and confirmed payment flows affected by this change are functioning as expected
Authors
List GitHub usernames for everyone who contributed to this pull request.
- @ndrsKloss
can we add a CHANGELOG entry for this change? also it looks like there are a few lint errors and unit tests failing
Do we need a companion PR for the 6.x branch for this as well?
@agedd I will provide one soon.
@jaxdesmarais We will need but for now we are still doing an E2E, this PR servers to track any early merge conflicts. It can be changed to draft if it makes more sense.
Gotcha @ndrsKloss lets convert this to a draft and add the do not review tag. That will make it easier for our team to see what is higher priority to review.
I just removed fallbackURLScheme from the Checkout flow. The only leftover is:
protocol BTPayPalRequest {
// ...
func encodedPostBodyWith(
configuration: BTConfiguration,
isPayPalAppInstalled: Bool,
universalLink: URL?,
fallbackURLScheme: String? // Required by protocol
) -> Encodable
}
This is because BTPayPalCheckoutRequest conforms to BTPayPalRequest, and the encodedPostBodyWith function in BTPayPalRequest requires its implementation as it is shared between both Checkout and Vault
@ndrsKloss we can just add it to the Vault request if that is the case. The PayPalRequest is only for things shared across both requests.
@jaxdesmarais removing it from BTPayPalRequest would break polymorphism in:
private func tokenize(request: BTPayPalRequest, ...) { }
@jaxdesmarais removing it from
BTPayPalRequestwould break polymorphism in:private func tokenize(request: BTPayPalRequest, ...) { }
That is not correct. There are many properties such as requestBillingAgreement that is only passed in the BTPayPalCheckoutRequest and is not a part of the protocol.
Please, @jaxdesmarais, check if the latest commit aligns with your idea
To ensure assertiveness, this PR will only address new changes once its counterpart (https://github.com/braintree/braintree_ios/pull/1690) has been merged