Reply
Highlighted
Member
Posts: 3
Registered: ‎05-16-2017
Accepted Solution

Moving from Simple Checkout to Accept Hosted/Accept.js

I'm pretty new when it comes to Authorize.net, so please keep that in mind. We have a Simple Checkout button set up right now. We would like to switch to a solution where the customer would never leave our site and none of the sensitive information would hit our server.

 

From what I have seen, the best option would be either the Accept Hosted or Accept.js solution. Is this correct? If so, would one be better than the other?

 

I have tried setting up the demo from Github (https://github.com/AuthorizeNet/accept-sample-app), but had issues getting it to work and found the documentation lacking.

 

Any help would be greatly appreciated! Thanks!


Accepted Solutions
Solution
Accepted by topic author justinVortex
‎05-19-2017 01:13 PM
Posts: 146
Topics: 0
Kudos: 28
Blog Posts: 0
Ideas: 0
Solutions: 10
Registered: ‎04-28-2017

Re: Moving from Simple Checkout to Accept Hosted/Accept.js

500 errors? Oh my, that's a lot of errors. Just kidding. A 500 error on your index.php could be caused by simple syntax errors, extra characters, incorrect file permissons or your .htaccess file.

 

If you are developing locally you could put 

ini_set('display_errors', 1);

at the top of your index.php, below <?php,  to get more information.  

 

When it redirects to login, you can open up the console on Chrome by right clicking on the page and selecting Inspect and click on the Console tab, Inspect Element on FireFox. There you should see some resources that have failed to load or other error messages.

 

Are you running the example on https:? 

 

Also be sure to:

SetEnv API_LOGIN_ID your_id
SetEnv TRANSACTION_KEY your_key  

in your httpd.conf  or .htaccess file.

 

Powered by NexWebSites.com -
Certified Authorize.net developers

View solution in original post


All Replies
Posts: 146
Topics: 0
Kudos: 28
Blog Posts: 0
Ideas: 0
Solutions: 10
Registered: ‎04-28-2017

Re: Moving from Simple Checkout to Accept Hosted/Accept.js

[ Edited ]

Hi,

 

What were the issues you encountered trying to use the Accept Hosted method?

 

Accept.js sends payment information directly to Authorize.Net, which returns a payment nonce (a number representing the payment information that may only be used once).

Your application's client function then posts the nonce back to your server application along with all the other order information. Your server application uses the nonce to replace the payment details in standard Authorize.Net API calls.


Authorize.Net Accept Hosted calls the API method getHostedPaymentPageRequest. The API response contains a form-validation token.

Using the form-validation token returned above, you can embed the payment form or redirect the customer to the payment form by sending an HTML form post to https://accept.authorize.net/payment/payment ...

Your customer then fills in the payment form. The transaction is processed when they submit the form, your customer then returns to your site, and you display a result page based on the url followed or the response information sent.

Powered by NexWebSites.com -
Certified Authorize.net developers
Member
Posts: 3
Registered: ‎05-16-2017

Re: Moving from Simple Checkout to Accept Hosted/Accept.js

Thank you for the response!

 

I downloaded the demo from Github, uploaded it to our site, and added my Sandbox API credentials, but I've been getting 500 errors on the index.php and "include" errors for some of the files. Even if I don't get those errors, it redirects to login.php and I try entering a customer profile ID, which I had set up in my Sandbox account, but it says it is invalid.

 

Is there a step or something that I'm missing?

 

Thanks!

Solution
Accepted by topic author justinVortex
‎05-19-2017 01:13 PM
Posts: 146
Topics: 0
Kudos: 28
Blog Posts: 0
Ideas: 0
Solutions: 10
Registered: ‎04-28-2017

Re: Moving from Simple Checkout to Accept Hosted/Accept.js

500 errors? Oh my, that's a lot of errors. Just kidding. A 500 error on your index.php could be caused by simple syntax errors, extra characters, incorrect file permissons or your .htaccess file.

 

If you are developing locally you could put 

ini_set('display_errors', 1);

at the top of your index.php, below <?php,  to get more information.  

 

When it redirects to login, you can open up the console on Chrome by right clicking on the page and selecting Inspect and click on the Console tab, Inspect Element on FireFox. There you should see some resources that have failed to load or other error messages.

 

Are you running the example on https:? 

 

Also be sure to:

SetEnv API_LOGIN_ID your_id
SetEnv TRANSACTION_KEY your_key  

in your httpd.conf  or .htaccess file.

 

Powered by NexWebSites.com -
Certified Authorize.net developers
Member
Posts: 3
Registered: ‎05-16-2017

Re: Moving from Simple Checkout to Accept Hosted/Accept.js

Thanks! I think this will be a big help.

 

I didn't know you could add the API credentials into the htaccess.

 

I'm going to mark this as resolved for now, as I have a bit more work to do with it, but I may have some more debugging to do later on.