I have an order form that passes a price including shipping to Paypal. PayPal then confirms the user, determines the address, and returns the amount and address to a confirmation page form. From this page the user hits submit and the amount is passed and the transaction gets completed.
If the user has a California shipping address I have a function on the confirmation page that calculates the tax. The problem is I cannot get the newly tax calculated total passed in the final phase of the order process. So when he user hits submit from the order confirmation page the amount without the tax gets passed, not the amount with the tax that has been calculated.
This is the 4 steps of my order process.
Price page > Paypal > confirmation Page > Transaction complete page
The problem is, the Price generated at the Price page stays in the URL during the whole transaction. I need to change it at the Confirmation page and pass the new amount in the URL to the Transaction complete page.
Below is the code that I don't understand that I am hoping I can modify.
<!-- confirmation page -->
<!-- this is the tax calculation function, nothing wrong here, I just included it for explanation purposes -->
$caltax = (($_REQUEST['paymentAmount'] - $_REQUEST['SHIPPINGAMT']) * 0.0925);
if ($resArray['SHIPTOSTATE'] == 'CA')
$_REQUEST['paymentAmount'] = ($_REQUEST['paymentAmount'] + $caltax);
<!-- this is the price variable who's value want to change but cannot figure out how to-->
<!-- Transaction complete page -->
$paymentAmount =urlencode ($_SESSION['paymentAmount']);
<!-- This is the code that passes the final amount to complete the transaction -->