PHP Validation - passing http POST values forwards to a 3rd party checkout -
I do not know if this is possible, I can not find any other help guide, so this is not possible possible. ..
I have a checkout page that posts loads of forward variables to the third party payment processor (WorldPay).
I want to know whether it is possible for a valid PHP script to be used between two pages for verification purposes.
EG If an item has been sold in the basket, then they were filling out the form, it could catch the customer before taking the money. Or useful if they tamper with form data.
If I do this on my site, then I can use the session to forward the post data, but as it is an external website, I do not know that any hidden form Data without creating another HTML page with; Refresh for example.
Is it possible to 'invisibly' - is not actually showing the HTML page?
Yes, by hooking you into the onsubmit hook of the form and by using (like using jQuery) You can send an Ajax call:
$ ('# myform') [0] .submit = function () {if (form_check_elements (this.elements)) {/ * «« «Example JS Validator * / data = $ ('# myform') for Serialize (); $ .post ('/ ajax_validator.php', data, function (data, textstatus) {$ ('# myform') [0]. Submit (); / * «« «Check text here before and after no submit (Wrap it in a block) *);); return false; / * Can not post the form directly * /} and {return false; / * If JS verification fails then do not post * /}};
We use this snippet to store form data in one session before posting to a 3rd party, so it is available when we have third parties returning to our page. .
Edit: Keep in mind that it will only work with JS enabled, but it is fallback-protected: the form still submits without JS support.
Comments
Post a Comment