From a95106b245857832f0310651bcdae14dc274694e Mon Sep 17 00:00:00 2001 From: Cory McDonald Date: Wed, 18 Sep 2019 17:54:33 -0500 Subject: [PATCH] Fix the manual report json (#2236) --- .../manual_payout_report_json_builder.rb | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/app/models/json_builders/manual_payout_report_json_builder.rb b/app/models/json_builders/manual_payout_report_json_builder.rb index fb52f8fe15..ff90405a87 100644 --- a/app/models/json_builders/manual_payout_report_json_builder.rb +++ b/app/models/json_builders/manual_payout_report_json_builder.rb @@ -6,19 +6,22 @@ def initialize(payout_report:) def build contents = [] @payout_report.potential_payments.to_be_paid.where(kind: PotentialPayment::MANUAL).find_each do |potential_payment| + publisher = Publisher.find(potential_payment.publisher_id).owner_identifier + contents.push( { - "name" => potential_payment.name.to_s, - "altcurrency" => "BAT", - "probi" => potential_payment.amount.to_s, - "fees" => potential_payment.fees.to_s, - "authority" => Publisher.find(potential_payment.finalized_by_id).email, - "transactionId" => potential_payment.payout_report_id.to_s, - "owner" => Publisher.find(potential_payment.publisher_id).owner_identifier.to_s, - "type" => PotentialPayment::MANUAL, - "address" => potential_payment.address.to_s, - "upholdId" => potential_payment.uphold_id.to_s, - "documentId" => potential_payment.invoice_id.to_s, + name: potential_payment.name, + altcurrency: "BAT", + probi: potential_payment.amount.to_s, + fees: potential_payment.fees.to_s, + authority: Publisher.find(potential_payment.finalized_by_id).email, + transactionId: potential_payment.payout_report_id, + owner: publisher, + publisher: publisher, + type: PotentialPayment::MANUAL, + address: potential_payment.address, + upholdId: potential_payment.uphold_id, + documentId: potential_payment.invoice_id, } ) end