drhenner / ror_ecommerce

Ruby on Rails Ecommerce platform, perfect for your small business solution.
www.ror-e.com
MIT License
1.21k stars 409 forks source link

AuthNet Checkout Problems #111

Closed DTwigs closed 11 years ago

DTwigs commented 11 years ago

Hey there, I just put in my environment variables for AuthNet and I was wondering if there is anything I need to change in the code to get it to work. It does not seem to think the CC information is valid. I believe it's having trouble with AuthNet but I'm not sure how to even tell if this is the case.

drhenner commented 11 years ago

Can you give me the full error message? I just landed in SF

drhenner commented 11 years ago

change this in production.rb

::GATEWAY = ActiveMerchant::Billing::AuthorizeNetGateway.new(
  :login    => Settings.authnet.login,
  :password => Settings.authnet.password,
  :test     => true
)

to

::GATEWAY = ActiveMerchant::Billing::AuthorizeNetGateway.new(
  :login    => Settings.authnet.login,
  :password => Settings.authnet.password,
  :test     => false
)

I assume you have these set on heroku:

authnet:
  login:      <%= ENV['AUTHNET_LOGIN'] %>
  password:   <%= ENV['AUTHNET_PASSWORD'] %>
DTwigs commented 11 years ago

All I did on heroku was "heroku config:add AUTHNET_LOGIN=something" and "heroku config:add AUTHNET_PASSWORD=something". Where would I do the last thing you mentioned? That seems to already been in Settings.yml.

Also there didn't seem to be any error in the console. I checked @creditcard.is_valid? and it was false so it seemed to just go the path where it said something like "Could Not Process Credit Card".

drhenner commented 11 years ago

I'll give it a stab tonight.

The second part is already complete. I just meant heroku config:add AUTHNET_LOGIN=something

::GATEWAY = ActiveMerchant::Billing::AuthorizeNetGateway.new(
  :login    => Settings.authnet.login,
  :password => Settings.authnet.password,
  :test     => false
)

This part you need to switch :test => true to :test => false

DTwigs commented 11 years ago

Hmm, that didn't seem to do the trick. I even had my Authnet account in testmode and not in testmode. Thanks for taking a look at this tonight.

drhenner commented 11 years ago

I have to say it worked without an issue for me. I have had issues with the same response from authorize.net when authorize wasn't set up correctly. If you get me more info I'll do my best to help.

Was this working locally for you?

DTwigs commented 11 years ago

Not working locally. Is there a way I can determine whether its on AuthNets side or in my code? I have never set up an AuthNet account so maybe it's not set up correctly. Thanks for making sure it works on your end.

drhenner commented 11 years ago

Try to put the authorize codes in locally. I'm not sure what you have modified but I made no changes to the code to get it working locally. Try a new install of the repo locally and see if it works.

drhenner commented 11 years ago

this is the confirmation locally for my authorize account locally...

***** TEST MODE *****

**Please DO NOT REPLY to this message. E-mail developer@authorize.net if you have any questions.

========= SECURITY STATEMENT ========== It is not recommended that you ship product(s) or otherwise grant services relying solely upon this e-mail receipt.

========= GENERAL INFORMATION =========

Merchant : xxxxxxxxxxxxxx.com (292259) Date/Time : 24-Sep-2013 21:25:06 PDT

========= ORDER INFORMATION ========= Invoice : Description : Amount : 64.25 (USD) Payment Method : Visa Type : Authorization Only

============== RESULTS ============== Response : This transaction has been approved. Authorization Code : 000000 Transaction ID : 0 Address Verification : AVS Not Applicable

==== CUSTOMER BILLING INFORMATION === Customer ID : First Name : David Last Name : Henner Company : Address : xxxx Street City : Oakland State/Province : CA Zip/Postal Code : 94612 Country : US Phone : Fax : E-Mail : drhenner@yahoo.com

==== CUSTOMER SHIPPING INFORMATION === First Name : Last Name : Company : Address : City : State/Province : Zip/Postal Code : Country :

drhenner commented 11 years ago

