Paypal Payments Pro

2012-09-23 Thread Al Musella, DPM

I just switched from google to paypal payments pro.. thought it would 
be simple...
was banging my head against the wall all day. Was able to get the 
sample code working but not my real account - kept getting security 
problems and connection errors...  then I found a blog post about 
it..  all I had to do was delete my credentials and regenerate them.. 
then it worked.  Wasted about 10 hours on that :)


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:352735
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Question about using AJAX with Authorize.net

2012-09-23 Thread .jonah

I don't have time right now to delve into the details of coming up with 
a new way to use Authorize.net and what you're trying to do isn't an 
"approved" method of integration.

Their approach for what you're wanting to do is the Direct Post Method:

http://developer.authorize.net/api/dpm

Have you taken a look at its docs and examples?

Once you have that method working and you really want to try something 
new you could try to migrate it to posting via AJAX instead of directly...

On 9/23/12 6:27 PM, Rick Faircloth wrote:
> When you say "endpoint", you mean the "success"
> section of the code? That's always the way I do AJAX
> when I'm sending requests to component methods for processing.
>
> Is there something about sending a post to another
> server/domain that makes that unworkable?
>
>> not actually getting a response at all
> Yes, I've noticed that from the start...nothing in Firebug
> in the Response section in any browser.
>
> The only thing I see different in Firebug in Chrome is under
> headers > RequestHeaders I've got these lines:
>
> Content-Typeapplication/x-www-form-urlencoded
> Accept  application/json, text/javascript, */*; q=0.01
>
> Is there a disconnect between the content-type (sent? received?)
> and what will be accepted (by my code? by Auth.net's server?)
> Does this tell you anything?
>
> And you asked where in the Authorized.net docs have I seen this
> "endpoint"... well, nowhere, but then, I haven't seen much of
> anything except a ton of PHP code and an example of CF processing
> using CFHTTP.
>
> I noticed that cfpayment uses CFHTTP in part of the programming.
> If I use CFHTTP to process the form, does that mean that I'm now
> handling the form data "on my server", requiring more stringent
> PCI compliance that doing a straight AJAX post?
>
> I'm sure there's just something I don't understand about what's
> going on, especially since this is my first experience with a
> payment gateway, as well as the first time I've ever used AJAX
> to post to another domain/site.
>
> So, is what I'm trying to do with my code even possible?
> I'm getting correct processing on Authorize.net's end. They send
> me the customer and merchant email receipts.
>
> I just can't figure out how to get a response back to my AJAX
> function.
>
> Any more suggestions?
>
> Rick
>
> -Original Message-
> From: .jonah [mailto:jonah@creori.com]
> Sent: Sunday, September 23, 2012 3:51 PM
> To: cf-talk
> Subject: Re: Question about using AJAX with Authorize.net
>
>
> I don't quite know how you're using that endpoint with AJAX.
>
> If you click on that URL in firebug, you'll see you're not actually
> getting a response at all.
>
> Also, try your form in Chrome.
>
> I get this in the console:
> XMLHttpRequest cannot load
> https://test.authorize.net/gateway/transact.dll. Origin http:// server> is not allowed by Access-Control-Allow-Origin.
>
> Where in the authorize.net docs does it talk about using this endpoint
> in this way?
>
>
> On 9/23/12 5:54 AM, Rick Faircloth wrote:
>>  $(document).ready(function() {
>>
>> $('#donation_form_submit').click(function() {
>>
>>var x_login =   '25F2wqnuFs';
>>var x_tran_key  =   '3B58p37d9PJxUUR9';
>>var x_relay_response=   'false';
>>var x_type  =   'AUTH_CAPTURE';
>>var x_method=   'CC';
>>var x_description   =   'Donation';
>>
>>var x_card_num  =   $('#x_card_num').val();
>>var x_card_num  =
>> x_card_num.replace(/\D/g,'');
>>
>>var x_exp_date  =
>> $('#p_cc_exp_month').val()+$('#p_cc_exp_year').val();
>>
>>var x_amount=
>> $('input[name=x_amount]:checked').val();
>>var x_first_name=
> $('#x_first_name').val();
>>var x_last_name =   $('#x_last_name').val();
>>var x_address   =   $('#x_address').val();
>>var x_city  =   $('#x_city').val();
>>var x_state =   $('#x_state').val();
>>var x_zip   =   $('#x_zip').val();
>>var x_email =   $('#x_email').val();
>>
>>values  =   {   x_login:x_login,
>>x_tran_key: x_tran_key,
>>x_relay_response:   x_relay_response,
>>x_type: x_type,
>>x_method:   x_method,
>>x_description:  x_description,
>>x_card_num: x_card_num,
>>x_exp_date:  

RE: Question about using AJAX with Authorize.net

2012-09-23 Thread Rick Faircloth

When you say "endpoint", you mean the "success"
section of the code? That's always the way I do AJAX
when I'm sending requests to component methods for processing.

Is there something about sending a post to another
server/domain that makes that unworkable?

> not actually getting a response at all

Yes, I've noticed that from the start...nothing in Firebug
in the Response section in any browser.

The only thing I see different in Firebug in Chrome is under
headers > RequestHeaders I've got these lines:

Content-Typeapplication/x-www-form-urlencoded
Accept  application/json, text/javascript, */*; q=0.01

