diff --git a/app/Services/PaymentService.php b/app/Services/PaymentService.php index 78e6a031c1f7..66e94e43dced 100644 --- a/app/Services/PaymentService.php +++ b/app/Services/PaymentService.php @@ -273,10 +273,13 @@ class PaymentService extends BaseService // submit purchase/get response $response = $gateway->purchase($details)->send(); - $ref = $response->getTransactionReference(); - - // create payment record - return $this->createPayment($invitation, $accountGateway, $ref); + + if ($response->isSuccessful()) { + $ref = $response->getTransactionReference(); + return $this->createPayment($invitation, $accountGateway, $ref); + } else { + return false; + } } public function getDatatable($clientPublicId, $search) diff --git a/resources/views/clients/show.blade.php b/resources/views/clients/show.blade.php index e4209fdd39ee..c29fffe1df4a 100644 --- a/resources/views/clients/show.blade.php +++ b/resources/views/clients/show.blade.php @@ -22,7 +22,7 @@ @section('content')
-
+
{{ $client->getDisplayName() }} @if ($client->trashed()) @@ -30,7 +30,7 @@ @endif
-
+
{!! Former::open('clients/bulk')->addClass('mainForm') !!}