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

[RFC] Wallet & Support for non-credit card payment sources #1091

Closed
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
2b89ef8
Move common payment source specs into shared example file
jordan-brough Apr 6, 2016
0b64019
Move common code from CreditCard into PaymentSource
jordan-brough Apr 21, 2016
0e69b2e
Introduce Wallet and WalletSource classes
jordan-brough Apr 20, 2016
120c88e
Add `PaymentSource#reusable?` concept
jordan-brough Apr 21, 2016
1006405
StoreCredit temporary workaround
jordan-brough Apr 21, 2016
bc0d432
Update persist_user_credit_card for the Wallet
jordan-brough Apr 21, 2016
7d8e967
Update assign_default_credit_card for the Wallet
jordan-brough Apr 21, 2016
97141cc
Rename temporary_credit_card -> temporary_payment_source
jordan-brough Apr 21, 2016
1b7ffcf
Allow passing `wallet_source_id` instead of `existing_card_id`
jordan-brough Apr 21, 2016
e79571b
Use `wallet_source_id` instead of `existing_card` in frontend
jordan-brough Apr 21, 2016
22d528b
Deprecate existing_card and existing_card_id parameters
jordan-brough Apr 21, 2016
656eb03
Allow payment sources that don't have `belongs_to :user`
jordan-brough Apr 21, 2016
9d203b4
Migrate `CreditCard#default` to Wallet, migrate data, drop column
jordan-brough Apr 21, 2016
0ec099f
Deprecate User#payment_sources
jordan-brough Apr 21, 2016
ede74b6
Update add_after_order_complete for non-PaymentSource sources
jordan-brough May 25, 2016
1d21e16
make Spree::StoreCredit inherit from Spree::PaymentSource
peterberkenbosch Jun 1, 2016
b100e4b
Merge pull request #2 from peterberkenbosch/non-credit-card-payment-s…
jordan-brough Jun 6, 2016
dad6ab7
Fix comment text
jordan-brough Jun 22, 2016
2f6d1c4
renamed the wallet_source to wallet_payment_source
peterberkenbosch Jul 25, 2016
42b2d61
add validation for payment_source on the wallet_payment_source.
peterberkenbosch Jul 25, 2016
4cdc669
please the hound gods
peterberkenbosch Jul 26, 2016
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
Prev Previous commit
Next Next commit
make Spree::StoreCredit inherit from Spree::PaymentSource
  • Loading branch information
peterberkenbosch committed Jun 1, 2016
commit 1d21e1688ac5d131127cd67d76d63159083c3c18
8 changes: 1 addition & 7 deletions core/app/models/spree/store_credit.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# TODO: Have StoreCredit inherit from Spree::PaymentSource
class Spree::StoreCredit < Spree::Base
class Spree::StoreCredit < Spree::PaymentSource
acts_as_paranoid

VOID_ACTION = 'void'
Expand Down Expand Up @@ -40,11 +39,6 @@ class Spree::StoreCredit < Spree::Base
extend Spree::DisplayMoney
money_methods :amount, :amount_used, :amount_authorized

# TODO: Remove after StoreCredit inherits from PaymentSource
def reusable?
false
end

def amount_remaining
return 0.0.to_d if invalidated?
amount - amount_used - amount_authorized
Expand Down