lib/atol/request/post_document/sell/body.rb in atol-0.4.1 vs lib/atol/request/post_document/sell/body.rb in atol-0.4.2
- old
+ new
@@ -27,12 +27,12 @@
private
def body
@body ||= body_template.tap do |result|
result[:external_id] = @external_id
- result[:receipt][:attributes][:email] = @email unless @email.empty?
- result[:receipt][:attributes][:phone] = @phone unless @phone.empty?
+ result[:receipt][:client][:email] = @email unless @email.empty?
+ result[:receipt][:client][:phone] = @phone unless @phone.empty?
result[:service][:callback_url] = @config.callback_url if @config.callback_url
total = @items.inject(0) { |sum, item| sum += item[:sum] }
result[:receipt][:total] = total
@@ -42,24 +42,25 @@
end
def body_template
{
receipt: {
- attributes: {
- sno: @config.default_sno
+ client: {},
+ company: {
+ inn: @config.inn.to_s,
+ sno: @config.default_sno,
+ payment_address: @config.payment_address,
+ email: @config.company_email
},
items: [],
payments: [
{
sum: 0,
type: @config.default_payment_type
}
]
},
- service: {
- inn: @config.inn.to_s,
- payment_address: @config.payment_address
- },
+ service: {},
timestamp: Time.now.strftime(Atol::TIMESTAMP_FORMAT)
}
end
end
end