Class: SallieMaeGateway::Payment
- Inherits:
-
Object
- Object
- SallieMaeGateway::Payment
- Defined in:
- app/models/sallie_mae_gateway/payment.rb
Instance Attribute Summary collapse
-
#allow_edit ⇒ Object
Returns the value of attribute allow_edit.
-
#cancel_url ⇒ Object
Returns the value of attribute cancel_url.
-
#finish_url ⇒ Object
Returns the value of attribute finish_url.
-
#line_items ⇒ Object
Returns the value of attribute line_items.
-
#payment_type ⇒ Object
Returns the value of attribute payment_type.
-
#postback_url ⇒ Object
Returns the value of attribute postback_url.
-
#school_id ⇒ Object
Returns the value of attribute school_id.
-
#student ⇒ Object
Returns the value of attribute student.
-
#user_def1 ⇒ Object
Returns the value of attribute user_def1.
-
#user_def2 ⇒ Object
Returns the value of attribute user_def2.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Payment
constructor
A new instance of Payment.
- #total_amount ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ Payment
Returns a new instance of Payment.
8 9 10 11 12 13 14 15 16 17 |
# File 'app/models/sallie_mae_gateway/payment.rb', line 8 def initialize(args={}) if args.is_a? Hash args[:allow_edit] ||= false args[:payment_type] ||= CREDIT_CARD args.each { |key, value| instance_variable_set "@#{key}", value } end @line_items ||= [] end |
Instance Attribute Details
#allow_edit ⇒ Object
Returns the value of attribute allow_edit.
6 7 8 |
# File 'app/models/sallie_mae_gateway/payment.rb', line 6 def allow_edit @allow_edit end |
#cancel_url ⇒ Object
Returns the value of attribute cancel_url.
6 7 8 |
# File 'app/models/sallie_mae_gateway/payment.rb', line 6 def cancel_url @cancel_url end |
#finish_url ⇒ Object
Returns the value of attribute finish_url.
6 7 8 |
# File 'app/models/sallie_mae_gateway/payment.rb', line 6 def finish_url @finish_url end |
#line_items ⇒ Object
Returns the value of attribute line_items.
5 6 7 |
# File 'app/models/sallie_mae_gateway/payment.rb', line 5 def line_items @line_items end |
#payment_type ⇒ Object
Returns the value of attribute payment_type.
6 7 8 |
# File 'app/models/sallie_mae_gateway/payment.rb', line 6 def payment_type @payment_type end |
#postback_url ⇒ Object
Returns the value of attribute postback_url.
6 7 8 |
# File 'app/models/sallie_mae_gateway/payment.rb', line 6 def postback_url @postback_url end |
#school_id ⇒ Object
Returns the value of attribute school_id.
6 7 8 |
# File 'app/models/sallie_mae_gateway/payment.rb', line 6 def school_id @school_id end |
#student ⇒ Object
Returns the value of attribute student.
5 6 7 |
# File 'app/models/sallie_mae_gateway/payment.rb', line 5 def student @student end |
#user_def1 ⇒ Object
Returns the value of attribute user_def1.
6 7 8 |
# File 'app/models/sallie_mae_gateway/payment.rb', line 6 def user_def1 @user_def1 end |
#user_def2 ⇒ Object
Returns the value of attribute user_def2.
6 7 8 |
# File 'app/models/sallie_mae_gateway/payment.rb', line 6 def user_def2 @user_def2 end |
Instance Method Details
#total_amount ⇒ Object
35 36 37 |
# File 'app/models/sallie_mae_gateway/payment.rb', line 35 def total_amount @line_items.reduce(0.0) { |sum, item| sum += item.amount } end |