1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 08:21:34 +02:00
invoiceninja/app/Ninja/PaymentDrivers/CybersourcePaymentDriver.php
2016-07-14 22:37:04 +02:00

30 lines
662 B
PHP

<?php
namespace App\Ninja\PaymentDrivers;
/**
* Class CybersourcePaymentDriver
*/
class CybersourcePaymentDriver extends BasePaymentDriver
{
/**
* @var string
*/
protected $transactionReferenceParam = 'transaction_uuid';
/**
* @param array $input
*
* @return \App\Models\Payment|mixed
* @throws Exception
*/
public function completeOffsitePurchase(array $input)
{
if ($input['decision'] == 'ACCEPT') {
return $this->createPayment($input['bill_trans_ref_no']);
} else {
throw new Exception($input['message'] . ': ' . $input['invalid_fields']);
}
}
}