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

AuthorizeDotNet payment processor: can't charge $0.00. #167

Open
eigood opened this issue May 18, 2021 · 5 comments
Open

AuthorizeDotNet payment processor: can't charge $0.00. #167

eigood opened this issue May 18, 2021 · 5 comments

Comments

@eigood
Copy link
Contributor

eigood commented May 18, 2021

<?xml version="1.0" encoding="utf-8"?><ErrorResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><messages><resultCode>Error</resultCode><message><code>E00003</code><text>The 'AnetApi/xml/v1/schema/AnetApiSchema.xsd:amount' element is invalid - The value &amp;#39;0&amp;#39; is invalid according to its datatype 'Decimal' - The MinInclusive constraint failed.</text></message></messages></ErrorResponse>

We create an order, attach a payment method, add products with quantities. Then, a promo rule applies that discounts certain products 100%. If the order only contains those discounted products, then the cost of the order ends up being totally 0. Then the CimPayment service(s) send this $0.00 charge over to Authorize.Net, which gives back an error.

@eigood
Copy link
Contributor Author

eigood commented May 19, 2021

I would have thought that something further up the processing chain would skip such processing. In our case, the accounting system gets updated properly, showing as a cost-of-doing-business in the promotions category; we like that.

@jonesde
Copy link
Member

jonesde commented May 20, 2021

Which service are you calling, or which is triggered? Is it a direct call to an AuthorizeNet service, or a higher level call to one of the mantle-usl services?

@eigood
Copy link
Contributor Author

eigood commented Jul 13, 2021

We add products to an order. Then we have a custom promo handler that adds a 100% discount to the order, so that the orderTotal=0. Then we transition the order from APPROVED to COMPLETED state. All payment gateway processing that you are asking about it done automatically by moqui.

jonesde added a commit that referenced this issue Jul 18, 2021
…ntegration call for these and just update Payment status to Delivered; adjustments in other places to better handle 0.0 amount payments, and for orders better handle per-part payment totals; related to issue #167
@jonesde
Copy link
Member

jonesde commented Jul 18, 2021

Thanks Adam... I looked into this a bit and made some changes in commit f305b51. The new behavior for 0.0 amount payments is to skip the gateway auth and capture, and just update the Payment status to Authorized and then Delivered. In that commit there are a few other changes to better handle 0.0 amounts, and to not better handle multiple payments associated with an OrderPart and how the amount defaults to the remaining amount... which is not part of this issue but something that annoyed me when trying to create data to test with, and it wasn't behaving in a great way.

If that fixes it for you, or is similar to the fix you came up with, we can close this issue... otherwise let me know what sort of annoyances you're still running into.

@eigood
Copy link
Contributor Author

eigood commented Jul 20, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants