mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fix for Cybersource
This commit is contained in:
parent
f80d78c124
commit
3303c00067
@ -460,6 +460,8 @@ class PaymentController extends BaseController
|
||||
$ref = $response->getData()['m_payment_id'];
|
||||
} elseif ($accountGateway->gateway_id == GATEWAY_GOCARDLESS) {
|
||||
$ref = $response->getData()['signature'];
|
||||
} elseif ($accountGateway->gateway_id == GATEWAY_CYBERSOURCE) {
|
||||
$ref = $response->getData()['transaction_uuid'];
|
||||
} else {
|
||||
$ref = $response->getTransactionReference();
|
||||
}
|
||||
@ -551,7 +553,15 @@ class PaymentController extends BaseController
|
||||
}
|
||||
|
||||
try {
|
||||
if (method_exists($gateway, 'completePurchase')
|
||||
if ($accountGateway->isGateway(GATEWAY_CYBERSOURCE)) {
|
||||
if (Input::get('decision') == 'ACCEPT') {
|
||||
$payment = $this->paymentService->createPayment($invitation, $accountGateway, $token, $payerId);
|
||||
Session::flash('message', trans('texts.applied_payment'));
|
||||
} else {
|
||||
Session::flash('error', Input::get('message'));
|
||||
}
|
||||
return Redirect::to($invitation->getLink());
|
||||
} elseif (method_exists($gateway, 'completePurchase')
|
||||
&& !$accountGateway->isGateway(GATEWAY_TWO_CHECKOUT)
|
||||
&& !$accountGateway->isGateway(GATEWAY_CHECKOUT_COM)) {
|
||||
$details = $this->paymentService->getPaymentDetails($invitation, $accountGateway);
|
||||
@ -572,11 +582,9 @@ class PaymentController extends BaseController
|
||||
} else {
|
||||
$payment = $this->paymentService->createPayment($invitation, $accountGateway, $token, $payerId);
|
||||
Session::flash('message', trans('texts.applied_payment'));
|
||||
|
||||
return Redirect::to($invitation->getLink());
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
|
||||
$this->error('Offsite-uncaught', false, $accountGateway, $e);
|
||||
return Redirect::to($invitation->getLink());
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;
|
||||
class VerifyCsrfToken extends BaseVerifier {
|
||||
|
||||
private $openRoutes = [
|
||||
'complete',
|
||||
'signup/register',
|
||||
'api/v1/*',
|
||||
'api/v1/login',
|
||||
|
@ -42,7 +42,7 @@ Route::group(['middleware' => 'auth:client'], function() {
|
||||
Route::get('approve/{invitation_key}', 'QuoteController@approve');
|
||||
Route::get('payment/{invitation_key}/{payment_type?}', 'PaymentController@show_payment');
|
||||
Route::post('payment/{invitation_key}', 'PaymentController@do_payment');
|
||||
Route::get('complete', 'PaymentController@offsite_payment');
|
||||
Route::match(['GET', 'POST'], 'complete', 'PaymentController@offsite_payment');
|
||||
Route::get('client/quotes', 'PublicClientController@quoteIndex');
|
||||
Route::get('client/invoices', 'PublicClientController@invoiceIndex');
|
||||
Route::get('client/documents', 'PublicClientController@documentIndex');
|
||||
@ -535,6 +535,7 @@ if (!defined('CONTACT_EMAIL')) {
|
||||
define('GATEWAY_BITPAY', 42);
|
||||
define('GATEWAY_DWOLLA', 43);
|
||||
define('GATEWAY_CHECKOUT_COM', 47);
|
||||
define('GATEWAY_CYBERSOURCE', 49);
|
||||
|
||||
define('EVENT_CREATE_CLIENT', 1);
|
||||
define('EVENT_CREATE_INVOICE', 2);
|
||||
|
@ -74,6 +74,7 @@ class PaymentService extends BaseService
|
||||
|
||||
if ($input) {
|
||||
$data = self::convertInputForOmnipay($input);
|
||||
$data['email'] = $invitation->contact->email;
|
||||
Session::put($key, $data);
|
||||
} elseif (Session::get($key)) {
|
||||
$data = Session::get($key);
|
||||
|
Loading…
x
Reference in New Issue
Block a user