Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Paypal payflowpro - HTTPS

Status
Not open for further replies.

CTekMedia

Programmer
Oct 5, 2001
634
US
Anyone have some code for this?

I think I have code for the https posts but if someone has the reply parsing down it would save me some time.

Thanks all!

Shane

Eric - you got anything?

Cheers,

 
Figured it out. Here's the code and BTW Paypal sucks. I much prefer authorize.net.

This is for test mode:

<cfset user = "xxxxxx">
<cfset password = "xxxxxxx">
<cfset partner = "VeriSign">
<cfset vendor = "xxxxxxxxxx">
<cfset TRXTYPE = "S">
<cfset TENDER = "C">
<cfset amount = 1>
<cfset ccExpDate = "1010">
<cfset account = "4111111111111111">
<cfset Request_ID = "9999B">

<CFSET PARAM=
"USER=#user#&"&
"PWD=#password#&PARTNER=#partner#&VENDOR=#vendor#&"&
"TRXTYPE=#TRXTYPE#&TENDER=#TENDER#&AMT=#amount#&EXPDATE=#ccExpDate#&"&
"ACCT=#account#&VERBOSITY=MEDIUM&"&
"REQUEST_ID=#Request_ID#">





<CFHTTP url=" method="post" resolveurl="yes" timeout="30">
<cfhttpparam type="header" name="Connection" value="close">
<cfhttpparam type="header" name="Content-Type" value="text/namevalue">
<cfhttpparam type="header" name="Content-Length" value="#Len(Param)#">
<cfhttpparam type="header" name="Host" value="pilot-payflowpro.verisign.com">
<CFHTTPPARAM type="header" name="X-VPS-REQUEST-ID" value="#Request_ID#">
<CFHTTPPARAM type="header" name="X-VPS-CLIENT-TIMEOUT" value="30">
<CFHTTPPARAM type="header" name="X-VPS-VIT-Integration-Product" value="Coldfusion">
<CFHTTPPARAM type="header" name="X-VPS-VIT-Integration-Version" value="6.1MX">
<CFHTTPPARAM type="body" name="literacy" encoded="no" value="#PARAM#">
</CFHTTP>

<cfoutput>
File content: <br />
#CFHTTP.FileContent#
</cfoutput>

------------------------------

The CFOUTPUT will dump the return structure from Paypal so you can look at that to determine your error codes etc.

Cheers,

 
Some additional info and keywords in case anyone else is searching for this solution.

The return data from paypal is (mostly) in a single string. This will parse it. This code from
<cfset pp_response = cfhttp.filecontent>
<CFSET MSG="RESPMSG=([^&]*)">
<CFSET RESULT_CODE="RESULT=([^&]*)">
<CFSET PNREF="PNREF=([^&]*)">
<CFSET CVV2_CODE="CVV2MATCH=([^&]*)">

<CFSET match_msg=REFindNoCase(MSG,pp_response,1,true)>
<CFSET match_result=REFindNoCase(RESULT_CODE,pp_response,1,true)>
<CFSET match_pnref=REFindNoCase(PNREF,pp_response,1,true)>
<CFSET match_cvv2=REFindNoCase(CVV2_CODE,pp_response,1,true)>

<CFIF match_msg.len[1]>
<CFSET respmsg=mid(pp_response,match_msg.pos[2],match_msg.len[2])>
</CFIF>
<CFIF match_result.len[1]>
<CFSET result=mid(pp_response,match_result.pos[2],match_result.len[2])>
</CFIF>
<CFIF match_pnref.len[1]>
<CFSET PNREF_CODE=mid(pp_response,match_pnref.pos[2],match_pnref.len[2])>
</CFIF>
<CFIF match_cvv2.len[1]>
<CFSET CVV2_MATCH=mid(pp_response,match_cvv2.pos[2],match_cvv2.len[2])>
</CFIF>

coldfusion paypal filecontent respmsg

Cheers,

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top