Class: EInvoice::Invoice
- Inherits:
-
Object
- Object
- EInvoice::Invoice
- Defined in:
- lib/e_invoice/invoice.rb
Instance Attribute Summary collapse
-
#response_body ⇒ Object
readonly
Returns the value of attribute response_body.
Instance Method Summary collapse
- #basic_params ⇒ Object
-
#initialize(payload) ⇒ Invoice
constructor
A new instance of Invoice.
- #response_code ⇒ Object
Constructor Details
#initialize(payload) ⇒ Invoice
5 6 7 |
# File 'lib/e_invoice/invoice.rb', line 5 def initialize(payload) @payload = payload end |
Instance Attribute Details
#response_body ⇒ Object (readonly)
Returns the value of attribute response_body.
3 4 5 |
# File 'lib/e_invoice/invoice.rb', line 3 def response_body @response_body end |
Instance Method Details
#basic_params ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/e_invoice/invoice.rb', line 13 def basic_params { version: EInvoice::VERSION, expTimeStamp: EInvoice::EXPIRATION_TIMESTAMP, timeStamp: Time.now.to_i + 10, uuid: EInvoice::UUID, appID: EInvoice::APPID, cardNo: @payload.serial, cardEncrypt: @payload.encrypt, cardType: @payload.type } end |
#response_code ⇒ Object
9 10 11 |
# File 'lib/e_invoice/invoice.rb', line 9 def response_code @response_body["code"] end |