solidusio / solidus_stripe

💳 Integrate Solidus with Stripe
https://stripe.com
BSD 3-Clause "New" or "Revised" License
37 stars 61 forks source link

Allow finalizing an order if fully covered by store credits #310

Closed rainerdema closed 1 year ago

rainerdema commented 1 year ago

Summary

Fixes #307

This temporary fix enables the finalization of orders entirely covered by store credits or adjustments, but it can't be a permanent solution.

The main "issue" relates to Stirpe, which does not allow a 0$ charge because the minimum amount needed to perform the operation isn't met: https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts

Various alternative strategies could be followed:

ℹ️ Touching the payment_required? method on Spree::Order is something I didn't consider as it would prevent the processing of payments and possibly even the applied store credits, but I haven't looked into that so much, so let me know.

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

The following are not always needed:

Screenshots

May-25-2023 17-29-00

Screenshot 2023-05-25 at 17 29 31
rainerdema commented 1 year ago

@solidusio/core-team thoughts on https://github.com/solidusio/solidus_stripe/pull/310#issue-1725969255?

codecov[bot] commented 1 year ago

Codecov Report

Merging #310 (c970554) into main (b7dfc00) will increase coverage by 0.00%. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #310   +/-   ##
=======================================
  Coverage   99.64%   99.64%           
=======================================
  Files          31       31           
  Lines         563      564    +1     
=======================================
+ Hits          561      562    +1     
  Misses          2        2           
Impacted Files Coverage Δ
...lates/app/views/checkouts/payment/_stripe.html.erb 100.00% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

waiting-for-dev commented 1 year ago

I think, ideally, our business logic should be able to move forward when there's no required money. If that's not possible, then we should tackle it at the view layer, but I wouldn't enforce a minimum amount.

rainerdema commented 1 year ago

This will be addressed with: Preventing available payment method rendering for orders fully covered by Store Credits #345