spree_store_credit_payment_method
spree_store_credit_payment_method copied to clipboard
If you don't use a confirm step, the credits are not used
The transition hooks should probably check if a confirm step is used, otherwise run on complete.
I can put together a PR for this, or maybe it should just be a comment in the docs?
@paultyng on this pr to get things up to date it does do the charge on transition to complete, but it still builds the payments on transition to confirm, which maybe should happen in the payment step:
https://github.com/spree-contrib/spree_store_credit_payment_method/pull/23/files
scratch that, it's still on transition to confirm, the gift cards are related to complete. if you want to submit a PR that would be wonderful
I've been working on this and it's not as simple as base.state_machine.before_transition from: :payment, do: :add_store_credit_payments
or to: :complete
, because the callback gets called AFTER order.process_payments!
What we ended up doing was adding the payment before transition to payment
, removing the credit card reconciliation portion, and then in update_params_payment_source
we just set the payment amount to whatever is leftover at that point.
Doing it in the before transition to payment is also how we address the issue in #25
@paultyng What's the user's workflow if their order is fully covered by store credit? Do they see the payment page still? Or does it take them straight from delivery to complete?
We still show the page with just copy saying that its fully covered by store credit and nothing is necessary. Not ideal, but works for now.
@paultyng I've been struggling with fixing a similar problem myself. Any chance you could help and provide some details on your solution?