solidus

https://github.com/solidusio/solidus

Ruby

🛒 Solidus, the open-source eCommerce framework for industry trailblazers.

Spree::OrderUpdater#update_payment_state

Updates the +payment_state+ attribute according to the following logic:

paid          when +payment_total+ is equal to +total+
balance_due   when +payment_total+ is less than +total+
credit_owed   when +payment_total+ is greater than +total+
failed        when most recent payment is in the failed state

The +payment_state+ value helps with reporting, etc. since it provides a quick and easy way to locate Orders needing attention.

Source | Google | Stack overflow

Edit

git clone [email protected]:solidusio/solidus.git

cd solidus

open core/app/models/spree/order_updater.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Spree--OrderUpdater-update_payment_state-for-pr


# Commit to git

git add core/app/models/spree/order_updater.rbgit commit -m "better docs for Spree::OrderUpdater#update_payment_state"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Spree--OrderUpdater-update_payment_state-for-pr

hub pull-request


# Celebrate!