Is there a disconnect between the content-type (sent? received?)
and what will be accepted (by my code? by Auth.net's server?)
Does this tell you anything?

And you asked where in the Authorized.net docs have I seen this
"endpoint"... well, nowhere, but then, I haven't seen much of
anything except a ton of PHP code and an example of CF processing
using CFHTTP.

I noticed that cfpayment uses CFHTTP in part of the programming.
If I use CFHTTP to process the form, does that mean that I'm now
handling the form data "on my server", requiring more stringent
PCI compliance that doing a straight AJAX post?

I'm sure there's just something I don't understand about what's
going on, especially since this is my first experience with a
payment gateway, as well as the first time I've ever used AJAX
to post to another domain/site.

So, is what I'm trying to do with my code even possible?
I'm getting correct processing on Authorize.net's end. They send
me the customer and merchant email receipts.

I just can't figure out how to get a response back to my AJAX
function.

Any more suggestions?

Rick

-Original Message-
From: .jonah [mailto:jonah@creori.com] 
Sent: Sunday, September 23, 2012 3:51 PM
To: cf-talk
Subject: Re: Question about using AJAX with Authorize.net


I don't quite know how you're using that endpoint with AJAX.

If you click on that URL in firebug, you'll see you're not actually 
getting a response at all.

Also, try your form in Chrome.

I get this in the console:
XMLHttpRequest cannot load 
https://test.authorize.net/gateway/transact.dll. Origin http:// is not allowed by Access-Control-Allow-Origin.

Where in the authorize.net docs does it talk about using this endpoint 
in this way?


On 9/23/12 5:54 AM, Rick Faircloth wrote:
> $(document).ready(function() {
>
>$('#donation_form_submit').click(function() {
>
>   var x_login =   '25F2wqnuFs';
>   var x_tran_key  =   '3B58p37d9PJxUUR9';
>   var x_relay_response=   'false';
>   var x_type  =   'AUTH_CAPTURE';
>   var x_method=   'CC';
>   var x_description   =   'Donation';
>
>   var x_card_num  =   $('#x_card_num').val();
>   var x_card_num  =
> x_card_num.replace(/\D/g,'');
>
>   var x_exp_date  =
> $('#p_cc_exp_month').val()+$('#p_cc_exp_year').val();
>
>   var x_amount=
> $('input[name=x_amount]:checked').val();
>   var x_first_name=
$('#x_first_name').val();
>   var x_last_name =   $('#x_last_name').val();
>   var x_address   =   $('#x_address').val();
>   var x_city  =   $('#x_city').val();
>   var x_state =   $('#x_state').val();
>   var x_zip   =   $('#x_zip').val();
>   var x_email =   $('#x_email').val();
>
>   values  =   {   x_login:x_login,
>   x_tran_key: x_tran_key,
>   x_relay_response:   x_relay_response,
>   x_type: x_type,
>   x_method:   x_method,
>   x_description:  x_description,
>   x_card_num: x_card_num,
>   x_exp_date: x_exp_date,
>   x_amount:   x_amount,
>   x_first_name:   x_first_name,
>   x_last_name:x_last_name,
>   x_address:  x_address,
>   x_city: x_city,
>   x_state:x_state,
>   x_zip:  x_zip,
>   x_email:x_email
> }
>
>   $.ajax  ({  cache:  false,
>   type:   'post',
>   url:

Re: Question about using AJAX with Authorize.net

2012-09-23 Thread .jonah

I don't quite know how you're using that endpoint with AJAX.

If you click on that URL in firebug, you'll see you're not actually 
getting a response at all.

Also, try your form in Chrome.

I get this in the console:
XMLHttpRequest cannot load 
https://test.authorize.net/gateway/transact.dll. Origin http:// is not allowed by Access-Control-Allow-Origin.

Where in the authorize.net docs does it talk about using this endpoint 
in this way?


On 9/23/12 5:54 AM, Rick Faircloth wrote:
> $(document).ready(function() {
>
>$('#donation_form_submit').click(function() {
>
>   var x_login =   '25F2wqnuFs';
>   var x_tran_key  =   '3B58p37d9PJxUUR9';
>   var x_relay_response=   'false';
>   var x_type  =   'AUTH_CAPTURE';
>   var x_method=   'CC';
>   var x_description   =   'Donation';
>
>   var x_card_num  =   $('#x_card_num').val();
>   var x_card_num  =
> x_card_num.replace(/\D/g,'');
>
>   var x_exp_date  =
> $('#p_cc_exp_month').val()+$('#p_cc_exp_year').val();
>
>   var x_amount=
> $('input[name=x_amount]:checked').val();
>   var x_first_name=   $('#x_first_name').val();
>   var x_last_name =   $('#x_last_name').val();
>   var x_address   =   $('#x_address').val();
>   var x_city  =   $('#x_city').val();
>   var x_state =   $('#x_state').val();
>   var x_zip   =   $('#x_zip').val();
>   var x_email =   $('#x_email').val();
>
>   values  =   {   x_login:x_login,
>   x_tran_key: x_tran_key,
>   x_relay_response:   x_relay_response,
>   x_type: x_type,
>   x_method:   x_method,
>   x_description:  x_description,
>   x_card_num: x_card_num,
>   x_exp_date: x_exp_date,
>   x_amount:   x_amount,
>   x_first_name:   x_first_name,
>   x_last_name:x_last_name,
>   x_address:  x_address,
>   x_city: x_city,
>   x_state:x_state,
>   x_zip:  x_zip,
>   x_email:x_email
> }
>
>   $.ajax  ({  cache:  false,
>   type:   'post',
>   url:
> 'https://test.authorize.net/gateway/transact.dll',
>   dataType:   'json',
>   data:   values,
>
>   beforeSend: function() {
>
>   
> $('#processing_image').fadeIn(250);
>   
> $('#processing_text').fadeIn(250);
>
>   },
>
>   success:function(data) {
>
> (this alert never works...) ->  alert('inside
> success callback');
>
>  var parsedData =
> data.split('|');
>
> (nothing appears in the console log ->  console.log('Data
> Response:', data, 'Parsed Response:', parsedData);
>
>  if  (
> parsedData[0] == 1  )
> (this alert doesn't show) --->  {
> alert('SUCCESS\nCode: ' + parsedData[0])}
>
> (this alert doesn't show) --->  else{
> alert('FAILURE\nCode: ' + parsedData[0] + '\nReason: ' + parsedData[3]) }
>
>
> (this is the success code I've been trying -->  //if  (
> response != '' )
>  //{
> $('#processing_image').hide();
>  //
> $('#processing_text').hide();
>  //
> $('#processing_success').fadeIn(250);
>  //
> $('#response_code').empty().append(response); }
>
>  //else{
> $('#response_code').empty().append(response); }
>
>  
>
>   

Re: cfhttp ignore SSL error

2012-09-23 Thread John M Bliss

CFX_HTTP returns "An error occurred in the secure channel support."

Any other ideas?


On Tue, Sep 11, 2012 at 12:56 PM, Dave Watts  wrote:

>
> > Suggestion as to which one...?
> >
> > http://ultrahttp.riaforge.org/
> > http://cflib.org/udf/HTTPGet
>
> Well, the second one just uses java.net.URL, it looks like, so I don't
> think it'll behave any differently. I don't know about the first one.
> There's a Windows binary, CFX_HTTP, you could try that if you're on
> Windows.
>
> Dave Watts, CTO, Fig Leaf Software
> http://www.figleaf.com/
> http://training.figleaf.com/
>
> Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
> GSA Schedule, and provides the highest caliber vendor-authorized
> instruction at our training centers, online, or onsite.
>
> 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:352731
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: Question about using AJAX with Authorize.net

2012-09-23 Thread Rick Faircloth

Hi, Jonah...

I tried incorporating your code below into my existing AJAX script,
but I got the same exact response from the form submission:
successful processing (received transaction notification and receipt)
and then the AJAX script stops functioning and does process through
the "success" function (in my script) or, if I insert your .done function
and use it instead of the success function, I get the exact same
results.

I get this message, either way, in the Firebug console in red letters:

"Post https://test.authorize.net/gateway/transact.dll 200 OK 857ms"

and at the end of that line, it references "jquery_1.7.1.min.js" as if
something in the jquery library isn't setting well with the post.

Now, let me make sure I understand: you did mean for me to use your
code below apart from cfpayment.cfc, right? (It seems to me, after
a closer look at cfpayment, that it's using CFHTTP to post the transaction
data to Authorize.net, isn't it? If so, I'm trying to avoid having
the server process the post so as to avoid strict PCI compliance
for my server. That's why I'm trying to do a direct AJAX post.

Here's my full AJAX script with your changes incorporated (after I
tried your changes unsuccessfully in the .done function).
Do you see anything wrong:

   $(document).ready(function() {

  $('#donation_form_submit').click(function() {

 var x_login =   '25F2wqnuFs';
 var x_tran_key  =   '3B58p37d9PJxUUR9';
 var x_relay_response=   'false';
 var x_type  =   'AUTH_CAPTURE';
 var x_method=   'CC';
 var x_description   =   'Donation';

 var x_card_num  =   $('#x_card_num').val();
 var x_card_num  =
x_card_num.replace(/\D/g,'');

 var x_exp_date  =
$('#p_cc_exp_month').val()+$('#p_cc_exp_year').val();

 var x_amount=
$('input[name=x_amount]:checked').val();
 var x_first_name=   $('#x_first_name').val();
 var x_last_name =   $('#x_last_name').val();
 var x_address   =   $('#x_address').val();
 var x_city  =   $('#x_city').val();
 var x_state =   $('#x_state').val();
 var x_zip   =   $('#x_zip').val();
 var x_email =   $('#x_email').val();

 values  =   {   x_login:x_login,
 x_tran_key: x_tran_key,
 x_relay_response:   x_relay_response,
 x_type: x_type,
 x_method:   x_method,
 x_description:  x_description,
 x_card_num: x_card_num,
 x_exp_date: x_exp_date,
 x_amount:   x_amount,
 x_first_name:   x_first_name,
 x_last_name:x_last_name,
 x_address:  x_address,
 x_city: x_city,
 x_state:x_state,
 x_zip:  x_zip,
 x_email:x_email
}

 $.ajax  ({  cache:  false,
 type:   'post',
 url:
'https://test.authorize.net/gateway/transact.dll',
 dataType:   'json',
 data:   values,

 beforeSend: function() {

 
$('#processing_image').fadeIn(250);
 
$('#processing_text').fadeIn(250);

 },

 success:function(data) {

(this alert never works...) ->  alert('inside
success callback');

var parsedData =
data.split('|');

(nothing appears in the console log ->  console.log('Data
Response:', data, 'Parsed Response:', parsedData);

if  (
parsedData[0] == 1  )
(this alert doesn't show) --->  {
alert('SUCCESS\nCode: ' + parsedData[0])}

(this alert doesn't show) --->  else{
alert('FAILURE\nCode: ' + parsedData[0] + '\nReason: ' + parsedData[3]) }


(this is the success code I've been trying -->  //if  (
response != '' )