Jump to content

Payment module - Bill Me Later


Recommended Posts

I was wondering if someone could help me?

We bill 99% of our customers after 30 days so in Checkout we need a "Bill" option.

We came across the "Bill Me Later" module which is excellent. This is all we need... we don't use any of the PayPal or Google payment modules or even COD or Pay by Cheque.

But we're having issues. We uploaded the module into the /modules folder, installed it but when we test it it says there are no payment modules installed.

Here is the code below. We don't want any restrictions for our customers (all customers should be able to use "Bill Me Later" as their checkout option and without restrictions like an order size of 250, an ID Carrier, etc but everytime we edit the code it stops working.

Please someone help!

Thanks in advance!!!

<?php
class BillMeLater extends PaymentModule
{
function __construct()
{
$this->name = 'billmelater';
$this->tab = 'Payment';
$this->version = 0.1;

parent::__construct();

/* The parent construct is required for translations */
$this->page = basename(__FILE__, '.php');
$this->displayName = $this->l('Bill me');
$this->description = $this->l('Bill me later');
}

function install()
{
parent::install();
$this->registerHook('payment');
$this->registerHook('paymentReturn');
}

function hookPayment($params)
{
global $smarty;
$customer = new Customer($params['cart']->id_customer);
$customerStats = $customer->getStats();

if(intval($params['cart']->id_carrier)!=29 && intval($params['cart']->getOrderTotal(true, 4))<250 && intval($customerStats[nb_orders])>4)
{
$smarty->assign(array(
'this_path' => $this->_path,
'this_path_ssl' => (Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://').htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8').__PS_BASE_URI__.'modules/'.$this->name.'/'
));
return $this->display(__FILE__, 'payment.tpl');
}
}

function hookPaymentReturn($params)
{
return $this->display(__FILE__, 'confirmation.tpl');
}
}

?>

Share this post


Link to post
Share on other sites
  • 1 month later...
  • 10 months later...

How is it possible if I see it with one customer account, and I dont see it with second customer account ? They has the same profile (only names and mails are different), same group. WTF ?

Is there any similar payment module ?

Thx

Share this post


Link to post
Share on other sites
  • 3 months later...
  • 3 weeks later...

Good morning,

in this kind of services, it is always interesting to take a SSL certificate seperately insofar as sometimes it is more interesting to deal only with it.
You can have a more efficient support.

Best regards,

Share this post


Link to post
Share on other sites
Does anyone have it on PS 1.4 ?


Yes, just installed it. It doesn't work and throws a template-not-found error. Validation works differently on 1.4 so that is the reason it throws the error, because of an uncompatible validation template.

Share this post


Link to post
Share on other sites
  • 5 years later...
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More