trampolinejoe Posted March 4, 2009 Share Posted March 4, 2009 Hello Friends, This one is a a little complex to understand what I am up to, thanks in advance for your time. I have been requested to move our payment company over from a 3rd party credit card company to a direct credit card connection with our bank. (National Australia Bank). They have a software platform called Transact, I am using the 'Direct Post Method' to connect to their server. According to the documentation provided by the bank this is the way they want it to work. a) Post the basic order details to the banks server at which point the bank creates a finger print. ( a 64bit encrypted variable) b) I then grab the finger print, add some more variables to the order such as credit card details and then re-submit the same order again to a new URL. What I expected to happen: 1) Post the variables to the URL they supply. 2) They then post back the variable value of the 'fingerprint key' back to my page of desire where I then create a page which accepts the post, then I can store the value of the variable. 3) I collect the other details they request then, then post that and the fingerprint key back to the banks server at which point the transaction is complete. What I have been told after speaking to the techs at the bank: 1) Post the variables to the URL they supply. 2) Somehow get the value from the page that I have posted to, somehow re-direct that page back to my server and store the 'finger print' variable in a session. 3) I collect the other details they request then, then post that and the fingerprint key back to the banks server at which point the transaction is complete. Problems 1) How on earth do I get the value of that variable off the banks server and store it in a session without them posting to me. ??? 2) How on earth do I redirect back to my page as I am not able to script on their server? ??? Documentation: https://transact.nab.com.au/nablogin/pages/downloads/download.jsp?fn=DirectPostIntegrationGuide.pdf&dt=PDF Example Code: http://trampolinesaustralia.com.au/backend/nabtest.php <!-- Just goto this url, you can see I have made the page, click on submit you will then see it takes you the banks page where it creates a key for my transaction, but then how do I get this key into a session variable and how do I do it without our customers seeing this page? --> Link to comment https://forums.phpfreaks.com/topic/147881-solved-post-value-of-a-variable-from-another-server-intergration-with-bank-server/ Share on other sites More sharing options...
WolfRage Posted March 4, 2009 Share Posted March 4, 2009 Use file_get_contents() on the URL and isolate the fingerprint, store fingerprint in session and continue as planed. Link to comment https://forums.phpfreaks.com/topic/147881-solved-post-value-of-a-variable-from-another-server-intergration-with-bank-server/#findComment-776136 Share on other sites More sharing options...
trampolinejoe Posted March 4, 2009 Author Share Posted March 4, 2009 Hello Wolf, Thanks for such a fast response, I am not very familiar with this function 'file_get_contents()'. I will follow this up with some googling. How would I apply this to the URL as the URL dosn't have the required value until after I have already posted? Cheers, Trampolinejoe. Link to comment https://forums.phpfreaks.com/topic/147881-solved-post-value-of-a-variable-from-another-server-intergration-with-bank-server/#findComment-776138 Share on other sites More sharing options...
WolfRage Posted March 4, 2009 Share Posted March 4, 2009 Modified From: http://us2.php.net/manual/en/function.stream-context-create.php#74795 <?php $data = array ('foo' => 'bar', 'bar' => 'baz'); $data = http_build_query($data); $context_options = array ( 'http' => array ( 'method' => 'POST', 'header'=> "Content-type: application/x-www-form-urlencoded\r\n" . "Content-Length: " . strlen($data) . "\r\n", 'content' => $data ) ); $context = context_create_stream($context_options) $fp = file_get_contents('https://url', FALSE, $context); ?> Link to comment https://forums.phpfreaks.com/topic/147881-solved-post-value-of-a-variable-from-another-server-intergration-with-bank-server/#findComment-776146 Share on other sites More sharing options...
trampolinejoe Posted March 4, 2009 Author Share Posted March 4, 2009 Thanks again for your response, a) Fatal error: Call to undefined function context_create_stream() in /home/content/t/r/a/trampolinesaus/html/backend/nabtest.php on line 24 Do you know where I can get this function from? b) How do I post all the other variables that the bank server would want in this stream? Sorry, I am pretty new to this kind of stuff. Cheers Link to comment https://forums.phpfreaks.com/topic/147881-solved-post-value-of-a-variable-from-another-server-intergration-with-bank-server/#findComment-776151 Share on other sites More sharing options...
trampolinejoe Posted March 4, 2009 Author Share Posted March 4, 2009 I am going to mark this one as solved, as I started a new post I feel like the post has gone alittle more specific now Link to comment https://forums.phpfreaks.com/topic/147881-solved-post-value-of-a-variable-from-another-server-intergration-with-bank-server/#findComment-776162 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.