¨4.0.1¨
This commit is contained in:
@@ -2,21 +2,20 @@
|
||||
|
||||
namespace Modules\Payment\Gateways;
|
||||
|
||||
use stdClass;
|
||||
use Exception;
|
||||
use Illuminate\Http\Request;
|
||||
use Modules\Order\Entities\Order;
|
||||
use Modules\Payment\GatewayInterface;
|
||||
use Modules\Payment\Responses\FlutterwaveResponse;
|
||||
use Modules\Payment\Responses\InstamojoResponse;
|
||||
use stdClass;
|
||||
|
||||
class Flutterwave implements GatewayInterface
|
||||
{
|
||||
public const SUPPORTED_CURRENCIES = ['GBP', 'CAD', 'XAF', 'CLP', 'COP', 'EGP', 'EUR', 'GHS', 'GNF', 'KES', 'MWK', 'MAD', 'NGN', 'RWF', 'SLL', 'STD', 'ZAR', 'TZS', 'UGX', 'USD', 'XOF', 'ZMW'];
|
||||
public const PAYMENT_OPTIONS = ['credit', 'ussd', 'nqr', 'barter', 'mobilemoneyzambia', 'mobilemoneyrwanda', 'mobilemoneyuganda', 'mobilemoneyfranco', 'mobilemoneyghana', 'mpesa', 'banktransfer', 'account', 'card'];
|
||||
public $label;
|
||||
public $description;
|
||||
|
||||
public const SUPPORTED_CURRENCIES = ['GBP', 'CAD', 'XAF', 'CLP', 'COP', 'EGP', 'EUR', 'GHS', 'GNF', 'KES', 'MWK', 'MAD', 'NGN', 'RWF', 'SLL', 'STD', 'ZAR', 'TZS', 'UGX', 'USD', 'XOF', 'ZMW'];
|
||||
public const PAYMENT_OPTIONS = ['credit', 'ussd', 'nqr', 'barter', 'mobilemoneyzambia', 'mobilemoneyrwanda', 'mobilemoneyuganda', 'mobilemoneyfranco', 'mobilemoneyghana', 'mpesa', 'banktransfer', 'account', 'card'];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
@@ -24,6 +23,10 @@ class Flutterwave implements GatewayInterface
|
||||
$this->description = setting('flutterwave_description');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @throws Exception
|
||||
*/
|
||||
public function purchase(Order $order, Request $request)
|
||||
{
|
||||
if (!in_array(currency(), self::SUPPORTED_CURRENCIES)) {
|
||||
@@ -42,13 +45,15 @@ class Flutterwave implements GatewayInterface
|
||||
return new FlutterwaveResponse($order, $response);
|
||||
}
|
||||
|
||||
private function getRedirectUrl($order)
|
||||
{
|
||||
return route('checkout.complete.store', ['orderId' => $order->id, 'paymentMethod' => 'flutterwave']);
|
||||
}
|
||||
|
||||
public function complete(Order $order)
|
||||
{
|
||||
return new FlutterwaveResponse($order, request()->all());
|
||||
}
|
||||
|
||||
|
||||
private function getRedirectUrl($order)
|
||||
{
|
||||
return route('checkout.complete.store', ['orderId' => $order->id, 'paymentMethod' => 'flutterwave']);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user