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

Order importer does not create payments for shipping cost #86

Open
johnpitchko opened this issue Aug 29, 2022 · 4 comments
Open

Order importer does not create payments for shipping cost #86

johnpitchko opened this issue Aug 29, 2022 · 4 comments
Labels

Comments

@johnpitchko
Copy link
Contributor

Hi @kennyadsl @aldesantis, Bryan asked me to mention this to you. We noticed a potential bug in the order importer where it does not generate payment records to account for shipment costs. The result was imported orders were left in a balance_due payment state.

You'll see in the attached screenshot, after the import of the template, there are only payment records for the line items.

image

I wrote a patch for our needs but am happy to contribute it upstream.

@kennyadsl
Copy link
Member

Thanks! Of course if you can contribute that would be awesome. What was the root cause of the issue?

@johnpitchko
Copy link
Contributor Author

I'm definitely no expert on the importer, so I might have some pieces wrong. But when a line item is imported, a payment is created via payment_attributes, which only takes into account the amount of the line item without shipping. The shipping cost is not included in this value.

So what I kludged together a decorator for the after_import method to look up any orders that were imported that are in balance_due payment state, then create an additional payment for the shipping cost.

@stale
Copy link

stale bot commented Oct 29, 2022

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

@stale stale bot added the stale label Oct 29, 2022
@kennyadsl kennyadsl removed the stale label Nov 2, 2022
@stale
Copy link

stale bot commented Jan 8, 2023

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

@stale stale bot added the stale label Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants