Class: Cielo::API30::Sale
- Inherits:
-
Object
- Object
- Cielo::API30::Sale
- Defined in:
- lib/cielo/api30/sale.rb
Instance Attribute Summary collapse
-
#customer ⇒ Object
Returns the value of attribute customer.
-
#merchant_order_id ⇒ Object
Returns the value of attribute merchant_order_id.
-
#payment ⇒ Object
Returns the value of attribute payment.
Class Method Summary collapse
Instance Method Summary collapse
- #as_json(options = {}) ⇒ Object
-
#initialize(merchant_order_id) ⇒ Sale
constructor
A new instance of Sale.
- #to_json(*options) ⇒ Object
Constructor Details
#initialize(merchant_order_id) ⇒ Sale
Returns a new instance of Sale.
8 9 10 |
# File 'lib/cielo/api30/sale.rb', line 8 def initialize(merchant_order_id) @merchant_order_id = merchant_order_id end |
Instance Attribute Details
#customer ⇒ Object
Returns the value of attribute customer.
4 5 6 |
# File 'lib/cielo/api30/sale.rb', line 4 def customer @customer end |
#merchant_order_id ⇒ Object
Returns the value of attribute merchant_order_id.
4 5 6 |
# File 'lib/cielo/api30/sale.rb', line 4 def merchant_order_id @merchant_order_id end |
#payment ⇒ Object
Returns the value of attribute payment.
4 5 6 |
# File 'lib/cielo/api30/sale.rb', line 4 def payment @payment end |
Class Method Details
Instance Method Details
#as_json(options = {}) ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/cielo/api30/sale.rb', line 27 def as_json(={}) { MerchantOrderId: @merchant_order_id, Customer: @customer, Payment: @payment } end |
#to_json(*options) ⇒ Object
12 13 14 15 16 |
# File 'lib/cielo/api30/sale.rb', line 12 def to_json(*) hash = as_json(*) hash.reject! {|k,v| v.nil?} hash.to_json(*) end |