ryanmitchell
Yeah,
I have already extended a custom payment gateway with Payregister extension and that is working fine.
but i would like to create this as separate extension.
i have created the extension using artisan command:
php artisan create:extension techindu.customgateway
and Extension.php
<?php namespace Techindu\Customgateway;
use System\Classes\BaseExtension;
/**
* razorpay Extension Information File
*/
class Extension extends BaseExtension
{
public function registerPaymentGateways()
{
return [
'Techindu\Customgateway\Payments\Customgateway' => [
'code' => 'customgateway',
'name' => 'lang:techindu.customgateway::default.customgateway.text_payment_title',
'description' => 'lang:techindu.customgateway::default.customgateway.text_payment_desc',
],
];
}
/**
* Returns information about this extension.
*
* @return array
*/
public function extensionMeta()
{
return [
"name" => "Custom Gateway",
"author" => "YourSantu",
"description" => "Custom Gateway extension. An Indian Payment Gateway.",
"icon" => [
"class" => "fa fa-cash-register",
"backgroundColor" => "#3596da",
"color" => "#FFFFFF"
],
"version" => "1.2.2",
"require" => [
"igniter.payregister" => "*"
]
];
}
/**
* Register method, called when the extension is first registered.
*
* @return void
*/
public function register()
{
}
/**
* Boot method, called right before the request route.
*
* @return void
*/
public function boot()
{
}
}
Folder structure:
techindu
└── customgateway
├── assets
│ └── customgateway.js
├── composer.json
├── composer.lock
├── extension.json
├── Extension.php
├── language
│ └── en
│ └── default.php
├── payments
│ ├── customgateway
│ │ ├── fields.php
│ │ └── payment_form.blade.php
│ └── Customgateway.php
└── vendor