Class: DigiwinDsp::Resources::Invoice
- Inherits:
-
Object
- Object
- DigiwinDsp::Resources::Invoice
- Defined in:
- lib/digiwin_dsp/resources/invoice.rb
Constant Summary collapse
- PATH =
"/v1/SalesOrder/invoice"
Class Method Summary collapse
Instance Method Summary collapse
- #create(records, idempotency_key: nil, digi_header: nil) ⇒ Object
-
#initialize(client = Client.new) ⇒ Invoice
constructor
A new instance of Invoice.
Constructor Details
Class Method Details
.create(records, idempotency_key: nil, digi_header: nil) ⇒ Object
8 9 10 |
# File 'lib/digiwin_dsp/resources/invoice.rb', line 8 def self.create(records, idempotency_key: nil, digi_header: nil) new.create(records, idempotency_key: idempotency_key, digi_header: digi_header) end |
Instance Method Details
#create(records, idempotency_key: nil, digi_header: nil) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/digiwin_dsp/resources/invoice.rb', line 16 def create(records, idempotency_key: nil, digi_header: nil) body = Serializers::InvoiceSerializer.serialize(records, digi_header: digi_header) response = @client.post(PATH, body, idempotency_key: idempotency_key) response.fetch("response_detail") do raise DigiwinDsp::ServerError, "DSP returned Status=Success without response_detail" end end |