I haven't looked at Direct as I use the Form Method. I pasted this in after the line
in Direct a similar like looks like this about Line 232
I don't know of it will work - of might at least give you a start on it
Code: Select all
$data['Apply3DSecure'] = '0';
Code: Select all
$payment_data['CustomerEMail'] = substr($order_info['email'], 0, 255);
$payment_data['Apply3DSecure'] = '0';
$payment_data['ClientIPAddress'] = $this->request->server['REMOTE_ADDR'];
Code: Select all
//added to include basket
$count_total_products = 0;
//get total rows to be sent in string
foreach ($this->cart->getProducts() as $product) {
$count_total_products++;
}
$productstring = '';
//sagepay requires colon delimiter. The last 3 fields are left empty with ':' If you want to use those fields then you will need to run another forloop to fetch the totals for combined product quantities. Below is just for name, quantity, and base price.
foreach ($this->cart->getProducts() as $product) {
//gather SKU for each product. ugh.....
// $sku = $this->model_checkout_order->getSku($product['product_id']);
$productstring .= $product['name'].':'.$product['quantity'].':'. $this->currency->format($product['price'], $order_info['currency_code'], false, false).':'.'---'.':'.'---'.':'.'---'.':';
}
//this is the string you will send in the end.
$main_string_to_send = $count_total_products.':'.substr_replace($productstring ,"",-1);
//send here
$data['Basket'] = $main_string_to_send;
I don't know of it will work - of might at least give you a start on it
HI
I have just added the basket to the sagepay V3 form version
catalog/controller/payment/sagepay_v3.php
I have just added the basket to the sagepay V3 form version
catalog/controller/payment/sagepay_v3.php
but it doesn't show the tax info in the checkout basket, can anyone help me add the tax info to the shopping basket?cau96176 wrote://added to include basket
$count_total_products = 0;
//get total rows to be sent in string
foreach ($this->cart->getProducts() as $product) {
$count_total_products++;
}
$productstring = '';
//sagepay requires colon delimiter. The last 3 fields are left empty with ':' If you want to use those fields then you will need to run another forloop to fetch the totals for combined product quantities. Below is just for name, quantity, and base price.
foreach ($this->cart->getProducts() as $product) {
//gather SKU for each product. ugh.....
// $sku = $this->model_checkout_order->getSku($product['product_id']);
$productstring .= $product['name'].':'.$product['quantity'].':'. $this->currency->format($product['price'], $order_info['currency_code'], false, false).':'.'---'.':'.'---'.':'.'---'.':';
}
//this is the string you will send in the end.
$main_string_to_send = $count_total_products.':'.substr_replace($productstring ,"",-1);
//send here
$data['Basket'] = $main_string_to_send;
I am assuming it is
$item_total = number_format($this->tax->getTax($product['price'], $product['tax_class_id']) + $baseprice ,2);
but how does it fit into this:
Any help would be appreciated, please
$item_total = number_format($this->tax->getTax($product['price'], $product['tax_class_id']) + $baseprice ,2);
but how does it fit into this:
//added to include basket
$count_total_products = 0;
//get total rows to be sent in string
foreach ($this->cart->getProducts() as $product) {
$count_total_products++;
}
$productstring = '';
//sagepay requires colon delimiter. The last 3 fields are left empty with ':' If you want to use those fields then you will need to run another forloop to fetch the totals for combined product quantities. Below is just for name, quantity, and base price.
foreach ($this->cart->getProducts() as $product) {
//gather SKU for each product. ugh.....
// $sku = $this->model_checkout_order->getSku($product['product_id']);
$productstring .= $product['name'].':'.$product['quantity'].':'. $this->currency->format($product['price'], $order_info['currency_code'], false, false).':'.'---'.':'.'---'.':'.'---'.':';
}
//this is the string you will send in the end.
$main_string_to_send = $count_total_products.':'.substr_replace($productstring ,"",-1);
//send here
$data['Basket'] = $main_string_to_send;
Any help would be appreciated, please
I would guess - and it really is a guess!
It will replace one of the '---' in $productstring
I would also try just $this->tax->getTax($product['price'], $product['tax_class_id'])
Also I would add the guy that came up with the original code I quoted is this guy
http://forum.opencart.com/memberlist.ph ... le&u=20892
It will replace one of the '---' in $productstring
I would also try just $this->tax->getTax($product['price'], $product['tax_class_id'])
Also I would add the guy that came up with the original code I quoted is this guy
http://forum.opencart.com/memberlist.ph ... le&u=20892
Who is online
Users browsing this forum: No registered users and 2 guests