Create a new file in the app/Services
directory named NMI.php
.
namespace App\Services;
use Illuminate\Support\Facades\Http;
class NMI
{
protected $securityKey, $url;
protected $production;
public function __construct()
{
$this->production = env('APP_ENV') === 'production';
$this->securityKey = config('nmi.security_key');
$this->url = 'https://secure.nmi.com/api/transact.php';
}
}