Actually I think its working now, just needed to get my head around checkout_success, checkout_process, and how zencart processes the order using zenid etc.
So I think its all working. Going to run a few more trials.
Basically I now have a callback.php file used for the payment gateway callback, which does a check to make sure the request comes from the payment gateway and if payment was a success, and if both these pass, it redirects to:-
index.php?main_page=checkout_process&zenid='.$_POST['zenid'].'
If it fails the checks it does nothing at the moment.
Adding the zenid on the end means Zencart knows what the order is for and now processes it.
Then when the client clicks on the Return to Store button, they are redirected to:-
index.php?main_page=checkout_success OR
index.php?main_page=checkout_payment
The first one shows the summary of the order they just made, which was processed by the callback POST.
So it seems to work fine.
you never completely explained whether it was a browser that would be trigerring the successful payment or a post from the payment gatery.
The problem I have had is the system uses Callback POST AND redirects the user back. Initially I was relying on the user coming back to the site to trigger it, but some people were not clicking on Return to Store. An old problem when not using Callbacks I guess you know. So I started to use the Callback but couldnt get the payment gateway to recreate the session. So thats done now thanks to your help.
Plue there's an error in the above. There should be exit; after the header line
I have added that now, thanks.
if there's no unique feedback or encrypted reference posted from this mystery gateway, then there is nothnig stopping a person visiting the page driectly with their browser, posting the information and marknig an order as paid without visiting the gateway.
I have a security key to check against if the POST came from the payment gateway and thats working. But how do you get around this in the checkout_process file? I notice if I go through the the Checkout process to Step 3, then just go to index.php?main_page=checkout_process directly, it processes the order anyway, so I am not on any custom page I have created at all, its all been Zencart pages, so thats a problem isnt it? How would the checkout_process page know whether payment has been made, my callback file does the check, not checkout_process :ohmy: