Update modMpesapay.class.php
Signed-off-by: kevinowino869 <kevinowino869@www.codelab.nestict.africa>
This commit is contained in:
parent
0b2f411c8b
commit
99d93bf68a
@ -1,23 +1,43 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Dolibarr M-Pesa Payment Module
|
* Dolibarr Module Descriptor for M-Pesa Payment
|
||||||
* Author: NESTICT INFOTECH
|
* Author: NESTICT INFOTECH
|
||||||
* Version: 1.0.0
|
* Version: 1.0.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT . "/core/modules/DolibarrModules.class.php";
|
include_once DOL_DOCUMENT_ROOT . "/core/modules/DolibarrModules.class.php";
|
||||||
|
|
||||||
class modMpesapay extends DolibarrModules
|
class modMpesapay extends DolibarrModules
|
||||||
{
|
{
|
||||||
function __construct($db)
|
function __construct($db)
|
||||||
{
|
{
|
||||||
|
global $langs, $conf;
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
|
|
||||||
$this->numero = 104900;
|
$this->numero = 104900;
|
||||||
$this->rights_class = 'mpesapay';
|
$this->rights_class = 'mpesapay';
|
||||||
$this->family = 'payment';
|
$this->family = 'payment';
|
||||||
$this->name = "M-Pesa Payment Module";
|
$this->name = "M-Pesa Payment Module";
|
||||||
$this->description = "Accept M-Pesa payments in Dolibarr.";
|
$this->description = "Accept M-Pesa payments in Dolibarr.";
|
||||||
$this->version = '1.0.0';
|
$this->version = '1.0.0';
|
||||||
|
|
||||||
|
$this->const = array(
|
||||||
|
array('MPESAPAY_PAYBILL', 'chaine', '', 'M-Pesa Paybill Number', 0, 'current', 1),
|
||||||
|
array('MPESAPAY_PASSKEY', 'chaine', '', 'M-Pesa Passkey', 0, 'current', 1)
|
||||||
|
);
|
||||||
|
|
||||||
$this->module_parts = array('hooks' => array('invoicecard', 'payment'));
|
$this->module_parts = array('hooks' => array('invoicecard', 'payment'));
|
||||||
|
|
||||||
|
$this->config_page_url = "mpesapay_setup.php";
|
||||||
|
$this->dirs = array('/mpesapay');
|
||||||
|
$this->picto = 'payment';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Generate Payment URL
|
||||||
|
function generatePaymentUrl($invoiceId)
|
||||||
|
{
|
||||||
|
$token = base64_encode(hash('sha256', $invoiceId . time()));
|
||||||
|
return DOL_URL_ROOT . "/custom/mpesapay/payment.php?invoice_id={$invoiceId}&token={$token}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user