hi,
Ok, this may sound confusing, I'll try to explain best as possible.
I am working with Worldpay payment gateway, using their "callback" featue: payment result / details being returned to my site for updating the database.
I am also using one of their product "futurepay" which is a recurring payment system: I.E, every week, your membership is renewed automatically and money taken of your credit card.
Either upon first payment, or "futurepay paments", the same data is returned to my site and I am able to update my database.
All good.
Where I have a problem is when The customer cancels his membership.
A different string of info is returned to the same page of the website.
On payments, I update my database using the ".$cartID."' field which is given by me, sent to worldpay, and returned with the transaction result.
But upon cancelation of membership, worldpay does not send me back the ".$cartID."'.
Instead, I get '".$futurePayIDField."' as the payment reference,w hich is fine because that value is entered into the database upon first payment.
So my WHERE clause has two possible scenario:
WHERE Uid = '".$cartID."' OR futurepayID = '".$futurePayIDField."'";
so it updates the right row of the database upon payment, or cancelation of payment.
$query_rsusers1 = "UPDATE users SET transStatus = '".$transtatusField."',
transID = '".$transIDField."',
cartID = '".$cartID."',
amount = '".$amountField."',
futurepayID = '".$futurePayIDField."',
FuturePayStatusChange = '".$futurePaystatusChange."',
ut1 = '".$PaymentIDField."'
WHERE Uid = '".$cartID."' OR futurepayID = '".$futurePayIDField."'";
NOW THE PROBLEM:
Upon cancelation, only two of the above fields are returned to my site:
'".$futurePayIDField."',
'".$futurePaystatusChange."',
which means that with my current query, upon cancelation, all the other values are NULL and overwrite what wwas previously stored in the table.
Upon cancelation, I need the field:
'".$transtatusField."' not to be overwriten with NULL .
How can I achieve that?
I hope this pmakes sense...
Thanks,
Vinny