mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
25 lines
646 B
PHP
25 lines
646 B
PHP
<?php namespace App\Ninja\PaymentDrivers;
|
|
|
|
use Exception;
|
|
|
|
class MolliePaymentDriver extends BasePaymentDriver
|
|
{
|
|
public function completeOffsitePurchase($input)
|
|
{
|
|
$details = $this->paymentDetails();
|
|
|
|
$details['transactionReference'] = $this->invitation->transaction_reference;
|
|
|
|
$response = $this->gateway()->fetchTransaction($details)->send();
|
|
|
|
if ($response->isCancelled()) {
|
|
return false;
|
|
} elseif ( ! $response->isSuccessful()) {
|
|
throw new Exception($response->getMessage());
|
|
}
|
|
|
|
return $this->createPayment($response->getTransactionReference());
|
|
}
|
|
|
|
}
|