Skip to content

Commit

Permalink
import donations
Browse files Browse the repository at this point in the history
  • Loading branch information
gheorghelupu17 committed Dec 3, 2023
1 parent 0f16489 commit 1b6926c
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions app/Console/Commands/Import/ImportDonationsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ public function handle(): int
'organization_id' => (int) $row->ONGId,
'amount' => (float) $row->Amount,
'charge_amount' => (float) $row->ChargedAmount,
'first_name' => $row->FirstName??'',
'last_name' => $row->LastName??'',
'email' => $row->Email??'',
'first_name' => $row->FirstName ?? '',
'last_name' => $row->LastName ?? '',
'email' => $row->Email ?? '',
'card_holder_status_message' => $row->CaldHolderStatusMessage,
'created_at' => $created_at,
'approval_date' => Carbon::parse(Str::replace(':AM','',$row->ApprovedDate)),
'charge_date' => Carbon::parse(Str::replace(':AM','',$row->ChargedDate)),
'approval_date' => Carbon::parse(Str::replace(':AM', '', $row->ApprovedDate)),
'charge_date' => Carbon::parse(Str::replace(':AM', '', $row->ChargedDate)),
'updated_without_correct_e_pid' => (bool) $row->UpdatedWithoutCorrectEpId,
'status' => match ($row->DonationStatusTypeId) {
1 => EuPlatescStatus::INITIALIZE,
Expand All @@ -83,12 +83,8 @@ public function handle(): int
default => throw new \Exception('Invalid status: ' . $row->Status),
},




]
);

} catch (Throwable $th) {
$this->logError('Error importing donation #' . $row->Id, [$th->getMessage()]);
}
Expand Down

0 comments on commit 1b6926c

Please sign in to comment.