From c130e67e547f9748d42ec732858ac8fd042ee074 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 2 Nov 2015 11:47:47 +0200 Subject: [PATCH] Fixed problem with PayFast integration --- app/Http/Controllers/PaymentController.php | 6 +++++- app/Http/routes.php | 1 + composer.json | 2 +- composer.lock | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/PaymentController.php b/app/Http/Controllers/PaymentController.php index e7613ed9e8..54543ca4fb 100644 --- a/app/Http/Controllers/PaymentController.php +++ b/app/Http/Controllers/PaymentController.php @@ -182,7 +182,9 @@ class PaymentController extends BaseController // Handle offsite payments if ($useToken || $paymentType != PAYMENT_TYPE_CREDIT_CARD - || $gateway->id == GATEWAY_EWAY || $gateway->id == GATEWAY_TWO_CHECKOUT) { + || $gateway->id == GATEWAY_EWAY + || $gateway->id == GATEWAY_TWO_CHECKOUT + || $gateway->id == GATEWAY_PAYFAST) { if (Session::has('error')) { Session::reflash(); return Redirect::to('view/'.$invitationKey); @@ -449,6 +451,8 @@ class PaymentController extends BaseController $ref = $response->getData()['AccessCode']; } elseif ($accountGateway->gateway_id == GATEWAY_TWO_CHECKOUT) { $ref = $response->getData()['cart_order_id']; + } elseif ($accountGateway->gateway_id == GATEWAY_PAYFAST) { + $ref = $response->getData()['m_payment_id']; } else { $ref = $response->getTransactionReference(); } diff --git a/app/Http/routes.php b/app/Http/routes.php index 8fcc3cddba..859fbaa6be 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -382,6 +382,7 @@ if (!defined('CONTACT_EMAIL')) { define('GATEWAY_AUTHORIZE_NET', 1); define('GATEWAY_EWAY', 4); define('GATEWAY_AUTHORIZE_NET_SIM', 2); + define('GATEWAY_PAYFAST', 13); define('GATEWAY_PAYPAL_EXPRESS', 17); define('GATEWAY_PAYPAL_PRO', 18); define('GATEWAY_STRIPE', 23); diff --git a/composer.json b/composer.json index b6de39bb76..9aa0fe14ea 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ "anahkiasen/former": "4.0.*@dev", "barryvdh/laravel-debugbar": "~2.0.2", "chumper/datatable": "dev-develop#7fa47cb", - "omnipay/omnipay": "2.3.x", + "omnipay/omnipay": "~2.3.0", "intervention/image": "dev-master", "webpatser/laravel-countries": "dev-master", "barryvdh/laravel-ide-helper": "2.0.x", diff --git a/composer.lock b/composer.lock index bd15b6e3aa..876a30f371 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "70ef9e09bca60a19c396c138d8a01d50", + "hash": "d0f3825f6d361f655c7393dd024b676e", "packages": [ { "name": "alfaproject/omnipay-neteller",