Hi,
I'm stuck trying to do the following:
(if you are familiar with worldpay callback feature, this will make more sense)
There are two things going on when a payment is made and "callback" (payment data is returned to my site to update the database:
- The first payment returns tansaction staus (Y or N) as well as the cart ID (supplied by me initially), the amount, desc etc.
$cartId is a value given by me, parsed through worlpay and returned back to the site when payment is complete
$query_rsusers1 = "UPDATE users SET transStatus = '".$transtatusField."',
transID = '".$transIDField."',
cartID = '".$cartID."',
amount = '".$amountField."',
futurepayID = '".$futurePayIDField."',
FuturePayStatusChange = '".$futurePaystatusChange."',
ut1 = '".$PaymentIDField."'
WHERE Uid = '".$cartID."'";
hence the "where" line which allows the right row to be updated with the payment data.
All works well
now there is a second stage to this: Futurepay callback
Worlpay offers this "futurepay" service wich is in effect a reccurent payment system, like a subscription, so for a set interval (let's say 1 day as an example) a new payment is taken automatically from the shoppers credit ccard and the subscription is maintained active.
ONLY two fields are returned:
".$futurePayIDField."'
'".$futurePaystatusChange."'
The futurepayID = '".$futurePayIDField."' was a value printed to the database upon FIRST payment and is now returned on every subsequent payments as the reference / identifyer"
FuturePayStatusChange = '".$futurePaystatusChange."' is the value that will say if the recurring payment has failed, success, been cancelled etc.
My problem is that these Futurepay payements don't return the original '".$cartID."'!!
Hence my WHERE clause prevents the database from being updated on recurring payments.
Instead my WHERE clause for these reccuring payment should be
WHERE futurepayID = '".$futurePayIDField."';
How can I combine the two typed of payments and WHERE clauses?
I can't figure it out.
I wish these two payments would return data to different pages, but that is not the case..
Any advice?
Cheers,
Vinny