Class: GolfSwitch::Payment
- Inherits:
-
Object
- Object
- GolfSwitch::Payment
- Defined in:
- lib/golf_switch/payment.rb
Instance Attribute Summary collapse
-
#cc_address1 ⇒ Object
Returns the value of attribute cc_address1.
-
#cc_city ⇒ Object
Returns the value of attribute cc_city.
-
#cc_country ⇒ Object
Returns the value of attribute cc_country.
-
#cc_cvv ⇒ Object
cc_type is VI: Visa,MC: MastercardAX: American Express only.
-
#cc_email ⇒ Object
Returns the value of attribute cc_email.
-
#cc_exp_mo ⇒ Object
cc_type is VI: Visa,MC: MastercardAX: American Express only.
-
#cc_exp_yr ⇒ Object
cc_type is VI: Visa,MC: MastercardAX: American Express only.
-
#cc_name ⇒ Object
Returns the value of attribute cc_name.
-
#cc_phone ⇒ Object
Returns the value of attribute cc_phone.
-
#cc_postal_code ⇒ Object
Returns the value of attribute cc_postal_code.
-
#cc_state ⇒ Object
Returns the value of attribute cc_state.
-
#cc_type ⇒ Object
cc_type is VI: Visa,MC: MastercardAX: American Express only.
-
#pay_amount ⇒ Object
Returns the value of attribute pay_amount.
-
#pay_curr ⇒ Object
Returns the value of attribute pay_curr.
-
#pay_number ⇒ Object
cc_type is VI: Visa,MC: MastercardAX: American Express only.
-
#pay_type ⇒ Object
cc_type is VI: Visa,MC: MastercardAX: American Express only.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Payment
constructor
A new instance of Payment.
- #option_attributes ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Payment
Returns a new instance of Payment.
8 9 10 11 12 13 14 15 16 |
# File 'lib/golf_switch/payment.rb', line 8 def initialize(attributes={}) attributes.each do |name, value| begin send("#{name}=", value) rescue puts "invalid attribute #{name} in payment" end end end |
Instance Attribute Details
#cc_address1 ⇒ Object
Returns the value of attribute cc_address1.
6 7 8 |
# File 'lib/golf_switch/payment.rb', line 6 def cc_address1 @cc_address1 end |
#cc_city ⇒ Object
Returns the value of attribute cc_city.
6 7 8 |
# File 'lib/golf_switch/payment.rb', line 6 def cc_city @cc_city end |
#cc_country ⇒ Object
Returns the value of attribute cc_country.
6 7 8 |
# File 'lib/golf_switch/payment.rb', line 6 def cc_country @cc_country end |
#cc_cvv ⇒ Object
cc_type is VI: Visa,MC: MastercardAX: American Express only
5 6 7 |
# File 'lib/golf_switch/payment.rb', line 5 def cc_cvv @cc_cvv end |
#cc_email ⇒ Object
Returns the value of attribute cc_email.
6 7 8 |
# File 'lib/golf_switch/payment.rb', line 6 def cc_email @cc_email end |
#cc_exp_mo ⇒ Object
cc_type is VI: Visa,MC: MastercardAX: American Express only
5 6 7 |
# File 'lib/golf_switch/payment.rb', line 5 def cc_exp_mo @cc_exp_mo end |
#cc_exp_yr ⇒ Object
cc_type is VI: Visa,MC: MastercardAX: American Express only
5 6 7 |
# File 'lib/golf_switch/payment.rb', line 5 def cc_exp_yr @cc_exp_yr end |
#cc_name ⇒ Object
Returns the value of attribute cc_name.
6 7 8 |
# File 'lib/golf_switch/payment.rb', line 6 def cc_name @cc_name end |
#cc_phone ⇒ Object
Returns the value of attribute cc_phone.
7 8 9 |
# File 'lib/golf_switch/payment.rb', line 7 def cc_phone @cc_phone end |
#cc_postal_code ⇒ Object
Returns the value of attribute cc_postal_code.
6 7 8 |
# File 'lib/golf_switch/payment.rb', line 6 def cc_postal_code @cc_postal_code end |
#cc_state ⇒ Object
Returns the value of attribute cc_state.
6 7 8 |
# File 'lib/golf_switch/payment.rb', line 6 def cc_state @cc_state end |
#cc_type ⇒ Object
cc_type is VI: Visa,MC: MastercardAX: American Express only
5 6 7 |
# File 'lib/golf_switch/payment.rb', line 5 def cc_type @cc_type end |
#pay_amount ⇒ Object
Returns the value of attribute pay_amount.
7 8 9 |
# File 'lib/golf_switch/payment.rb', line 7 def pay_amount @pay_amount end |
#pay_curr ⇒ Object
Returns the value of attribute pay_curr.
7 8 9 |
# File 'lib/golf_switch/payment.rb', line 7 def pay_curr @pay_curr end |
#pay_number ⇒ Object
cc_type is VI: Visa,MC: MastercardAX: American Express only
5 6 7 |
# File 'lib/golf_switch/payment.rb', line 5 def pay_number @pay_number end |
#pay_type ⇒ Object
cc_type is VI: Visa,MC: MastercardAX: American Express only
5 6 7 |
# File 'lib/golf_switch/payment.rb', line 5 def pay_type @pay_type end |
Instance Method Details
#option_attributes ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/golf_switch/payment.rb', line 18 def option_attributes = {} .merge!("PayType"=>@pay_type || "CC") .merge!("CcType"=>@cc_type|| "VI") .merge!("PayNumber"=>@pay_number) .merge!("CcExpMo"=>@cc_exp_mo) .merge!("CcExpYr"=>@cc_exp_yr) .merge!("CcCVV"=>@cc_cvv) unless @cc_cvv.blank? .merge!("CcName"=>@cc_name) .merge!("CcAddress1"=>@cc_address1) .merge!("CcCity"=>@cc_city) .merge!("CcState"=>@cc_state) .merge!("CcCountry"=>@cc_country || "USA") .merge!("CcPostalCode"=>@cc_postal_code) .merge!("CcEmail"=>@cc_email) unless @cc_email.blank? .merge!("CcPhone"=>@cc_phone) unless @cc_phone.blank? .merge!("PayAmount"=>@pay_amount) .merge!("PayCurr"=>@pay_curr || "USD") end |