Payment Gem Error

I am learning how to use the payment gem to process credit cards. I
think I have everything up and running correctly but I get this error:

undefined method `use_ssl=' for #<Net::HTTP secure.authorize.net:443

open=false>

Would anyone have an idea what would cause that?

Thanks,
will clark // graphic design
www.willclarkdesigns.com/

[email protected]
559 | 584 6785
559 | 380 2731 [ facsimile ]

I get the same errors as well. This is on Windows.

I think it might be due to the way the Net:HTTP object is created. It is
created first, then Net::HTTP.use_ssl is called, but this method does
not exist. There should be a way for Payment to check the URL first,
then decide it needs to create a Net:HTTPS object instead.

That, or there is something really wrong with the Windows One-Click
Net:HTTP library.

Will C. wrote:

I am learning how to use the payment gem to process credit cards. I
think I have everything up and running correctly but I get this error:

undefined method `use_ssl=’ for #<Net::HTTP secure.authorize.net:443
open=false>

Would anyone have an idea what would cause that?

Thanks,
will clark // graphic design
www.willclarkdesigns.com/

[email protected]
559 | 584 6785
559 | 380 2731 [ facsimile ]

Well, I found, with the help of a friend, that the problem was on my
end.
I had typed:

require ‘payment/authorize_net’

This was how it was listed in the README file. But when I just
required ‘payment’, everything worked perfectly.

I suppose as more payment gateways are added to the Payment Gem, then
it may be necessary to specify which one. But that’s how I got it to
work.

I even noticed this little article (http://www.onrails.org/articles/
2005/12/03/an-on-line-store-build-with-ruby-on-rails) they also used
require ‘payment’

Hope this helps,
will clark // graphic design
www.willclarkdesigns.com/

[email protected]
559 | 584 6785
559 | 380 2731 [ facsimile ]

Cool, thanks.

I think I might check out ActiveMerchant, though:
http://home.leetsoft.com/am

Its (pardon the pun!) Actively developed and in-use by a production
site, http://shopify.com/

I fixed this error by commenting out the following line in payment.rb

require ‘net/http’

I theorized that when payment was figuring out which Net::HTTP object to
instantiate, it was using the one from ‘net/http’ and not ‘net/https’,
which provides the use_ssl function. Confusing, yes.

Will C. wrote:

I am learning how to use the payment gem to process credit cards. I
think I have everything up and running correctly but I get this error:

undefined method `use_ssl=’ for #<Net::HTTP secure.authorize.net:443
open=false>

Would anyone have an idea what would cause that?

Thanks,
will clark // graphic design
www.willclarkdesigns.com/

[email protected]
559 | 584 6785
559 | 380 2731 [ facsimile ]

Yeah, I think it is worth the investigation.

One of the creators of Shopify created the ActiveMerchant gem I do
believe.

Good luck,
will clark // graphic design
www.willclarkdesigns.com/

[email protected]
559 | 584 6785
559 | 380 2731 [ facsimile ]

Hi will clark,

I want to learn “how to use payment gem”. can you refer an pdf’s or
links.

Will C. wrote:

I am learning how to use the payment gem to process credit cards. I
think I have everything up and running correctly but I get this error:

undefined method `use_ssl=’ for #<Net::HTTP secure.authorize.net:443
open=false>

Would anyone have an idea what would cause that?

Thanks,
will clark // graphic design
www.willclarkdesigns.com/

[email protected]
559 | 584 6785
559 | 380 2731 [ facsimile ]