Class: DigiwinDsp::Resources::Cancellation
- Inherits:
-
Object
- Object
- DigiwinDsp::Resources::Cancellation
- Defined in:
- lib/digiwin_dsp/resources/cancellation.rb
Constant Summary collapse
- PATH =
"/v1/SalesOrder/cancel"
Class Method Summary collapse
Instance Method Summary collapse
- #create(records, idempotency_key: nil, digi_header: nil) ⇒ Object
-
#initialize(client = Client.new) ⇒ Cancellation
constructor
A new instance of Cancellation.
Constructor Details
#initialize(client = Client.new) ⇒ Cancellation
Returns a new instance of Cancellation.
12 13 14 |
# File 'lib/digiwin_dsp/resources/cancellation.rb', line 12 def initialize(client = Client.new) @client = client end |
Class Method Details
.create(records) ⇒ Object
8 9 10 |
# File 'lib/digiwin_dsp/resources/cancellation.rb', line 8 def self.create(records, **) new.create(records, **) end |
Instance Method Details
#create(records, idempotency_key: nil, digi_header: nil) ⇒ Object
16 17 18 19 20 |
# File 'lib/digiwin_dsp/resources/cancellation.rb', line 16 def create(records, idempotency_key: nil, digi_header: nil) body = Serializers::CancellationSerializer.serialize(records, digi_header: digi_header) response = @client.post(PATH, body, idempotency_key: idempotency_key) response["response_detail"] end |