DeveloperBreeze

Laravel Service Class Development Tutorials, Guides & Insights

Unlock 1+ expert-curated laravel service class tutorials, real-world code snippets, and modern dev strategies. From fundamentals to advanced topics, boost your laravel service class skills on DeveloperBreeze.

Integrating and Using NMI Payment Gateway in Laravel

Tutorial August 14, 2024
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';
       }
   }

This class initializes with the NMI security key and API URL. It also determines if the application is running in production mode.