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

100% discount on order not working #821

Closed
kevinmeijer97 opened this issue Feb 17, 2023 · 1 comment · Fixed by #822
Closed

100% discount on order not working #821

kevinmeijer97 opened this issue Feb 17, 2023 · 1 comment · Fixed by #822

Comments

@kevinmeijer97
Copy link

kevinmeijer97 commented Feb 17, 2023

Description

A client of ours wants to give out 100% free coupons for some products, this means that sometimes the total order value will be 0.
When you have a 0 euro order and use Mollie as your payment provider, the moment you press pay to redirect to mollie it gives out the following error:
Mollie\Api\Exceptions\ApiException [2023-02-17T13:36:32+0100] Error executing API call (422: Unprocessable Entity): The amount contains an invalid value. Field: amount.value. Documentation: https://docs.mollie.com/overview/handling-errors
Mollie can't handle 0 euro orders, which makes sense since theres nothing to pay.
What would make sense to me is to check for 0 value before redirecting to Mollie for payment.

Steps to reproduce

  1. Setup basic checkout with Mollie as your payment provider
  2. Create a 100% off coupon
  3. Try and pay for the order

Environment

Environment
Application Name:
Laravel Version: 9.52.0
PHP Version: 8.1.11
Composer Version: 2.5.4
Environment: production
Debug Mode: OFF
URL: cityapptour.com
Maintenance Mode: OFF

Cache
Config: CACHED
Events: NOT CACHED
Routes: CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: redis
Database: mysql
Logs: daily
Mail: smtp
Queue: redis
Session: redis

Simple Commerce
Gateways: Dummy, Mollie
Repository: Customer: DoubleThreeDigital\SimpleCommerce\Customers\EloquentCustomerRepository
Repository: Order: DoubleThreeDigital\SimpleCommerce\Orders\EloquentOrderRepository
Repository: Product: DoubleThreeDigital\SimpleCommerce\Products\EntryProductRepository
Shipping Methods: Standard Post
Tax Engine: DoubleThreeDigital\SimpleCommerce\Tax\Standard\TaxEngine

Statamic
Addons: 10
Antlers: regex
Stache Watcher: Enabled
Static Caching: full
Version: 3.3.68 PRO

Statamic Addons
doublethreedigital/runway: 2.6.0
doublethreedigital/simple-commerce: 4.2.3
edalzell/blade-directives: 3.7
justbetter/sc-import-variant-data: dev-develop
justbetter/statamic-image-optimize: 1.1.4
mitydigital/iconamic: 1.1.2
simonridley/tracking-code-manager: dev-master
spatie/statamic-responsive-images: 2.15.2
webographen/statamic-dynamic-token: 1.0.0
withcandour/aardvark-seo: 2.0.30

@duncanmcclean
Copy link
Owner

duncanmcclean commented Feb 18, 2023

Thanks for reporting this!

Instead of Simple Commerce trying to redirect the user to the off-site gateway for £0 orders, it'll now mark the order as paid and send them directly to the redirect URL you have set on the {{ sc:checkout:mollie }} tag.


Released as part of v4.5.5.

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

Successfully merging a pull request may close this issue.

2 participants