Skip to content

Commit

Permalink
fixed Monnify payment status and verification
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenjude committed May 9, 2024
1 parent b93f7a3 commit 230ac53
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Providers/MonnifyProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function initializeCheckout(array $parameters = []): SessionData
return Cache::remember(
key: $parameters['session_cache_key'],
ttl: $parameters['expires'],
callback: fn () => new SessionData(
callback: fn() => new SessionData(
provider: $this->provider,
sessionReference: $parameters['reference'],
paymentReference: $monnify['responseBody']['transactionReference'],
Expand Down Expand Up @@ -110,7 +110,7 @@ public function listTransactions(
'page_count' => Arr::get($response, 'responseBody.pageable.totalPages'),
],
'data' => collect(Arr::get($response, 'responseBody.content'))
->map(fn ($transaction) => $this->transactionDTO($transaction))
->map(fn($transaction) => $this->transactionDTO($transaction))
->toArray(),
];
}
Expand All @@ -125,7 +125,7 @@ public function transactionDTO(array $transaction): TransactionData
reference: $transaction['paymentReference'],
provider: $this->provider,
status: $transaction['paymentStatus'],
date: Carbon::parse($transaction['completedOn'])->toDateTimeString(),
date: Carbon::parse(Arr::get($transaction, 'completedOn', now()->toDateTimeString()))->toDateTimeString(),
);
}
}

0 comments on commit 230ac53

Please sign in to comment.