On 12/01/2010 10:08 PM, Daniel P. Brown wrote:
On Wed, Dec 1, 2010 at 12:15, Nadim Attari<nadim@xxxxxxxxxxxxxxxx> wrote:
where does receipt.php gets the $_GET data ? Isn't it from response.php
where the $_POST data are being http_build_query()'ed ??
$param = http_build_query($_POST);<---------
According to cURL, it's never even hitting response.php to
redirect. It's going straight to receipt.php with $_GET data. (THERE
IS NO $_POST DATA.)
Besides, you kept stating that the 'redirect' was working fine,
which is technically incorrect: there's absolutely zero chance that
works as you presented it. You can't just throw in some text to tell
the browser to redirect to a page. You'd have to do a
header("Location: "); call, a meta refresh, a JavaScript
window.location() call or something similar. Thus that indicates that
the text from response.php is interpreted as a direction by the
processing gateway's API when it calls out to your server.
Knowing this, I see the $_POST data expected here. This wasn't in
question, as it's obviously building the query string. We now know
that it feeds this data in plain text back to the remote server for
further processing, which then directs the browser to receipt.php ---
with $_GET data (id est - THERE IS NO $_POST DATA).
Your browser is never hitting response.php. Only the remote
server is doing that. If you want to get the data as sent by the
remote server to your server in response.php, you'll either need to
write that to a file like I did:
file_put_contents('output.nadim.log',$param);
Or you'll need to consult the processing gateway's API
documentation to learn how to avoid requiring this seemingly
unnecessary step.
Thank you Daniel for this detailed post of yours. Really appreciated.
Saving the $_POST data (in response.php) in a file will serve nothing. -
And you said this was an unnecessary step from the payment gateway - All
i need is the result of the transaction, which I'll get in receipt.php
thr' $_GET.
All I can say is that I do not have any control on the payment gateway
(you may realise it has been badly implemented - if it is not too harsh
to say like that)
Another unnecessary step occurs in send_transaction.php - you have seen
that once the XML data is sent to the payment gateway (well SBM asked me
to send like that - i mean no declaration, just the tags), the gateway
sends back <paymentid> and <paymentpageurl> and i have to redirect my
browser to that page, concatenating the paymentid in the query string.
--- this should have been done automatically by the payment gateway
itself. Really baffling.
I think I'll report this to my boss, who shall contact the client (YU
Lounge). Now up to the client to decide whether they'll be doing
business with SBM payment gateway solution or not.
BTW, would you recommend someone to use this payment gateway ? What are
your comments on such payment gateway implementation ?
Anyway thanks again for your time and help Daniel.
Best regards,
Nadim Attari
Alienworkers.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php