Fix for cancelled mollie payments
This commit is contained in:
parent
38ef857c14
commit
e4929c1008
1 changed files with 8 additions and 0 deletions
|
|
@ -1,5 +1,7 @@
|
|||
<?php namespace App\Ninja\PaymentDrivers;
|
||||
|
||||
use Exception;
|
||||
|
||||
class MolliePaymentDriver extends BasePaymentDriver
|
||||
{
|
||||
public function completeOffsitePurchase($input)
|
||||
|
|
@ -10,6 +12,12 @@ class MolliePaymentDriver extends BasePaymentDriver
|
|||
|
||||
$response = $this->gateway()->fetchTransaction($details)->send();
|
||||
|
||||
if ($response->isCancelled()) {
|
||||
return false;
|
||||
} elseif ( ! $response->isSuccessful()) {
|
||||
throw new Exception($response->getMessage());
|
||||
}
|
||||
|
||||
return $this->createPayment($response->getTransactionReference());
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue