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

Shipping address validation on Paysheet starts #100

Closed
mauro-poq opened this issue Apr 1, 2022 · 13 comments
Closed

Shipping address validation on Paysheet starts #100

mauro-poq opened this issue Apr 1, 2022 · 13 comments

Comments

@mauro-poq
Copy link

I have a case where the user has only invalid addresses in PayPal when I start the Paysheet, in my case the user has only UK addresses and the company accepts only US addresses for delivery. So when the user opens the Paysheet we have already a default address set by PayPal SDK but the onShippingChange is not called, so I'm not able to call my BackEnd to verify.
Talking to the iOS developer, he said to me that every time he opens the paysheet the onShippingChange is invoked and he is able to validate the address.
I don't know if this is a bug or not, however, is there a way to make the SDK invoke onShippingChange as soon as the user opens the paysheet, maybe some configuration?
Other scenarios are working fine, if the user changes the address I receive the callback and I'm able to validate the address.

@tdchow
Copy link
Collaborator

tdchow commented Apr 13, 2022

Hi @mauro-poq - Sorry for the delay. We should be invoking the OnShippingChange callback when the paysheet loads.

We've picked up the work and the change should be in the next release of the SDK. Will keep you updated!

@mauro-poq
Copy link
Author

Hey @tdchow how are you?
Back in this item, in the latest version (0.8.7) I can see that when we first launch the paysheet the onShippingChange is invoked and that address is cached, however, when the user finishes the first purchase and execute a second purchase the address is cached and the SDK is not invoking onShippingChange, this is bringing me some problems because I need the address to calculate the Taxes.

Questions:

  • Is there a plan for the next releases to start executing the onShippingChange callback (if it makes sense) every time the paysheet is open, even if the address is cached?
  • If not (or as a temporary workaround), is there a way to clear the cache and force this behaviour?

Note:
Testing here I see that if I close the app and open it again the onShippingChange callback is executed, which makes me think that there is a cache.

@tdchow
Copy link
Collaborator

tdchow commented Dec 15, 2022

hi @mauro-poq! Apologies for not getting back to you here!

I was able to verify that the second time the SDK is invoked, the onShippingChange callback is not called 😕

Thanks for calling this bug out. I've created a ticket for the team to resolve this. We'll keep you updated on the fix here.

@chpypl
Copy link
Collaborator

chpypl commented Feb 8, 2023

Hello @mauro-poq This fix for this should come out in the next release.

@mauro-poq
Copy link
Author

mauro-poq commented Mar 15, 2023

Hey, @chpypl @tdchow I have just tested it on version 0.8.8 and the behaviour looks the same as described above, is the fix already in or it will be in the next version?

@chpypl
Copy link
Collaborator

chpypl commented Mar 16, 2023

Hi @mauro-poq the fix will be in the next version

@Eric-Catalyst
Copy link

This is a critical item as the failure to make the callback call means we do not have the opportunity to calculate the correct taxes for a given purchase. This will not go unnoticed by end users looking to game the checkout process potentially leaving us paying taxes for PayPal customers, or worse, not paying the taxes and incurring fines and penalties from taxing authorities.
We need confirmation that you really have a resolution for this issue and when the resolution will be published.

@mauro-poq
Copy link
Author

Hi @tdchow and @chpypl, I have tested this in the new version (0.112.0) to see if the change were included, however, I can see now that the onShippingChange method receives an object called ShippingChangeAddress which does not include the fields addressLine1 and addressLine2 as the former Address object, in this case, how do we get the street name?
I have not tested the problem yet as this break my use case, so I can't go forward.

@tdchow
Copy link
Collaborator

tdchow commented Jun 7, 2023

Hi @mauro-poq - sorry for the delayed response.

The removal of addressLine1 and addressLine2 was an intentional change due to a privacy concern. Are you able to calculate shipping costs based on the buyer's selected city, state, and postal code?

@mauro-poq
Copy link
Author

Hey @tdchow - no problem man!

I see, I think it will not be a problem, but before checking with the BE team, can you confirm if the fields will be present when the user places the order (press the pay button)?

@tdchow
Copy link
Collaborator

tdchow commented Jun 7, 2023

The OnShippingChange callback should be called initially when the paysheet is loaded and whenever the buyer changes their shipping address - both of which should be before the user clicks on the CTA button. If you're seeing different behavior please let me know and we can further investigate!

@mauro-poq
Copy link
Author

Hey @tdchow I can confirm that the fix is in place and working. Feel free to close or change the status of this issue.

@tdchow
Copy link
Collaborator

tdchow commented Jun 20, 2023

@mauro-poq - Awesome, thanks so much for retesting and following up here. Will close out this issue.

@tdchow tdchow closed this as completed Jun 20, 2023
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

4 participants