Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The return url is just cancatinated with the return params #161

Open
emartynov opened this issue Jul 11, 2023 · 8 comments
Open

The return url is just cancatinated with the return params #161

emartynov opened this issue Jul 11, 2023 · 8 comments

Comments

@emartynov
Copy link

PayPal Android SDK Version

0.0.10

Environment

Sandbox

Android Version & Device

No response

PayPal dependencies

paypal-payments-sdk = { module = "com.paypal.android:paypal-native-payments", version.ref = "0.0.10" }

Describe the bug

I'm passing the return url like "schema://paypal" when constructing native checkout client.

After the Paypal checkout is finished, I see my app is notified with URL like schema://paypalxo?token.....
So SDK just operates with URL like with string and doesn'tadd an extra slash to URL.

To reproduce

See describe section

Expected behavior

The url slash is appended before the return parameters

Screenshots

No response

@sshropshire
Copy link
Collaborator

@emartynov thanks for your feedback. This is a valid URL according to RFC 3986 (I was able to double check using this tool). The slash before the return parameters isn't needed. Closing for now.

@emartynov
Copy link
Author

Did I mention that it is an invalid URL?

Let me rephrase the behaviour and expected behaviour.

Current behaviour:

  1. I pass "schema://host"
  2. I get back "schema://hostxo?param=value..."

I would expect the following:

  1. I get back "schema://host/xo?param=value..."

@sshropshire sshropshire reopened this Jul 11, 2023
@sshropshire
Copy link
Collaborator

@emartynov interesting ok. Let me follow up on this, I see the potential for confusion now.

@emartynov
Copy link
Author

BTW I fixed it in my codebase by passing "schema://host/" as a return URL.

It is an easy fix on Android - instead of treating the passed URL as a string, convert it to URI and operate on top of it by adding segments, etc.

This would be a nicer UX for users of the library. I assume the root case lies in the javascript SDK. However, your SDK as an intermediary level could make a small change here.

@emartynov
Copy link
Author

My previous message needs to be corrected. It doesn't matter if I add or not the trailing slash to the return URL.

I still get xo?.... concatenated without a slash.

@sshropshire
Copy link
Collaborator

@emartynov is this still an issue as well? I know you said you were able to work around it.

@emartynov
Copy link
Author

Let me check it

@devchristina
Copy link

Hi all. Any movement/follow up on this issue? Would love to close if not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants