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

PayPal gateway is overwriting order address Id #2

Open
marisks opened this issue Oct 24, 2017 · 2 comments
Open

PayPal gateway is overwriting order address Id #2

marisks opened this issue Oct 24, 2017 · 2 comments

Comments

@marisks
Copy link

marisks commented Oct 24, 2017

PayPal gateway overwrites order address Id which causes order to become invalid. Payments/shipments lose the reference to their addresses.
This line of code does it: https://github.com/episerver/CommercePaymentGateways/blob/master/EPiServer.Business.Commerce.Payment.PayPal/Helpers/AddressHandling.cs#L59

@vietanh-optimizely
Copy link

Hi,
Order address is saved as customer address (method TrySaveCustomerAddress)
Customer address Name is set by order address Id. In case duplicate name, then address name is added with "addressCount" (see table cls_Address and below line of code)
https://github.com/episerver/CommercePaymentGateways/blob/master/EPiServer.Business.Commerce.Payment.PayPal/Helpers/AddressHandling.cs#L143

I created 2 orders, checkout with PayPal, and select 2 different addresses but same name on PayPal. The orders still refer to correct address, not losing reference. Is this the case you mentioned? Or you can you please give more details?

/Viet Anh

@marisks
Copy link
Author

marisks commented Nov 28, 2017

I have a latest Episerver Commerce installed and this PayPal gateway. When I create an order (through customer UI and not from the Commerce Manager), then after checkout there is no billing address or shipping address in the Commerce Manager.

The reason is that orderAddress.Id is automatically generated by Episerver when using new APIs. But this code: https://github.com/episerver/CommercePaymentGateways/blob/master/EPiServer.Business.Commerce.Payment.PayPal/Helpers/AddressHandling.cs#L59 overwrites it. It should be removed.
After this fix everything works fine.

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

2 participants