Closed jaxdesmarais closed 4 months ago
Were you able to test with any stubbed redirect URL (using our demo apps fly.io site)? I'm curious if /v1/payment_methods/paypal_accounts
works as expected with an HTTPS path or if we'll need an update from the GW
Were you able to test with any stubbed redirect URL (using our demo apps fly.io site)? I'm curious if /v1/payment_methods/paypal_accounts works as expected with an HTTPS path or if we'll need an update from the GW
I was able to test this and there were no issues with the HTTPS path, since we are mainly parsing the data from that path to send into paypal_accounts
. It's a bit awkward to test since we are working off of mocks right now, but this is what I did (it needs a real EC token and BA token to work):
UIApplication.shared.open
line in the View ControllerhandleReturn
and grab the valid EC and BA token from the URLStop the app and replace line 169-175 with:
let newURL = URL(string: "https://www.paypal.com/success?token=MY_EC_TOKEN&ba_token=MY_BA_TOKEN&switch_initiated_time=123456789")!
guard isValidURLAction(url: newURL) else {
notifyFailure(with: BTPayPalError.invalidURLAction, completion: completion)
return
}
guard let response = responseDictionary(from: newURL) else {
paypal_accounts
and we get a nonce back as expected in notifySuccess
We can really only test pieces of this so far until we actually start getting the expected data back, but working off of our mocks this should work as expected 🤞. Let me know if I misunderstood what you were thinking we'd test here, did a lot of very hacky workarounds based on mocks to test different pieces. 😅
Summary of changes
BTPayPalAppSwitchReturnURL
BTPayPalClient.handleBrowserSwitchReturn
tohandleReturn
since it will be used for both app switch and ASWeb returnshandleReturnURL
for App Switch flowsBTPayPalError.unknownAppSwitchError
and update typo oninvalidURL
errorBTPayPalAppSwitchReturnURL_Tests
BTPayPalClient_Tests
for new codeChecklist
Authors