Jump to content

I can't load amodule


Recommended Posts

Hello

I built a payment module, kept getting the following errors when i try to load it.

The following module(s) could not be loaded::
  1. diamondwebpay (parse error in /modules/diamondwebpay/diamondwebpay.php)
  2. diamondwebpay (class missing in /modules/diamondwebpay/diamondwebpay.php)

Please help me out. I'm using prestashop 1.5 and this is a copy of my code:

 

<?php
if (!defined('_PS_VERSION_'))
  exit;
 
class diamondwebpay extends Module
{
  public function __construct()
  {
    $this->name = 'diamondwebpay';
    $this->tab = 'payments_gateways';
    $this->version = '1.0';
    $this->author = 'Ayodeji Olumofe';
    $this->need_instance = 0;
    $this->ps_versions_compliancy = array('min' => '1.5', 'max' => '1.6');
 
    parent::__construct();//The parent construct is required for translations
 
    $this->displayName = $this->l('diamondwebpay');
    $this->description = $this->l('add diamondwebpay payment gateway to your shop.');
}
 
    function install()
{
if (!parent::install()
OR !$this->createPaymentcardtbl() //calls function to create payment card table
if (!$this->registerHook('Payment')
OR !$this->registerHook('paymentReturn')
OR !$this->registerHook('invoice'))
return false;
return true;
}
 
function createPaymentcardtbl()
    {
    /**Function called by install - 
     * creates the "order_paymentcard" table required for storing payment card details
     * Column Descriptions: id_payment the primary key. 
     * id order: Stores the order number associated with this payment card
     * cardholder_name: Stores the card holder name
     * cardnumber: Stores the card number
     * expiry date: Stores date the card expires
    */
 
                    $db = Db::getInstance(); 
            $query = "CREATE TABLE `"._DB_PREFIX_."order_paymentcard` (
    `   id_payment` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
    `   id_order` INT NOT NULL ,
    `   cardholdername` TEXT NOT NULL ,
    `   cardnumber` TEXT NOT NULL 
    )   ENGINE = MYISAM ";
 
        $db->Execute($query);
 
    return true;
    }
 
    /**
    * hookPayment($params)
    * Called in Front Office at Payment Screen - displays user this module as payment option
    */
    function hookPayment($params)
    {
    global $smarty;
 
    $smarty->assign(array(
            'this_path' => $this->_path,
            'this_path_ssl' => Configuration::get('PS_FO_PROTOCOL').$_SERVER['HTTP_HOST'].__PS_BASE_URI__."modules/{$this->name}/"));
 
    return $this->display(__FILE__, 'payment.tpl');
 
    }
 
}
 
?>
 
 
 
 
 
Thanks

 

Link to comment
Share on other sites

Thank you so much Vekia


 


I have corrected it and the module is now loaded correctly, but it isn't displayed as one of the payment options in my payment page. It isn't showing at all. My payment module contains the module.php, the payment.tpl and the payment return.tpl. Please what am i doing wrong? Or what haven't i done that i need to do? Am i missing some files? Any help will be appreciated, and following is a copy of my code:


 


<?php

if (!defined('_PS_VERSION_'))

  exit;

 

class diamondwebpay extends Module

{

function __construct()

{

$this->name = 'diamondwebpay';

$this->tab = 'payments_gateways';

$this->version = 1.0;

        $this->author = 'Ayodeji Olumofe';

$this->ps_versions_compliancy = array('min' => '1.5', 'max' => '1.6');

 

parent::__construct(); // The parent construct is required for translations

 

$this->page = basename(__FILE__, '.php');

$this->displayName = $this->l('diamondwebpay');

$this->description = $this->l('add diamondwebpay payment gateway to your shop');

}

 

function install()

{

if (!parent::install())

return false;

if (!$this->registerHook('payment')

OR !$this->registerHook('paymentReturn'))

return false;

return true;

}

 

    public function hookPaymentReturn($params) {

        if (!$this->active)

            return;

        global $smarty;

        $smarty->assign(array(

            'status' => Tools::getValue('status', 'OPEN')

        ));

        return $this->display(__FILE__, 'payment_return.tpl');

}

 

     public function hookPayment($params) {

        if (!$this->active)

            return;

        global $smarty;

        $smarty->assign(array(

            'this_path' => $this->_path,

            'this_path_ssl' => Tools::getShopDomainSsl(true, true) . __PS_BASE_URI__ . 'modules/' . $this->name . '/',

            'payment_methods' => $paymentMethods

        ));

 

return $this->display(__FILE__, 'payment.tpl');

}

 

}

 

?>

 

 

Note: I have issue with my shop SSL

 

 

Thanks

Link to comment
Share on other sites

just use google... 

 

diamondwebpay? what is that module? never use that for payment..

it's a diamondbank payment gateway

 

 

 

 

DiamondWebPAY

Our Web Payment Offer

We are pleased to introduce to you our multiple card-accepting online payment solution known as DiamondWebPAY for a most rewarding buying and selling experience on the internet. This service will enable your customers (cardholders) to initiate online payments irrespective of the card they carry, be it Visa, Verve or Mastercard from any part of the world!

Who needs a (Web Aggregator) web payment service?

Based on CBN policy on cash lodgments and withdrawals, all businesses that accept cash up to N500, 000 for individuals and up to N3, 000,000 for corporate customers for their daily business transactions require a website that accepts cards as for the purpose of paying for goods and services to avoid being charged 2% upwards in excess of the approved free cash lodgment limit. These include Supermarkets, Hotels & Restaurants, Electronic Shops, Pharmacies, Boutiques, Hospitals, Distributorships, Airlines, etc.

How to apply for Web Aggregator

  1. Kindly collect the DiamondWebPAY application and agreement forms from any of our branches nearest to you OR through your Relationship Officer
  2. Fill up the forms and return the same along with certificate of business registration or incorporation to the branch

The Benefits

  • Secured way of buying and selling goods on the internet
  • Better and faster way of  receiving payments for goods and services
  • Easy to use for any amount as cash payment can often be bulky
  • Deposits money electronically into your account without having to go the bank
  • Reduces risks of theft and other risks associated with cash handling
  • Transactions can be monitored online real time
  • Increases sales as customers buy more with cards than cash at hand
  • The economy now demands card payment as a preferred option to cash with large handling charges  for individuals and companies who withdraw and pay large volume of cash

Paying with a card on a DiamondWebPAY

For a complete and successful online transaction, your customer will follow these steps:

Step 1: Browse at a webpayment-enabled site for goods or services to buy
Step 2: Select item(s) you wish to pay for 
Step 3: Select type of card; Visa, Verve or Mastercard 
Step 4: Select the pay icon
Step 5: Enter card details: embossed card number, Card PIN, expiry date and the card 3 digit number behind your card
Step 6: Click enter (ok) to confirm card details and value of goods to finalize purchase

Receiving credit for a card payment through DiamondWebPAY

  1. Cardholder gets instant debit for a successful transaction, so there is the peace of mind that you will be paid for approved amount
  2. Notification is received online real time for approved transaction
  3. Merchant (business owner) receives credit within 24 hours (except weekends)
Link to comment
Share on other sites

×
×
  • Create New...