This isn't going to help but I admit I really sympathize setting up authorize. The last time I had to do it, it took a couple days. I had one small issue and their UI is less than friendly

deanpcmad commented 11 years ago

Can you not use Stripe? It really does make taking card payments easy

On 25 Sep 2013, at 06:41, "D. R. Henner" notifications@github.com wrote:

this is the confirmation locally for my authorize account locally...

***** TEST MODE *****

**Please DO NOT REPLY to this message. E-mail developer@authorize.net if you have any questions.

========= SECURITY STATEMENT ========== It is not recommended that you ship product(s) or otherwise grant services relying solely upon this e-mail receipt.

========= GENERAL INFORMATION =========

Merchant : xxxxxxxxxxxxxx.com (292259) Date/Time : 24-Sep-2013 21:25:06 PDT

========= ORDER INFORMATION ========= Invoice : Description : Amount : 64.25 (USD) Payment Method : Visa Type : Authorization Only

============== RESULTS ============== Response : This transaction has been approved. Authorization Code : 000000 Transaction ID : 0 Address Verification : AVS Not Applicable

==== CUSTOMER BILLING INFORMATION === Customer ID : First Name : David Last Name : Henner Company : Address : xxxx Street City : Oakland State/Province : CA Zip/Postal Code : 94612 Country : US Phone : Fax : E-Mail : drhenner@yahoo.com

==== CUSTOMER SHIPPING INFORMATION === First Name : Last Name : Company : Address : City : State/Province : Zip/Postal Code : Country :

— Reply to this email directly or view it on GitHub.

drhenner commented 11 years ago

@deanperry I don't think Stripe is supported in many countries outside the US... That said if it is available for @DTwigs then check out https://github.com/drhenner/stripe_commerce

deanpcmad commented 11 years ago

It's live in the UK & Ireland with more places being available soon :)

On 25 Sep 2013, at 15:28, "D. R. Henner" notifications@github.com wrote:

@deanperry I don't think Stripe is supported in many countries outside the US... That said if it is available for @DTwigs then check out https://github.com/drhenner/stripe_commerce

— Reply to this email directly or view it on GitHub.

DTwigs commented 11 years ago

I alright bought an AuthNet account unfortunately. I just wish I knew whether it was my AuthNet account that is having trouble or the connection to AuthNet. I'm going to futz with it tonight. If I find a solution and it seems relevant to others, I'll post it here.

drhenner commented 11 years ago

Can you give me access to your source code? Ill download it with the authorize keys I have and see what happens... If you didn't make any changes lets try to get on Skype. My username is drhenner1.

DTwigs commented 11 years ago

I'm working till 6 PST. I can skype after that.

Here is my repository. I just added you as a collaborator so you should have access. https://github.com/DTwigs/RogueRoasters

DTwigs commented 11 years ago

Actually I just dug in deep and found out i am getting a response code of 13 which means either my API keys are wrong or my account is invalid. No idea why but at least I know where the problem is.

drhenner commented 11 years ago

I just checked your repo out in development...

I changed config/environments/development.rb to rogueroasters1

:

ActiveMerchant::Billing::Base.mode = :test
#::GATEWAY = ActiveMerchant::Billing::PaypalGateway.new(
#  :login      => Settings.paypal.login
#  :password   => Settings.paypal.password
#  :signature  => Settings.paypal.signature
#)

::GATEWAY = ActiveMerchant::Billing::AuthorizeNetGateway.new(
  :login    => Settings.authnet.login,
  :password => Settings.authnet.password,
  :test     => false   #  Make sure this is pointing to the authnet test server.  This needs to be uncommented to test capturing a payment.
)
drhenner commented 11 years ago

This means in production

you need to comment out:

ActiveMerchant::Billing::Base.mode = :test

if your account is live it should be working... i only have a test account so I can't test production

drhenner commented 11 years ago

Did you find out anything that I could put in the readme? Authorize.net can be painful

DTwigs commented 11 years ago

Most of it was bank stuff. I didn't have a merchant provider services hooked up to my merchant account. But yeah, once that was in place, it worked once I commented out ActiveMerchant::Billing::Base.mode = :test so that it pointed to the non-test url.