Jump to content

[SOLVED] Post value of a variable from another server (intergration with Bank server)


trampolinejoe

Recommended Posts

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? -->

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.

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);
?>

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.