Jump to content

how to multiply in PHP?


Recommended Posts

I want the final amount posted to be multiplied by 1.02

The following is the payment.php of the PAYUMONEY zip file

$ total has to be multiplied by 1.02

 

I dont know if this is the right way but I am attaching the entire module also.I want the final amount posted on the Payumoney website multiplied by 1.02   

 

Reason I want to add a tax on payment by credit card tax of 2%

 

 

$payu = new payu();
$context = Context::getContext();
$cart = $context->cart;
 
 
 
if (!$cookie->isLogged(true))
Tools::redirect('authentication.php?back=order.php');
elseif (!$cart->getOrderTotal(true, Cart::BOTH))
Tools::displayError('Error: Empty cart');
 
if ($cart->id_customer == 0 OR $cart->id_address_delivery == 0 OR $cart->id_address_invoice == 0 OR !$payu->active)
Tools::redirectLink(__PS_BASE_URI__.'order.php?step=1');
 
 
 
 
// Prepare payment
 
$customer = new Customer((int)$cart->id_customer);
 
if (!Validate::isLoadedObject($customer))
Tools::redirectLink(__PS_BASE_URI__.'order.php?step=1');
 
$currency = new Currency(Tools::getValue('currency_payement', false) ? Tools::getValue('currency_payement') : $cookie->id_currency);
$total = (float)($cart->getOrderTotal(true, Cart::BOTH));
 
 
 
$payu->validateOrder($cart->id, Configuration::get('PS_OS_BANKWIRE'), $total, $payu->displayName, NULL,NULL, (int)$currency->id, false, $customer->secure_key);
Tools::redirect('index.php?controller=order-confirmation&id_cart='.(int)$cart->id.'&id_module='.$payu->id.'&id_order='.$payu->currentOrder.'&key='.$customer->secure_key);
include('../../footer.php');

payu.zip

Link to comment
Share on other sites

  • 3 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...