DeveloperBreeze

Tutorials Programming Tutorials, Guides & Best Practices

Explore 149+ expertly crafted tutorials tutorials, components, and code examples. Stay productive and build faster with proven implementation strategies and design patterns from 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.