Forum > Networking and Web Programming

How to use the Elavon Converge Payment Gateway

<< < (3/5) > >>

Gustavo 'Gus' Carreno:
Hey RedOctober,

This version has the OpenSSL code.

Cheers,
Gus

PierceNg:

--- Quote from: RedOctober on May 29, 2021, 03:33:53 am ---My goal is to use Elavon's Hosted Payments Page (HPP) to take payments from customer
https://developer.elavon.com/na/docs/converge/1.0.0/integration-guide/transaction_types/credit_card/sale#ccsalexamples-id
--- End quote ---

Going by the example on that page, you need to wrap your '<ssl_blahblah>' elements within a '<txn>' pair:

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

According to the section Implementation Guidelines on this page https://developer.elavon.com/na/docs/converge/1.0.0/integration-guide/integration_methods/xmlapi,


--- Quote ---Converge doesn't expect a fully validated XML document, but an XML-formatted request assigned to URL encoded variables called xmldata. Only the Converge-specific elements for the transaction itself are supported.
--- End quote ---

See the part that I underlined. The language is unclear, as it says 'variables' (plural) but only names one variable 'xmldata'. So try this:

* use <txn></txn> to wrap your <ssl_blahblah> elements
* submit the request parameters as form-url-encoding of 'xmldata=<txn>...</txn>'

RedOctober:
Hi Gus and Peirce.  I have not forgotten about you.  Gus, I tried to POST the XML using your test app.  Their server is still reporting "Bad request". Yet your XML is correctly formed according to the Elavon dev help website.

I have informed Elavon help that my tool (Lazarus) is more like PostMan than CURL, and if they could come up with a PostMan example of what is on their dev help page, it would be much easier for me to translate, than me trying to piece together what is supposed to happen from their dev help web pages.  So far, they have not given up on me, and they told me they are working on it.

What ever I learn, I will make a post in this forum explaining how to use Lazarus to interact with Elavon's Hosted Payment Page.

trev:
The tool is almost completely irrelevant. The issue is not the tool, but the proper format of the HTTP request to send to the server. This was pointed our earlier.

You also said "When I use simple Key=Value pairs in the request body, it works.  But when I use, what I call a "XML" style format in the body, it fails with a 'bad request'."

So, one has to ask, why change what works?

egsuh:
As PierceNg wrote, doesn't this need something like following?
When I press "submit" it displays error message - Invalid Credentials. I think you may correct it.


--- Quote ---<!Doctype html>
<html>
<head>
<meta charset=utf8>
</head>
<body><form action="https://api.demo.convergepay.com/VirtualMerchantDemo/processxml.do" method="post">
Here is the data<br>
<textarea name="xmldata" rows=20 cols=80> <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>
</textarea>
<br>
<input type=submit value="submit">
</form>
</body>
</html>
--- End quote ---

Of course you may use following: 


--- Quote ---  <input type=text name="ssl_merchant_id" value="my_merchant_id">
  <input type=text name="ssl_user_id" value="my_user_id">
--- End quote ---

with different action address of the form.


BTW, how did you setup Brook 5 ?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version