1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 08:21:34 +02:00
invoiceninja/app/Ninja/PaymentDrivers/MolliePaymentDriver.php
2016-08-11 13:17:01 +03:00

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());
}
}