Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove payload #58

Merged
merged 4 commits into from
Oct 28, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions app/operations/transfers/to_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def initiate_transfer(payload, transfer_id)
end

if result.success?
update_transfer(transfer_id, result.value!, payload)
update_transfer(transfer_id, result.value!)
Success("Successfully transferred in account")
else
error_result = {
Expand All @@ -84,16 +84,16 @@ def initiate_transfer(payload, transfer_id)
end
end

def update_transfer(transfer_id, response, payload)
def update_transfer(transfer_id, response)
transfer = Aces::Transfer.find(transfer_id)
response_json = response.to_json
if @service == "aces"
xml = Nokogiri::XML(response.to_hash[:body])
status = xml.xpath('//tns:ResponseDescriptionText', 'tns' => 'http://hix.cms.gov/0.1/hix-core')
status_text = status.any? ? status.last.text : "N/A"
transfer.update!(response_payload: response_json, callback_status: status_text, payload: payload)
transfer.update!(response_payload: response_json, callback_status: status_text)
else
transfer.update!(response_payload: response_json, payload: payload)
transfer.update!(response_payload: response_json)
end
end

Expand Down