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

Unable to pake a payment when discount has applied for the order line item #4

Closed
nikolenko-dmitriy opened this issue Feb 3, 2022 · 2 comments

Comments

@nikolenko-dmitriy
Copy link

No description provided.

@nikolenko-dmitriy nikolenko-dmitriy changed the title Don't include order adjustments as separate line items in Mollie order; Include line iteme property discountAmount Don't include order adjustments as separate line items for Mollie order; Include line item discount amount as a separate property discountAmount for Mollie line items Feb 3, 2022
@nikolenko-dmitriy
Copy link
Author

nikolenko-dmitriy commented Feb 4, 2022

We have the situation when order cannot be paid because of this error:

Order line 1 is invalid. VAT amount is off. Expected VAT amount t (truncated...)\n

Here is the full response from Mollie 2022-02-03_18-41

This order has only 1 line item with quantity 35 and the applied discount.

After some investigation we found that this happens when because of the discount: 2022-02-03_18-29

A dump of the result of the method getItemListForOrder contains this: 2022-02-03_18-33

As you can see, the discount was added as a separate line item, because it's an order adjuster.

Afterwards we tried to disable the discount: 2022-02-03_18-32 and error from Mollie wasn't triggered anymore.

Also there are no extra items in the result of the method getItemListForOrder when discount is disabled 2022-02-03_18-29_1

It makes me think that in case the discount is applied the vatAmout is calculated by the wrong formula, But I didn't find yet the exact reason.

Also there are some suggestions regarding discounts:

  1. Can we avoid discounts to be added as separate line items for the order in Mollie? Probably it's better to use discountAmount property on the lines array?
  2. Or if we still need a separate order line, maybe we should split up lines with a parameter "type": "physical" and "type": "discount", like in the example in docs

@nikolenko-dmitriy nikolenko-dmitriy changed the title Don't include order adjustments as separate line items for Mollie order; Include line item discount amount as a separate property discountAmount for Mollie line items Unable to pake payment when discount has applied for order line item Feb 4, 2022
@nikolenko-dmitriy nikolenko-dmitriy changed the title Unable to pake payment when discount has applied for order line item Unable to pake a payment when discount has applied for the order line item Feb 4, 2022
WHITE-developer added a commit that referenced this issue May 30, 2022
@WHITE-developer
Copy link
Collaborator

Hey @nikolenko-dmitriy ,
Sorry for the late reaction.
We just released a new version where the lineItem discount is added as the discountAmount.

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