Hi Guys,
Following my previous post re "linking to credit card API";
I want to be able to communicate from my server to the CC API transparently.
And receive the CC API response back into my database.
I have a NetWebForm(Wizard), collecting data from the user.
And a NetWebClient() procedure in the same app.
The post to the CC API should look like this, as an example:
<form method="POST" action="https://their_url/ccform.asp">
<input type="hidden" name="p1" value="a">
<input type="hidden" name="Budget" value="n">
<input type="hidden" name="NextOccurDate" value="o">
<input type="hidden" name="m_10" value="z">
<input type="submit" value="Proceed to Payment">
</form>
I watched the Webinar on NetWebClient() and inserted the following lines of code:
RequestNumber = 1
ThisClient = FreeFieldsQueue()
ThisClient.SetValue('P1',CLIP(LOC:TerminalID)
ThisClient.SetValue('P2',CLIP(LOC:CCTrReferenceNo)
ThisClient.SetValue('P3',CLIP(LOC:Description)
ThisClient.ContentType='application/x-www-form-urlencoded'
ThisClient.POST('https://their_url/ccform.asp','')
* I did not specific any .SSLCertificateOptions, as it is not required by the API.
Back to my procedures:
My NetWebForm(Wizard) procedure, is memory-based and does not automatically insert / update the record. When the user clicks "Finish" in the wizard, I'd like to insert / update the record and call the NetWebClient procedure.
1. Which is the best embed to use "after completing the form-wizard" to do any record inserts / updates and call the NetWebClient procedure for the CC API auth?
2. I have quite a number of variables to pass between the NetWebForm and the NetWebClient, is the best way to first save the record from the NetWebForm(Wizard) and then to FETCH the record in the NetWebClient() for submission to the CC API?
The CC API makes provision for the following:
URL for cancelled transactions
URL for declined transactions
URL for authorised transactions
3. I am not too sure how to handle the response coming-back from the CC-API.
What they have indicated: If we use HTTP method "POST", the parameters will be embedded into the HTTP header.
How could I save the returned values from the reply?
Regards
Rupert