Class: CloudPayments::Namespaces::Kassa

Inherits:
Base
  • Object
show all
Defined in:
lib/cloud_payments/namespaces/kassa.rb

Constant Summary collapse

InnNotProvided =
Class.new(StandardError)
TypeNotProvided =
Class.new(StandardError)
CustomerReceiptNotProvided =
Class.new(StandardError)

Instance Attribute Summary

Attributes inherited from Base

#client, #parent_path

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#initialize, #request

Constructor Details

This class inherits a constructor from CloudPayments::Namespaces::Base

Class Method Details

.resource_nameObject



9
10
11
# File 'lib/cloud_payments/namespaces/kassa.rb', line 9

def self.resource_name
  'kkt'
end

Instance Method Details

#receipt(attributes) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/cloud_payments/namespaces/kassa.rb', line 13

def receipt(attributes)
  attributes.fetch(:inn)  { raise InnNotProvided.new('inn attribute is required') }
  attributes.fetch(:type) { raise TypeNotProvided.new('type attribute is required') }
  attributes.fetch(:customer_receipt)  { raise CustomerReceiptNotProvided.new('customer_receipt is required') }

  request(:receipt, attributes)
end