I've encountered difficulties how to integrate a payment gateway for the credit cards with my Zen Cart e-commerce website.
My shopping cart works fine. Demo shopping cart at the remote server of the payment gateway provider also works with no problems. But the problem occurs after I confirm an order in Zen Cart and should be pointed to a hosted payment page. After I am redirected I don't reach the hosted payment page but see the error page which says that transaction amount missing!
<?xml version="1.0" encoding="UTF-8"?>
<transaction name="PaymentInit" version="1"><response type="error"><error_code_tag>CGW000260</error_code_tag><error_text>ERROR - CGW000260-Transaction Amount Missing</error_text></response></transaction>
I've spoken with my provider customer support and been told to amend one php file by putting a line which would load info from my Zen shopping cart about the price!? Here is how that section of php file looks like (just to mention, this file is at provider server and has a function to connect my shopping cart and the hosted payment page):
// Get and Store the quantity and price per unit and total price in session for the reciept page.
$quantity = $_REQUEST['quantity'];
$pricePerUnit = 12.34;
$price = $quantity * $pricePerUnit;
$_SESSION['quantity'] = $quantity;
$_SESSION['unitPrice'] = $pricePerUnit;
$_SESSION['totalPrice'] = $price;
The line which should be changed is in red colour (12.34 is the amount that has remained as an example at the demo shop and should be replaced with the code that reffers to the price).
I have tried to put this but with no effect:
$pricePerUnit = $_REQUEST['unitPrice'];
If you need more info to figure out what goes wrong let me know.