I am trying to integrate PayPal with a CF solution. Pay Pal account is a business account, using "Website Payments Standard"

I am not using the PayPal encrypted buttons, but am providing my own encryption on the fly with OpenSSL and CFEXECUTE due to specific situation.

I am having one he** of a day trying to make this work. Keep getting new errors and nothing seems to work. Support from PayPal is extremely frustrating.

MY QUESTION IS - Has anyone on the list done this before - specifically, encrypting your payment buttons on the fly? I have created the public cert and key and uploaded that to PayPal and downloaded their cert as well. Code is below, problems are below that.


Here is the process/code I am using, based upon PayPal's documents and other CF examples I could find:

<!--- file name --->
<cfset buttonfile = "/var/tmp/ cc_com_paypal_order_#session.bannerOrderID#">


<!--- create temp file --->
<cffile action="write" file="#buttonfile#" output="cert_id=DFKJDF97ADFK
cmd=_s-xclick
business=payPalApprovedAccountEmail
item_name=Service Being Sold
item_number=#orderID#
amount=50.00
currency_code=USD
tax=0
no_shipping=1
address1=address as stated in public cert
city=city as stated in public cert
state=state as stated in public cert
zip=zip as stated in public cert
country=US
no_note=1
cancel_return=returnFile.cfm">

<!--- create signed, binary version of file created above --->
<cfexecute name="/usr/bin/openssl" arguments="smime -sign -in #buttonfile# -signer /etc/certificates/mysite-publiccert.pem -inkey / etc/certificates/mysite-privatekey.pem -outform der -nodetach -binary - out #buttonfile#.binary" timeout="30" variable="encButtonOutput" />

<!--- generate encrypted button from binary --->
<cfexecute name="/usr/bin/openssl" arguments="smime -encrypt -des3 - binary -in #buttonfile#.binary -outform pem /etc/certificates/ paypal_cert_pem.txt" timeout="30" variable="encButton" />


<!--- actual form --->
<div id="paypalform" style="text-align:center;">
        <form action="https://www.paypal.com/cgi-bin/webscr"; method="post">
                <input type="hidden" name="cmd" value="_s-xclick">
                <input type="hidden" name="encrypted" value="#encButton#">
<input type="submit" value="Pay #dollarFormat(paymentToMake)# via PayPal">
        </form>
</div>


The problem is that when the transaction is submitted, PayPal gives different errors, ranging from problems with the email (which PayPal Customer Service confirmed is correct), to issues with decrypting the cert. It's nuts. No one error is the same and PayPal will only say "Gee, we don't know."

_____________________
Derrick Peavy
derr...@derrickpeavy.com
_____________________



Reply via email to