Class: Sigiss::Invoice
- Inherits:
-
Object
- Object
- Sigiss::Invoice
- Includes:
- ActiveModel::Validations, Integration
- Defined in:
- lib/sigiss/invoice.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#gateway ⇒ Object
Returns the value of attribute gateway.
-
#provider ⇒ Object
Returns the value of attribute provider.
-
#response ⇒ Object
Returns the value of attribute response.
-
#success ⇒ Object
Returns the value of attribute success.
-
#taker ⇒ Object
Returns the value of attribute taker.
Instance Method Summary collapse
- #build(method, params = {}) ⇒ Object
-
#initialize(attributes = {}) ⇒ Invoice
constructor
A new instance of Invoice.
- #success? ⇒ Boolean
Methods included from Integration
#cancel!, #data_cancel, #data_fetch, #data_issue, #fetch!, #issue!
Constructor Details
#initialize(attributes = {}) ⇒ Invoice
Returns a new instance of Invoice.
12 13 14 15 16 17 18 |
# File 'lib/sigiss/invoice.rb', line 12 def initialize(attributes = {}) @gateway = attributes[:gateway] @provider = attributes[:provider] @taker = attributes[:taker] @success = false @response = {} end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
8 9 10 |
# File 'lib/sigiss/invoice.rb', line 8 def data @data end |
#gateway ⇒ Object
Returns the value of attribute gateway.
8 9 10 |
# File 'lib/sigiss/invoice.rb', line 8 def gateway @gateway end |
#provider ⇒ Object
Returns the value of attribute provider.
8 9 10 |
# File 'lib/sigiss/invoice.rb', line 8 def provider @provider end |
#response ⇒ Object
Returns the value of attribute response.
8 9 10 |
# File 'lib/sigiss/invoice.rb', line 8 def response @response end |
#success ⇒ Object
Returns the value of attribute success.
8 9 10 |
# File 'lib/sigiss/invoice.rb', line 8 def success @success end |
#taker ⇒ Object
Returns the value of attribute taker.
8 9 10 |
# File 'lib/sigiss/invoice.rb', line 8 def taker @taker end |
Instance Method Details
#build(method, params = {}) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/sigiss/invoice.rb', line 20 def build(method, params = {}) case method when :issue @data = Sigiss::IssueData.new(params) when :fetch @data = Sigiss::FetchData.new(params) when :cancel @data = Sigiss::CancelData.new(params) else @data = {} end end |
#success? ⇒ Boolean
33 34 35 |
# File 'lib/sigiss/invoice.rb', line 33 def success? @success end |