Forum > Networking and Web Programming

How to use the Elavon Converge Payment Gateway

<< < (5/5)

engkin:
Debugging the request based on egsuh's post in reply #14, and reducing it to the minimum accepted version by the server:

--- Code: Text  [+][-]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";}};} ---POST /VirtualMerchantDemo/processxml.do HTTP/1.1Host: api.demo.convergepay.comAccept: application/xmlContent-Type: application/x-www-form-urlencodedContent-Length: 347 <txn>  <ssl_merchant_id>my_merchant_id</ssl_merchant_id>  <ssl_user_id>my_user_id</ssl_user_id>  <ssl_pin>my_pin</ssl_pin>  <ssl_test_mode>false</ssl_test_mode>  <ssl_transaction_type>ccsale</ssl_transaction_type>  <ssl_card_number>000000000000000</ssl_card_number>  <ssl_exp_date>1215</ssl_exp_date>  <ssl_amount>1.00</ssl_amount></txn>
It needs "Accept: application/xml" and "Content-Type: application/x-www-form-urlencoded". Changing the code in Gus' app in the "Send Raw" button to something along these lines:

--- Code: Pascal  [+][-]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";}};} ---procedure TfrmMain.actFileSendRawExecute(Sender: TObject);...    //http.Request.ContentType:='application/xml';    http.Request.ContentType:='application/x-www-form-urlencoded';    http.Request.Accept:='application/xml';...
should make it work (did not test it).

The response from the server is:

--- Code: Text  [+][-]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";}};} ---HTTP/1.1 200 OKServer: ServerX-Frame-Options: SAMEORIGINStrict-Transport-Security: max-age=31536000; includeSubDomains; preloadExpires: 0Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0Pragma: no-cacheX-Frame-Options: SAMEORIGINAuthErrorNb: 4025Content-Security-Policy: frame-ancestors 'self'Content-Disposition: inline; filename=response.xmlCPID: AD4-670d2032-7a93-4db0-a3fa-60f9b806b7b8Content-Type: text/xmlAuthError: trueContent-Length: 214Date: Thu, 10 Jun 2021 04:33:11 GMTConnection: keep-aliveSet-Cookie: JSESSIONID=h5ugkZCNXopMZswRjexQOtEE1ZXO42nFlMdiKO2D.server; path=/VirtualMerchantDemo; secure; HttpOnlyDebug-XFF-Seen-by-Edge: 206.189.xxx.xxxClient-IP-Seen-by-Edge: 206.189.xxx.xxx <?xml version="1.0" encoding="UTF-8"?><txn><errorCode>4025</errorCode><errorName>Invalid Credentials</errorName><errorMessage>The credentials supplied in the authorization request are invalid.</errorMessage></txn>
As you can see, "Invalid Credentials"

For similar problems you can use an online service like ReqBin to see request, response and headers.

RedOctober:
I've found that Elavon is a good company to work with for credit card processing.  Their point of sale equipment and computer system is way more reliable than Moneris.  Moneris was complete garbage and left us stranded about once every two weeks. My first exposure to on-line payments was using PayPal's "buy now" buttons, which are really easy to use, self contained, and don't require any programming at all.  It took me only about 20 minutes to set up a Buy Now button.

I did not realize that by using PayPal first, the ease-of-use, convenience, and straight forwardness provided by PayPal, actually poisoned my mind when approaching Elavon's API.  I found using the Elavon API a month's long struggle, bc I kept thinking it shd be as easy as PayPal. That was the wrong attitude.

Eventually, I just gave up on the XML interaction with Elavon and used their GetToken and Hosted Payments Page  (HPP) combination which itself took weeks to decipher how to use. 

I was about to try Square, but just at that moment, I got the Elavon HPP working so I did not pursue the Square attempt any further.  This may not answer your question, but maybe gives you a bit of insight and preparation if you want to use Elavon.

The reason I started with Elavon is bc our company already uses them as a CC processing company, so it simplifies our accounting processes to use the same company.


Navigation

[0] Message Index

[*] Previous page

Go to full version