This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| in callhandlerv1#top_up_card | |
| return result.fail_with("Credit Account is frozen") if @card.credit_account.frozen_credit? | |
| in call_handler_top_up_test | |
| context "with frozen credit" do | |
| setup do | |
| @card.credit_account.freeze_credit! | |
| @result = CallHandler.top_up_card(:version => :v1, :account_number => @card_with_topup.pan, :transaction_amount => @transaction_amount, :available_balance => 488.00, :ip_address => "127.0.0.01") | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @addon_products = @card.person.account_addon_products.map{|product| product.type.to_s } | |
| in view: | |
| %td.cardholder-product | |
| - @addon_products.each do |addon_product| | |
| = addon_product |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| context "views an individual card" do | |
| setup do | |
| FakeDataLoader.clear_tables | |
| FakeDataLoader.bootstrap!(1) | |
| @pan = "1111222233334444" | |
| @card = Card.find_by_pan(@pan) | |
| get :show, :id => @card.id | |
| end | |
| context "that was sold cross-store" do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| a/app/models/card.rb | |
| +++ b/app/models/card.rb | |
| @@ -66,9 +66,17 @@ class Card < ActiveRecord::Base | |
| end | |
| else | |
| #FIXME logic for Personalized cards | |
| + if (self.balance + amount) <= max_balance | |
| + if (self.card_load_transactions.for_today.sum(:amount) <= max_daily_loads) | |
| + return true | |
| + else |
NewerOlder