Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

Paypal transactions flatten addresses #301

Open
hrdchz opened this issue Nov 2, 2021 · 3 comments
Open

Paypal transactions flatten addresses #301

hrdchz opened this issue Nov 2, 2021 · 3 comments

Comments

@hrdchz
Copy link

hrdchz commented Nov 2, 2021

Is there any reason not to adopt the approach outlined in #163 (decorator to set TransactionImport#address to nil)?

Potentially a more friendly solution would be to only correct the Billing Address if it differs from the one returned from Paypal. It is a common practice to use a different shipping address to send a gift, for example.

The same block also includes a bit about unsetting @tax_zone in the order:

        if address
          order.shipping_address = order.billing_address = address
          # work around a bug in most solidus versions
          # about tax zone cachine between address changes
          order.instance_variable_set("@tax_zone", nil)
        end

Occasionally we have an order come through from Paypal that is missing the shipping tax adjustment even though they paid the correct amount on Paypal. I'll have to look in the core commits to see if anything resolved that "zone caching" issue this tries to circumvent, but I'd be happy to submit a PR that:

  1. no longer overwrites the shipping address
  2. does not unset @tax_zone (if that's an appropriate thing to do, I'm unfamiliar with the history / context)
@hrdchz
Copy link
Author

hrdchz commented Nov 3, 2021

ok yea there's more to unpack here than that.

  1. The shipping address is sent up to paypal
  2. Choosing "guest checkout" populates the billing address with that shipping address in the Paypal dialog
  3. The shipping address is not editable on Paypal
  4. A Transaction needs the address to validate
  5. import! sets the bill and ship address of the order to be that single address

Not sure why that import of the address needs to happen when it can't be edited on Paypal

@hrdchz
Copy link
Author

hrdchz commented Nov 3, 2021

Ok, I think there might be some reason to make this a configurable setting now I have dug in a bit. If I have time in the future, I will submit a PR. It seems like this would be useful in some case where Paypal has not received an address from Solidus. In our storefront, we are using basically the default paypal buttons provided in the extension, which are very similar to the demo code suggested by Braintree.

For anyone experiencing this issue, #163 does prevent the transaction from Paypal from setting the Bill Address of the order to the Ship Address.

@stale
Copy link

stale bot commented Nov 11, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Nov 11, 2022
@gsmendoza gsmendoza removed the wontfix label Nov 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants