Forum > Networking and Web Programming

How to use the Elavon Converge Payment Gateway

<< < (2/5) > >>

Gustavo 'Gus' Carreno:
Hi RedOctober,

--- Quote from: RedOctober on May 29, 2021, 03:33:53 am ---Hi Gus, yes, you may ask.  Here are the answers:

--- End quote ---

Ahhh, now that's more like it, some docs and some more info for us to bite into.

I've had a diagonal look at the docs you gave and I know how I can give you some examples using TidHTTP.

Unfortunately, for me, I decided to have a quick query on the forum right at the end of my fuse.
I should've been more wise and just gotten to bed, instead of opening a site that makes you think...

I'll resume this tomorrow. In the meantime, and with the trove of info you gave, maybe someone in a diff time zone can do it before I wake up.
If not, you got my promise that I'll whip something up right after I wake up.

Heading to bed and I'll resume this after I've had some beauty sleep.



--- Quote from: RedOctober on May 28, 2021, 11:22:05 pm ---How do I send a Request in PHP format?

--- End quote ---

Normally, certain urls (like your buy page) on your webserver are php files (scripts)
which show html to your visitors and send http requests to the payment processor.
In the simplest case there is no need for own programs (binaries) on the web server.
But if allowed on your webserver, exec() can be called from php script to run
programs (possibly for sending emails (confirmation, license key) to your customer).

Note: My comment was under this assumption:
If payment gateways provide the SDK in other languages (PHP, ...),
then it should be faster to use their SDK than porting their SDK to Pascal
and using an own web server app (cgi) although this is possible as well.

Hi everyone working on a solution for this issue:

My web server is a stand alone Windows .exe, Brook 5 Framework, built using Lazarus 2.0.10 and Indy components to talk to external APIs.  My web server will show product info to the customer, and the customer will click a "buy now" button to go to the Elavon Hosted Payments Page to take payment. I don't want to be dealing with credit cards on my server.

This is the reason I must deal with Elavon. They are our credit card processor company.  So, some how, I must overcome this snag, which, in the end, will be a very simple matter of configuring the IIdHTTP properties correctly, and formatting the request correctly.  That is where I am having trouble.

Gustavo 'Gus' Carreno:
Hey RedOctober,

Let me start by telling you that the tech support at Elavon is maybe not that technical in nature but has a few scripts they follow. If you're lucky enough to ask a question on those scripts, you get a canned answer, also on said scripts.

What they should've told you is that you need an HTTP Client. A recent name to something that has been rising in use due to REST API's and other web centric services.

All top languages now have, at least, one HTTP Client implementation on their rooster, if not many.

As is the case, in FPC/Lazarus, there's at least 3 of them, that I know of:

* TfpHTTPClient from the fcl-web package that needs no external libs:
* TidHTTP from the Indy10 internet suite
* THTTPSend from the synapse internet suite
It really doesn't matter what language you use, what matters is how you use the HTTP Client.

I'm still in the middle of making a small project that will help you in all this. I like to be thorough and give, as complete as I can provide, examples.

I'll be using the Indy10 HTTP Client, since it's what you already have on your server.
I'll also be using an XML library to deal with the XML de/serializing. Working with XML in an OOP way is less prone to issues than if you would just do it via strings.

Please be a bit more patient, and I'll have something for you.


Gustavo 'Gus' Carreno:
Hey RedOctober,

I've finally completed my example. You'll find it attached.

It gives you an idea on how to create the XML you need via the laz2_* libraries that deal with XML in UTF-8 format.

It also gives you a way to test back and forth the values you need to send.

The Log memo is read-only but the XML Memo can be edited and it's content is what is sent to the URL(Elavon Endpoint)

I've tested it with an echo server that I quickly made with PHP:

--- Code: PHP  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---<?phpif ($_SERVER['REQUEST_METHOD'] == 'POST') {    $entityBody = file_get_contents('php://input');    echo $entityBody;} else {?><html>    <head>        <title>Test Elavon</title>    </head>    <body>        <div>            <h1>Test Elavon</h1>            <p>Need to post some XML</p>        </div>    </body></html><?php} 
I'm getting back the same XML that I input, so at least the POST is working.
I've not tested with HTTPS, but that's also easy to overcome. I'm probably just missing a Unit for that.
I'll let you figure out what you need to do from now on.

Please gimme some feed back if this helps at all.



[0] Message Index

[#] Next page

[*] Previous page

Go to full version