Class: MaxipagoApi::CreditCardModel
- Inherits:
-
Object
- Object
- MaxipagoApi::CreditCardModel
- Defined in:
- lib/maxipago_api/models/credit_card_model.rb
Instance Attribute Summary collapse
-
#billing_address1 ⇒ Object
Returns the value of attribute billing_address1.
-
#billing_address2 ⇒ Object
Returns the value of attribute billing_address2.
-
#billing_city ⇒ Object
Returns the value of attribute billing_city.
-
#billing_country ⇒ Object
Returns the value of attribute billing_country.
-
#billing_email ⇒ Object
Returns the value of attribute billing_email.
-
#billing_name ⇒ Object
Returns the value of attribute billing_name.
-
#billing_phone ⇒ Object
Returns the value of attribute billing_phone.
-
#billing_state ⇒ Object
Returns the value of attribute billing_state.
-
#billing_zipcode ⇒ Object
Returns the value of attribute billing_zipcode.
-
#credit_card_number ⇒ Object
Returns the value of attribute credit_card_number.
-
#customer_id ⇒ Object
Returns the value of attribute customer_id.
-
#expiration_month ⇒ Object
Returns the value of attribute expiration_month.
-
#expiration_year ⇒ Object
Returns the value of attribute expiration_year.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ CreditCardModel
constructor
A new instance of CreditCardModel.
- #save ⇒ Object
- #to_object ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ CreditCardModel
Returns a new instance of CreditCardModel.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/maxipago_api/models/credit_card_model.rb', line 9 def initialize( = {}) self.customer_id = [:customer_id] self.credit_card_number = [:credit_card_number] self.expiration_month = [:expiration_month] self.expiration_year = [:expiration_year] self.billing_name = [:billing_name] self.billing_address1 = [:billing_address1] self.billing_address2 = [:billing_address2] self.billing_city = [:billing_city] self.billing_state = [:billing_state] self.billing_zipcode = [:billing_zipcode] self.billing_country = [:billing_country] self.billing_phone = [:billing_phone] self.billing_email = [:billing_email] end |
Instance Attribute Details
#billing_address1 ⇒ Object
Returns the value of attribute billing_address1.
4 5 6 |
# File 'lib/maxipago_api/models/credit_card_model.rb', line 4 def billing_address1 @billing_address1 end |
#billing_address2 ⇒ Object
Returns the value of attribute billing_address2.
4 5 6 |
# File 'lib/maxipago_api/models/credit_card_model.rb', line 4 def billing_address2 @billing_address2 end |
#billing_city ⇒ Object
Returns the value of attribute billing_city.
4 5 6 |
# File 'lib/maxipago_api/models/credit_card_model.rb', line 4 def billing_city @billing_city end |
#billing_country ⇒ Object
Returns the value of attribute billing_country.
4 5 6 |
# File 'lib/maxipago_api/models/credit_card_model.rb', line 4 def billing_country @billing_country end |
#billing_email ⇒ Object
Returns the value of attribute billing_email.
4 5 6 |
# File 'lib/maxipago_api/models/credit_card_model.rb', line 4 def billing_email @billing_email end |
#billing_name ⇒ Object
Returns the value of attribute billing_name.
4 5 6 |
# File 'lib/maxipago_api/models/credit_card_model.rb', line 4 def billing_name @billing_name end |
#billing_phone ⇒ Object
Returns the value of attribute billing_phone.
4 5 6 |
# File 'lib/maxipago_api/models/credit_card_model.rb', line 4 def billing_phone @billing_phone end |
#billing_state ⇒ Object
Returns the value of attribute billing_state.
4 5 6 |
# File 'lib/maxipago_api/models/credit_card_model.rb', line 4 def billing_state @billing_state end |
#billing_zipcode ⇒ Object
Returns the value of attribute billing_zipcode.
4 5 6 |
# File 'lib/maxipago_api/models/credit_card_model.rb', line 4 def billing_zipcode @billing_zipcode end |
#credit_card_number ⇒ Object
Returns the value of attribute credit_card_number.
4 5 6 |
# File 'lib/maxipago_api/models/credit_card_model.rb', line 4 def credit_card_number @credit_card_number end |
#customer_id ⇒ Object
Returns the value of attribute customer_id.
4 5 6 |
# File 'lib/maxipago_api/models/credit_card_model.rb', line 4 def customer_id @customer_id end |
#expiration_month ⇒ Object
Returns the value of attribute expiration_month.
4 5 6 |
# File 'lib/maxipago_api/models/credit_card_model.rb', line 4 def expiration_month @expiration_month end |
#expiration_year ⇒ Object
Returns the value of attribute expiration_year.
4 5 6 |
# File 'lib/maxipago_api/models/credit_card_model.rb', line 4 def expiration_year @expiration_year end |
Instance Method Details
#save ⇒ Object
25 26 27 |
# File 'lib/maxipago_api/models/credit_card_model.rb', line 25 def save MaxipagoApi::CreditCardRequest.save(self) end |
#to_object ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/maxipago_api/models/credit_card_model.rb', line 29 def to_object { customerId: self.customer_id, creditCardNumber: self.credit_card_number, expirationMonth: self.expiration_month, expirationYear: self.expiration_year, billingName: self.billing_name, billingAddress1: self.billing_address1, billingAddress2: self.billing_address2, billingCity: self.billing_city, billingState: self.billing_state, billingZip: self.billing_zipcode, billingCountry: self.billing_country, billingPhone: self.billing_phone, billingEmail: self.billing_email, }.select{|k,v| v.present?} end |