0
New Here
,
/t5/coldfusion-discussions/send-xml-data-for-credit-card-processing/td-p/152515
Oct 28, 2008
Oct 28, 2008
Copy link to clipboard
Copied
I’m trying to implement submission of an XML document
from my website for credit card processing using my
merchant’s API.
Here’s the format I’m using for my request. For some reason I keep getting an error message telling me “Invalid Request Format. XML request is not well-formed or request is incomplete.”
I know the XML itself is correct, as I can submit it directly through the URL string in the browser and it works OK.
Here’s what I’m doing:
<cfsavecontent variable="strXML">
<!--- NOTE: test data below -- not my real data --->
<txn>
<ssl_merchant_ID>123456</ssl_merchant_ID>
<ssl_user_id>123456</ssl_user_id>
<ssl_pin>V6NJ3A</ssl_pin>
<ssl_transaction_type>ccsale</ssl_transaction_type>
<ssl_card_number>1111111111111111</ssl_card_number>
<ssl_exp_date>1210</ssl_exp_date>
<ssl_amount>2.34</ssl_amount>
<ssl_salestax>0.00</ssl_salestax>
<ssl_cvv2cvc2_indicator>1</ssl_cvv2cvc2_indicator>
<ssl_cvv2cvc2>321</ssl_cvv2cvc2>
<ssl_invoice_number>1234</ssl_invoice_number>
<ssl_customer_code>1111</ssl_customer_code>
<ssl_first_name>customer</ssl_first_name>
<ssl_last_name>name</ssl_last_name>
<ssl_avs_address>1234 main st.</ssl_avs_address>
<ssl_address2>apt b</ssl_address2>
<ssl_city>any town</ssl_city>
<ssl_state>ST</ssl_state>
<ssl_avs_zip>55555</ssl_avs_zip>
<ssl_phone>555-555-5555</ssl_phone>
<ssl_email>customer@email.com</ssl_email>
</txn>
</cfsavecontent>
<cfhttp url="https://www.myvirtualmerchant.com/VirtualMerchant/processxml.do?xmldata=" method="post">
<cfhttpparam type="XML" value="trim(strXML)">
</cfhttp>
<cfoutput>#cfhttp.FileContent#</cfoutput>
Can someone tell me what I’m doing wrong?
(The developer guide is available here:
https://www.myvirtualmerchant.com/VirtualMerchant/download/developerGuide.pdf)
thanks!
Here’s the format I’m using for my request. For some reason I keep getting an error message telling me “Invalid Request Format. XML request is not well-formed or request is incomplete.”
I know the XML itself is correct, as I can submit it directly through the URL string in the browser and it works OK.
Here’s what I’m doing:
<cfsavecontent variable="strXML">
<!--- NOTE: test data below -- not my real data --->
<txn>
<ssl_merchant_ID>123456</ssl_merchant_ID>
<ssl_user_id>123456</ssl_user_id>
<ssl_pin>V6NJ3A</ssl_pin>
<ssl_transaction_type>ccsale</ssl_transaction_type>
<ssl_card_number>1111111111111111</ssl_card_number>
<ssl_exp_date>1210</ssl_exp_date>
<ssl_amount>2.34</ssl_amount>
<ssl_salestax>0.00</ssl_salestax>
<ssl_cvv2cvc2_indicator>1</ssl_cvv2cvc2_indicator>
<ssl_cvv2cvc2>321</ssl_cvv2cvc2>
<ssl_invoice_number>1234</ssl_invoice_number>
<ssl_customer_code>1111</ssl_customer_code>
<ssl_first_name>customer</ssl_first_name>
<ssl_last_name>name</ssl_last_name>
<ssl_avs_address>1234 main st.</ssl_avs_address>
<ssl_address2>apt b</ssl_address2>
<ssl_city>any town</ssl_city>
<ssl_state>ST</ssl_state>
<ssl_avs_zip>55555</ssl_avs_zip>
<ssl_phone>555-555-5555</ssl_phone>
<ssl_email>customer@email.com</ssl_email>
</txn>
</cfsavecontent>
<cfhttp url="https://www.myvirtualmerchant.com/VirtualMerchant/processxml.do?xmldata=" method="post">
<cfhttpparam type="XML" value="trim(strXML)">
</cfhttp>
<cfoutput>#cfhttp.FileContent#</cfoutput>
Can someone tell me what I’m doing wrong?
(The developer guide is available here:
https://www.myvirtualmerchant.com/VirtualMerchant/download/developerGuide.pdf)
thanks!
TOPICS
Advanced techniques
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
1 Correct answer
LEGEND
,
Oct 28, 2008
Oct 28, 2008
Looking deeper into your original post.
You say this...
"I know the XML itself is correct, as I can submit it directly through
the URL string in the browser and it works OK."
That would say to me you are using get URL parameters not post form
parameters. Also you don't put the name of the url parameter in the url
string, unless you put the value there. If you use the
<cfhttpparam....> tag, it should contain the name. Finally you seem to
be missing some pound signs.
Give this, or somethin...
You say this...
"I know the XML itself is correct, as I can submit it directly through
the URL string in the browser and it works OK."
That would say to me you are using get URL parameters not post form
parameters. Also you don't put the name of the url parameter in the url
string, unless you put the value there. If you use the
<cfhttpparam....> tag, it should contain the name. Finally you seem to
be missing some pound signs.
Give this, or somethin...
LEGEND
,
/t5/coldfusion-discussions/send-xml-data-for-credit-card-processing/m-p/152516#M13930
Oct 28, 2008
Oct 28, 2008
Copy link to clipboard
Copied
<cfsavecontent variable="strXML">
<!--- NOTE: test data below -- not my real data --->
<txn>
Some xml parsers can be very sensitive to any extra anything, even white
space, preceding the xml root tag.
You may want to try this.
<cfsavecontent variable="strXML"><txn>
...
</cfsavecontent>
<!--- NOTE: test data below -- not my real data --->
<txn>
Some xml parsers can be very sensitive to any extra anything, even white
space, preceding the xml root tag.
You may want to try this.
<cfsavecontent variable="strXML"><txn>
...
</cfsavecontent>
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
bezly
AUTHOR
New Here
,
/t5/coldfusion-discussions/send-xml-data-for-credit-card-processing/m-p/152517#M13931
Oct 28, 2008
Oct 28, 2008
Copy link to clipboard
Copied
I tried it -- thanks, but no luck. Doesn't the Trim() around
the string take care of that though?
-B
-B
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
LEGEND
,
/t5/coldfusion-discussions/send-xml-data-for-credit-card-processing/m-p/152518#M13932
Oct 28, 2008
Oct 28, 2008
Copy link to clipboard
Copied
Looking deeper into your original post.
You say this...
"I know the XML itself is correct, as I can submit it directly through
the URL string in the browser and it works OK."
That would say to me you are using get URL parameters not post form
parameters. Also you don't put the name of the url parameter in the url
string, unless you put the value there. If you use the
<cfhttpparam....> tag, it should contain the name. Finally you seem to
be missing some pound signs.
Give this, or something like it, a try.
<cfhttp
url="https://www.myvirtualmerchant.com/VirtualMerchant/processxml.do
method="get">
<cfhttpparam type="url" name="xmldata" value="#trim(strXML)#">
</cfhttp>
You say this...
"I know the XML itself is correct, as I can submit it directly through
the URL string in the browser and it works OK."
That would say to me you are using get URL parameters not post form
parameters. Also you don't put the name of the url parameter in the url
string, unless you put the value there. If you use the
<cfhttpparam....> tag, it should contain the name. Finally you seem to
be missing some pound signs.
Give this, or something like it, a try.
<cfhttp
url="https://www.myvirtualmerchant.com/VirtualMerchant/processxml.do
method="get">
<cfhttpparam type="url" name="xmldata" value="#trim(strXML)#">
</cfhttp>
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
bezly
AUTHOR
New Here
,
LATEST
/t5/coldfusion-discussions/send-xml-data-for-credit-card-processing/m-p/152519#M13933
Oct 28, 2008
Oct 28, 2008
Copy link to clipboard
Copied

Thanks! You rock! I was pulling my hair out.
The trick ended up being using the name within the cfhttpparam as you suggested.
<cfhttpparam type="url" name="xmldata" value="#trim(strXML)#">
Everything else it handles OK either way. (get/post)
-B
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

