Skip to content

Commit bc93a5b

Browse files
updated message
1 parent 64626b8 commit bc93a5b

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

app/services/notify.rb

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,28 +39,26 @@ def self.call(response:)
3939
parsed_response[:invoice_number_collection] = notifier.invoice_numbers_from_multi_payment(invoice)
4040

4141
notifier.put_request(direction: 'services', path: url, params: parsed_response)
42-
rescue Net::ReadTimeout => e
43-
Rails.logger.error "Timeout error: #{e}. path: #{url}, params: #{parsed_response}, class: Notify, method: call"
4442
rescue StandardError => e
4543
Rails.logger.error e
46-
notifier.notify(title: 'Error occur in callback handler', error_message: "Error message #{e}")
44+
notifier.notify(title: 'Error occur in callback handler', error_message: "Error message #{e}. path: #{url}, params: #{parsed_response}, class: Notify, method: call")
4745
end
4846

4947
def define_for_deposit(invoice, url)
5048
attributes = invoice.description.split(',')
5149
domain_name, user_uuid, user_email = attributes.map { |attr| attr.split(' ')[1] }
5250

5351
params = {
54-
domain_name: domain_name,
55-
user_uuid: user_uuid,
56-
user_email: user_email,
52+
domain_name:,
53+
user_uuid:,
54+
user_email:,
5755
transaction_amount: invoice.transaction_amount.to_f,
5856
invoice_number: invoice.invoice_number,
5957
description: 'deposit',
6058
affiliation: 1
6159
}
6260

63-
put_request(direction: 'services', path: url, params: params)
61+
put_request(direction: 'services', path: url, params:)
6462
end
6563

6664
def notify(title:, error_message:)
@@ -73,7 +71,7 @@ def update_invoice_state(parsed_response:, invoice:)
7371
status = parsed_response[:payment_state] == SETTLED ? :paid : :failed
7472

7573
invoice.update(payment_reference: parsed_response[:payment_reference],
76-
status: status,
74+
status:,
7775
transaction_time: parsed_response[:transaction_time],
7876
everypay_response: parsed_response)
7977
end
@@ -93,7 +91,7 @@ def invoice_numbers_from_multi_payment(invoice)
9391
end
9492

9593
def set_description_for_multiple_payment(parent_invoice:, invoice_number:)
96-
invoice = Invoice.find_by(invoice_number: invoice_number)
94+
invoice = Invoice.find_by(invoice_number:)
9795

9896
invoice.payment_reference = parent_invoice.payment_reference
9997
invoice.status = parent_invoice.status

0 commit comments

Comments
 (0)