MOON
Server: Apache
System: Linux server.royaltuning.hu 4.18.0-425.13.1.el8_7.x86_64 #1 SMP Tue Feb 21 04:20:52 EST 2023 x86_64
User: royaltuning (1001)
PHP: 8.2.32
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //var/www/html/Modules/Payment/Gateways/Paystack.php
<?php

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\InstamojoResponse;
use Modules\Payment\Responses\PaystackResponse;

class Paystack implements GatewayInterface
{
    public $label;
    public $description;

    const SUPPORTED_CURRENCIES = ['NGN', 'GHS', 'USD', 'ZAR'];

    public function __construct()
    {
        $this->label = setting('paystack_label');
        $this->description = setting('paystack_description');
    }

    public function purchase(Order $order, Request $request)
    {
        if (!in_array(currency(), self::SUPPORTED_CURRENCIES)) {
            throw new Exception(trans('payment::messages.currency_not_supported'));
        }

        return new PaystackResponse($order, $request);
    }

    public function complete(Order $order)
    {
        return new PaystackResponse($order, request());
    }
}