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

Bring in payment model #5678

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
06aa561
Bring in Payment model from Spree
sauloperez Jun 26, 2020
abacd06
Fix credit card instance in specs
sauloperez Jun 26, 2020
e1ea5db
Fix all but the 7 last payment specs
sauloperez Jun 26, 2020
34de219
Bring in missing translation
sauloperez Jun 26, 2020
a01f601
Fix yet another spec
sauloperez Jun 26, 2020
0ad8dcc
Fix payment log entries specs
sauloperez Jun 26, 2020
9935df9
Move Pin payment method from decorator into model
sauloperez Jun 26, 2020
31d0d4b
Fix error "no parent is saved"
sauloperez Jun 26, 2020
eafaa97
Temporarily skip spec
sauloperez Jun 26, 2020
322c4d0
Move decorator's callbacks to model
sauloperez Jun 26, 2020
6d9a518
Move method from decorator to model
sauloperez Jun 26, 2020
48910ae
Move #refund! to the processing.rb
sauloperez Jun 26, 2020
8617262
Move localize_number from decorator to model
sauloperez Jun 26, 2020
3fb6193
Move adjustments logic from decorator into model
sauloperez Jun 26, 2020
cf6138d
Replace model method with its decorated version
sauloperez Jun 26, 2020
d49068c
Move method delegation from decorator to model
sauloperez Jun 26, 2020
d8b748a
Merge alias_method method and its original version
sauloperez Jun 26, 2020
8fbbb0b
Bring back our card factory modification
sauloperez Jul 10, 2020
562f397
Isolate Spree's specs into their own context
sauloperez Jul 10, 2020
2f46483
Merge decorator specs with Spree's ones
sauloperez Jul 10, 2020
6837946
Rename spec file
sauloperez Jul 10, 2020
55d52b8
Run rubocop autocorrect on payment model
sauloperez Jul 10, 2020
cf64d3a
Merge skipped callback from decorator into model
sauloperez Jul 10, 2020
3435d5a
Fix Rubocop non-metrics issues in payment model
sauloperez Jul 10, 2020
66dbd85
Run rubocop autocorrect on payment/processing.rb
sauloperez Jul 10, 2020
42658b5
Refactor `#process!` nested ifs to guard clauses
sauloperez Jul 13, 2020
a8af3a2
Fix all but Metrics Rubocop cops in processing.rb
sauloperez Jul 13, 2020
3a64cc4
Reuse #calculate_refund_amount method
sauloperez Jul 13, 2020
70afcee
Fix Spree's spec clashing with a customization
sauloperez Jul 15, 2020
dd5e679
Address code review comments
sauloperez Jul 16, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions app/models/spree/payment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,6 @@ class Payment < ActiveRecord::Base
scope :failed, -> { with_state('failed') }
scope :valid, -> { where('state NOT IN (?)', %w(failed invalid)) }

after_rollback :persist_invalid

def persist_invalid
return unless ['failed', 'invalid'].include?(state)

state_will_change!
save
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌


# order state machine (see http://github.com/pluginaweek/state_machine/tree/master for details)
state_machine initial: :checkout do
# With card payments, happens before purchase or authorization happens
Expand Down
10 changes: 0 additions & 10 deletions app/models/spree/payment_decorator.rb

This file was deleted.