Git Product home page Git Product logo

spree_gateway's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spree_gateway's Issues

Payment Methods list shows Saferpay not Spree::Gateway::Saferpay

I am integrating the Saferpay gateway with my Spree instance, but am experiencing a few hurdles.

I started by writing a 'saferpay' gem, so I can leverage this gem in other apps. I wrapped this gem in an ActiveMerchant gateway as ActiveMerchant::Billing::SaferpayGateway, and in turn wrapped the ActiveMerchant gateway in 'spree_gateway' as Spree::Gateway::SaferpayGateway.

I have added all three gems to my Spree app's Gemfile using references to the respective Git repos. For example:

gem 'saferpay', git: 'xxx'
gem 'activemerchant', git: 'xxx'
gem 'spree_gateway', git: 'xxx'

When I try to add a new Payment Method in the admin area of my Spree app, the Saferpay option appears as 'Saferpay' and not 'Spree::Gateway::Saferpay'. If I submit the form, it says:

NoMethodError in Spree::Admin::PaymentMethodsController#create
undefined method `new' for Saferpay:Module

I can resolve this issue by removing the 'saferpay' gem from my Spree app's Gemfile, which shows 'Spree::Gateway::Saferpay' in the list of gateways and allows me to create the payment method. Unfortunately this resolution leads to being unable to pay during checkout, because the underlying 'saferpay' gem with the logic for talking to Saferpay is nowhere to be found (because I had to comment it out).

I tried adding a 'require: false' suffix to the 'saferpay' gem reference in the Gemfile but this didn't solve the initial problem when creating the payment method.

Is there a way to include the 'saferpay' gem but have the gateway list in the Payment Methods form show 'Spree::Gateway::Saferpay' rather than just 'Saferpay'?

This issue seems similar to this old mailing list reference to Spree and Braintree: http://www.mailinglistarchive.com/html/[email protected]/2011-03/msg00407.html

Credit card field not always show when choosing a gateway

In the checkout process, if a gateway is already selected when the page load, the credit card field is not showed. The customer has to click on the already selected payment method or click on another one and then click on the first one.

It usually happens when the customer entered a wrong credit card number but it happened to me also when the payment method was already used and was selected by default.

I did a screencast here to show the error :

https://vimeo.com/49185732

I'm not sure if it's a bug in Spree or in Spree_Gateway.

Braintree gateway sets amex cards to nil cc_type

In def update_card_number(source, cc) of app/models/spree/gateway/braintree_gateway.rb the call to source.set_card_type happens after the source.number is transformed into a "safe" version. This causes amex cards to be saved with a nil cc_type.

If one switches lines 53 and 54 so that source.set_card.type happens before the number is converted, the cc_type saves properly.

can not create payment method successful

I want create a payment method in admin page.
It always says " Name can't be blank" error.

But in fact i have input the name.

It's so strange seems don't pass name to model.

when run "rails c", i found a strange problem.

Spree::Gateway.new({"name" => "Credit Card"}), but the instance name attribute don't set.
My spree version is 1.0.4.

Any body know why?
Thanks

$rails c
Loading development environment (Rails 3.1.3)

ruby-1.9.2-p290 :002 > Spree::Gateway.new({"name" => "Credit Card"})
 => #《Spree::Gateway id: nil, type: "Spree::Gateway", name: nil, 
description: nil, active: true, environment: "development", 
created_at: nil, updated_at: nil, deleted_at: nil, display_on: nil》

Released as a gem?

I feel very dumb right now, but i'm trying to upgrade to spree 1.0-stable and am not able to install this gem.

$ gem install spree_gateway
ERROR:  Could not find a valid gem 'spree_gateway' (>= 0) in any repository

Is this gem hosted in a different repository? Am I going crazy?
Any pointers would be great. Thanks.

Dumb Question With Stripe

I am trying to implement Stripe in my Spree installaton, but I have no idea how to set it up.

I have all this:
Screenshot

Where do I put my API keys and such? I have found absolutely no documentation for this.

Thanks!

Assets not loading

Currently using Spree 1.1.0 and Ruby 1.9.3.

After installing the gem

$ bundle install
$ rails g spree_gateway:install

I'm getting the following error when I visit the admin area:

ActionView::Template::Error (couldn't find file 'admin/spree_gateway'
(in /Users/ryan/projects/spree/app/assets/stylesheets/admin/all.css:14)):
15: %>
16: <% end %>
17:
18: <%= stylesheet_link_tag 'admin/all' %>
19: <%= javascript_include_tag 'admin/all' %>
20: <%= javascript_tag do -%>
21: jQuery.alerts.dialogClass = 'spree';
app/middleware/flash_session_cookie_middleware.rb:17:in `call'

sagepay configuration

I have created a simulator account on sagepay. I have vendor name, login and password. But I am confused what should be enter in account while adding payment method.
I have tried vendor name in login and account both but received error "Payment could not be processed, please check the details you entered". Same error I got when i entered vendor name in username and blank in account.

Authorize.net Gateway goes from 'Payment' state to 'Complete', no 'Confirm'

+) Applies to Spree v.1.3.2
+) Using Ruby v.1.9.3p194, Rails v.3.2.11
+) Install gems:

gem 'jquery-rails', '~> 2.1.4'
gem 'therubyracer'
gem 'spree', git: 'git://github.com/spree/spree.git', branch: '1-3-stable'
gem 'spree_auth_devise', git: 'git://github.com/spree/spree_auth_devise.git', branch:   '1-3-stable'
gem 'spree_gateway', git: 'git://github.com/spree/spree_gateway.git', branch: '1-3-stable'```

+) Configure authorize.net with sandbox credentials in Admin, set to 'live', test box
unchecked.

+) Put some items in cart, go to Checkout, fill out Address, Delivery
+) Continue to 'Payment', enter card, exp. date, ccv, click 'Continue'
+) Checkout goes to 'Complete' and bypasses 'Confirm' state
+) No errors in output

   Jet

Support for API key instead of login

Seems this might need to be pushed down to active_merchant.

Would be better to not have to provide web login and instead provide API key for Stripe, as with other providers.

Stripe Gateway Error: You must supply either a card or a customer id

I am trying to get Stripe payments setup but I get the following error on this page http://localhost:3000/checkout/confirm when clicking the Place Order button

Gemfile:

gem 'spree', '2.0.3'
gem 'spree_auth_devise', :github => 'spree/spree_auth_devise', :branch => '2-0-stable'
gem 'devise-encryptable'
gem 'spree_gateway', :github => 'spree/spree_gateway', :branch => '2-0-stable'
gem 'spree_paypal_express', :github => 'spree/spree_paypal_express', :branch => '2-0-stable'
gem 'spree_static_content', :github => 'spree/spree_static_content', :branch => '2-0-stable'
gem 'spree_reviews', :github => 'spree/spree_reviews', :branch => '2-0-stable'

Error message:

Gateway Error
  --- !ruby/object:ActiveMerchant::Billing::Response
params:
  error:
    type: invalid_request_error
    message: You must supply either a card or a customer id
message: You must supply either a card or a customer id
success: false
test: false
authorization:
fraud_review:
avs_result:
  code:
  message:
  street_match:
  postal_match:
cvv_result:
  code:
  message:

I have used the following settings:
PROVIDER: Stripe
LOGIN: sk_test_the-rest-of-my-key-was-here
CURRENCY: USD
SERVER: test
TEST MODE: Ticked
ENVIRONMENT: Development
DISPLAY: Both

Thanks for any help
Sam

failings specs and coverage

The current master and 1-2-stable even have failing test and some gateways are not tested at all.. will eat my hard out and try to provide pull requests.. just filing this issue to make sure it's not forgotten :)

USA Epay is capturing credit card numbers in the logfile

The SavonRB gem logs the SOAP information without any filtering, so the credit card numbers and CVV codes are captured (see the end of the last line in the logs below).

2013-05-24T02:12:03.087080+00:00 app[web.1]: Started PUT "/checkout/update/payment" for 98.169.104.89 at 2013-05-24 02:12:03 +0000
2013-05-24T02:12:04.683626+00:00 app[web.1]: HTTPI executes HTTP GET using the net_http adapter
2013-05-24T02:12:06.793449+00:00 app[web.1]: SOAP request: https://www.usaepay.com/soap/gate/DFBAABC3
2013-05-24T02:12:06.793707+00:00 app[web.1]: SOAPAction: "urn:ueSoapServerAction", Content-Type: text/xml;charset=UTF-8, Content-Length: 1230
2013-05-24T02:12:06.793844+00:00 app[web.1]: <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:typens="urn:usaepay" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ins0="urn:usaepay"><env:Body><typens:addCustomer><Token><ClientIP>10.87.95.122</ClientIP><PinHash><Seed>201352428</Seed><Type>sha1</Type><HashValue>008e3ca555f7d478aa4604d02d1e149c8db524b9</HashValue></PinHash><SourceKey>C022Bsn6K1104zd1I4CoAUj6F5m925Bh</SourceKey></Token><CustomerData><Amount>38.9</Amount><Enabled>false</Enabled><BillingAddress><FirstName>pete</FirstName><LastName>campbell</LastName><Email>[email protected]</Email><Phone>7033191805</Phone><Street>10703 miller road</Street><Street2></Street2><City>oakton</City><State>VA</State><Country>US</Country><Zip>22124</Zip></BillingAddress><PaymentMethods><PaymentMethod><MethodType>CreditCard</MethodType><MethodName>visa</MethodName><SecondarySort>1</SecondarySort><CardNumber>4111111111111111</CardNumber><CardExpira

2013-05-24T02:12:06.793844+00:00 app[web.1]: tion>051612310703 miller road22124/typens:addCustomer/env:Body/env:Envelope

There seems to be no way of disabling logging or filtering the logs in SavonRB.

Since this seems (to me) to be pretty critical, and because there are many ways of fixing this, I have not tried to create a patch, leaving the solution to someone with more experience in this codebase.

  • spree (1.3.3.beta 1fa0ba6)
  • spree_active_shipping (1.1.0 350857e)
  • spree_api (1.3.3.beta)
  • spree_auth_devise (1.0.0 3a43e27)
  • spree_cmd (1.3.3.beta)
  • spree_core (1.3.3.beta)
  • spree_dash (1.3.3.beta)
  • spree_gateway (1.2.0.rc2 b13d777)

MYSQL2 error when migrating

I am getting an error when running rake db:migrate RAILS_ENV=development

Here's the trace:

Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key LIKE 'spree/gateway/stripe_gateway/login%')' at line 1: SELECT `spree_preferences`.* FROM `spree_preferences`  WHERE (key LIKE 'spree/gateway/stripe_gateway/login%')/Users/marcus/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:286:in `query'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:286:in `block in execute'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract_adapter.rb:425:in `block in log'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-4.0.0/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract_adapter.rb:420:in `log'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:286:in `execute'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-4.0.0/lib/active_record/connection_adapters/mysql2_adapter.rb:220:in `execute'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-4.0.0/lib/active_record/connection_adapters/mysql2_adapter.rb:224:in `exec_query'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-4.0.0/lib/active_record/connection_adapters/mysql2_adapter.rb:233:in `select'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/database_statements.rb:24:in `select_all'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/query_cache.rb:63:in `select_all'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-4.0.0/lib/active_record/querying.rb:36:in `find_by_sql'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-4.0.0/lib/active_record/relation.rb:585:in `exec_queries'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-4.0.0/lib/active_record/relation.rb:471:in `load'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-4.0.0/lib/active_record/relation.rb:220:in `to_a'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-4.0.0/lib/active_record/relation/delegation.rb:12:in `each'
/Users/marcus/Sites/missbrache/store/db/migrate/20131114020420_migrate_stripe_preferences.spree_gateway.rb:4:in `up'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-4.0.0/lib/active_record/migration.rb:574:in `exec_migration'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-4.0.0/lib/active_record/migration.rb:555:in `block (2 levels) in migrate'
/Users/marcus/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/benchmark.rb:280:in `measure'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-4.0.0/lib/active_record/migration.rb:554:in `block in migrate'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:294:in `with_connection'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-4.0.0/lib/active_record/migration.rb:553:in `migrate'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-4.0.0/lib/active_record/migration.rb:709:in `migrate'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-4.0.0/lib/active_record/migration.rb:959:in `block in execute_migration_in_transaction'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-4.0.0/lib/active_record/migration.rb:1007:in `ddl_transaction'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-4.0.0/lib/active_record/migration.rb:958:in `execute_migration_in_transaction'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-4.0.0/lib/active_record/migration.rb:920:in `block in migrate'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-4.0.0/lib/active_record/migration.rb:916:in `each'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-4.0.0/lib/active_record/migration.rb:916:in `migrate'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-4.0.0/lib/active_record/migration.rb:764:in `up'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-4.0.0/lib/active_record/migration.rb:742:in `migrate'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-4.0.0/lib/active_record/railties/databases.rake:42:in `block (2 levels) in '
/Users/marcus/.rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/task.rb:236:in `call'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/task.rb:236:in `block in execute'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/task.rb:231:in `each'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/task.rb:231:in `execute'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/task.rb:175:in `block in invoke_with_call_chain'
/Users/marcus/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/task.rb:168:in `invoke_with_call_chain'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/task.rb:161:in `invoke'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/application.rb:149:in `invoke_task'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/application.rb:106:in `each'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/application.rb:106:in `block in top_level'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/application.rb:115:in `run_with_threads'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/application.rb:100:in `top_level'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/application.rb:78:in `block in run'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/lib/rake/application.rb:75:in `run'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448@global/gems/rake-10.1.0/bin/rake:33:in `'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448/bin/rake:23:in `load'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448/bin/rake:23:in `'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448/bin/ruby_noexec_wrapper:14:in `eval'
/Users/marcus/.rvm/gems/ruby-1.9.3-p448/bin/ruby_noexec_wrapper:14:in `'

Gemfile:

source 'https://rubygems.org'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0'

gem 'mysql2'

gem 'twitter-bootstrap-rails', 
    :git => 'git://github.com/seyhunak/twitter-bootstrap-rails.git',
    :branch => 'bootstrap3'

# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'

gem 'less-rails', '~> 2.3.3'
gem 'therubyracer'

# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'

# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'

# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'

# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'

# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'

group :doc do
  # bundle exec rake doc:rails generates the API under doc/api.
  gem 'sdoc', require: false
end

# Rails 4 support for spree_variant_options
gem 'protected_attributes'

# Use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# Use unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano', group: :development

# Use debugger
# gem 'debugger', group: [:development, :test]

gem 'spree', github: 'spree/spree', branch: '2-1-stable'
gem 'spree_gateway', :git => 'https://github.com/spree/spree_gateway.git', :branch => '2-1-stable'
gem 'spree_auth_devise', :git => 'https://github.com/spree/spree_auth_devise.git', :branch => '2-1-stable'
gem "spree_social_products", :git => "git://github.com/spree/spree_social_products.git", :branch => '2-1-stable'
#gem 'spree_static_content', :github => 'spree/spree_static_content'
gem 'spree_related_products', :git => 'git://github.com/spree/spree_related_products.git', :branch => '2-1-stable'
gem 'spree_variant_options', :git => 'git://github.com/marcus30/spree_variant_options.git'
#gem 'spree_wishlist', :git => 'git://github.com/spree/spree_wishlist.git', :branch => '2-1-stable'
gem 'spree_active_shipping', :git => 'git://github.com/spree/spree_active_shipping.git', :branch => '2-1-stable'
#gem 'spree_print_shipping_label', :git => 'git://github.com/geermc4/spree_print_shipping_label.git', :branch => '2-1-stable'
gem 'spree_tax_cloud', :git => 'git://github.com/bluehandtalking/spree_tax_cloud.git'
#gem 'fedex', :git => 'git://github.com/geermc4/fedex.git'

Spree 1.3 authorize_net_cim.rb, phone number field blank in Authorize.net report

In Spree 1.3,

+) Go through Checkout process filling out all information
+) On Payment page, choose authorize.net fill in credit card information
(assumed that authorize.net is using cim)
+) Click 'Save and Continue'
+) Go to Confirm page and finish transaction
+) Go to Authorize.net and check report
+) In billing information, phone number field is blank

in authorize_net_cim.rb is the following for generating the billing address information:

 def options_for_create_customer_profile(payment)
    if payment.is_a? CreditCard
      info = { :bill_to => generate_address_hash(payment.address), :payment => { :credit_card => payment } }
 ...deleted for brevity
       def generate_address_hash(address)
           return {} if address.nil?
           {:first_name => address.firstname, :last_name => address.lastname, :address1 => address.address1, :address2 => address.address2, :city => address.city,
     :state => address.state_text, :zip => address.zipcode, :country => address.country.iso, :phone => address.phone}
      end

So the phone number is in the hash, but this is not getting saved in the authorize.net report

"No such file or directory" when creating Gateway from factory

During my integration tests, I'll intermittently get this error:

No such file or directory - (/var/lib/jenkins/workspace/production/tmp/cache/spree%2Fgateway%2Fstripe%2Ftest_mode%2F120130515-15088-h1cg4b, /var/lib/jenkins/workspace/production/tmp/cache/E12/520/spree%2Fgateway%2Fstripe%2Ftest_mode%2F1)

   # ./spec/support/factories.rb:12:in `block (3 levels) in <top (required)>'

Any thoughts on what this could be? It seems to happen when setting preferences in my factories:

  factory :stripe_test, :class => Spree::Gateway::Stripe do
    name "Credit Card (Stripe Test)"
    environment "test"
    after_create do |c, e|
      c.set_preference(:login, "sk_test_XXXXX")
      c.set_preference(:server, "test")
      c.set_preference(:test_mode, 1)
    end
  end

Any thoughts?

Braintree gem not found on fresh install

Neither spree nor spree_gateway pulls braintree even though activemerchant requires it, and even after manually pulling it, activemerchant still throws an exception indicating it can't be found. Workaround is to specify braintree in the apps gemfile.

Steps to reproduce on Windows 7:

  1. Install fresh rubygems and rails using RailsInstaller
  2. Follow tutorial instructions at http://guides.spreecommerce.com/developer/getting_started_tutorial.html
  3. In backend, create or modify a payment method to use the BrainTree gateway, and enter in BrainTree sandbox account details.
  4. Create a new order and attempt to use the new BrainTree payment method.

Authorize.net Void Broken

Trying to void a payment via the admin using the AuthorizeNetCIM gateway results in the following error:

ArgumentError (wrong number of arguments (2 for 3)):
  /data/spree/shared/bundle/ruby/1.9.1/bundler/gems/spree_gateway-1d598d08d4e2/app/models/spree/gateway/authorize_net_cim.rb:46:in `void'
  spree_core (1.1.1) app/models/spree/payment/processing.rb:53:in `block in void_transaction!'
  spree_core (1.1.1) app/models/spree/payment/processing.rb:163:in `protect_from_connection_error'
  spree_core (1.1.1) app/models/spree/payment/processing.rb:50:in `void_transaction!'
  spree_core (1.1.1) app/controllers/spree/admin/payments_controller.rb:58:in `fire'
  actionpack (3.2.3) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
  actionpack (3.2.3) lib/abstract_controller/base.rb:167:in `process_action'
  actionpack (3.2.3) lib/action_controller/metal/rendering.rb:10:in `process_action'
  actionpack (3.2.3) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
  activesupport (3.2.3) lib/active_support/callbacks.rb:525:in `block in _run__1628437934406065079__process_action__314863166698899349__callbacks'
  activesupport (3.2.3) lib/active_support/callbacks.rb:215:in `block in _conditional_callback_around_2216'
  marginalia (1.1.0) lib/marginalia/railtie.rb:30:in `record_query_comment'
  activesupport (3.2.3) lib/active_support/callbacks.rb:214:in `_conditional_callback_around_2216'
  activesupport (3.2.3) lib/active_support/callbacks.rb:414:in `_run__1628437934406065079__process_action__314863166698899349__callbacks'
  activesupport (3.2.3) lib/active_support/callbacks.rb:405:in `__run_callback'
  activesupport (3.2.3) lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
  activesupport (3.2.3) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (3.2.3) lib/abstract_controller/callbacks.rb:17:in `process_action'
  actionpack (3.2.3) lib/action_controller/metal/rescue.rb:29:in `process_action'
  actionpack (3.2.3) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
  activesupport (3.2.3) lib/active_support/notifications.rb:123:in `block in instrument'
  activesupport (3.2.3) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (3.2.3) lib/active_support/notifications.rb:123:in `instrument'
  actionpack (3.2.3) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
  actionpack (3.2.3) lib/action_controller/metal/params_wrapper.rb:205:in `process_action'
  activerecord (3.2.3) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
  newrelic_rpm (3.3.5) lib/new_relic/agent/instrumentation/rails3/action_controller.rb:34:in `block in process_action'
  newrelic_rpm (3.3.5) lib/new_relic/agent/instrumentation/controller_instrumentation.rb:257:in `block in perform_action_with_newrelic_trace'
  newrelic_rpm (3.3.5) lib/new_relic/agent/method_tracer.rb:242:in `trace_execution_scoped'
  newrelic_rpm (3.3.5) lib/new_relic/agent/instrumentation/controller_instrumentation.rb:252:in `perform_action_with_newrelic_trace'
  newrelic_rpm (3.3.5) lib/new_relic/agent/instrumentation/rails3/action_controller.rb:33:in `process_action'
  actionpack (3.2.3) lib/abstract_controller/base.rb:121:in `process'
  actionpack (3.2.3) lib/abstract_controller/rendering.rb:45:in `process'
  actionpack (3.2.3) lib/action_controller/metal.rb:203:in `dispatch'

Issue processing payments

I've having some issues getting payments processed on a new store. I'm
guessing it might be an issue with the spree gateway itself but i'm not
sure. I'm expecting the test payment to be processed but instead the following happens.

Given a vanilla install with some basic extra steps (add a zone, shipping
method, etc.) the payment fails with the following error:

"The card object must have a value for 'number'"

This happens on the confirmation step, the payment step succeeds without
issue.

Looking in the log I see the following:

Gateway Error
--- !ruby/object:ActiveMerchant::Billing::Response
params:
error:
message: The card object must have a value for 'number'.
type: card_error
param: number
code: invalid_number
message: The card object must have a value for 'number'.
success: false
test: false
authorization:
fraud_review:
avs_result:
code:
message:
street_match:
postal_match:
cvv_result:
code:
message:

I checked a bit further back in the log and the credit card details do
appear to be submitted:
Started PATCH "/checkout/update/payment" for 127.0.0.1 at 2013-10-06
16:27:28 +1100
Processing by Spree::CheckoutController#update as HTML
Parameters: {"utf8"=>"✓",
"authenticity_token"=>"ULTMChoByuqOylMyc2kVfmDUPIWsHuZk+ytf6hvkgrY=",
"order"=>{"payments_attributes"=>[{"payment_method_id"=>"6"}]},
"payment_source"=>{"6"=>{"number"=>"[FILTERED]", "expiry"=>"01 / 14",
"verification_value"=>"[FILTERED]", "cc_type"=>"visa",
"first_name"=>"Victor", "last_name"=>"Ramanauskas"}}, "state"=>"payment"}

Here is a comprehensive list of how to reproduce the issue:

Install spree(2.1 stable) as per current instructions
gem install rails -v 4.0.0 gem install spree rails _4.0.0_ new my_store spree install my_store

Create a new zone that includes Australia (for my testing purposes)
Create a shipping method for that zone, check "Default Shipping"
Add a payment method

  • Stripe Gateway (Development, "Active" checked)
    Changed currency to AUD and added Stripe API key, server is listed as "test", "Test mode" checked
    Removed all other payment methods (I tried it with leaving these there and got an error, I remember reading once(!) that you can only have 1 type of method, so I removed them as I had no need for them otherwise)
    Add item to cart
    Checkout
    Enter address details
    Enter test credit card details
  • 4242424242424242
  • 01/14
  • 123
    Reach confirmation screen, everything appears correct, Payment Information shows a Visa ending in 4242
    Click "Place Order"
    Receive message "The card object must have a value for 'number'"
    Payment Information is now blank.

$ ruby -v ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin11.4.2] $ rails -v Rails 4.0.0

Gemfile:

source 'https://rubygems.org'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0'

# Use sqlite3 as the database for Active Record
gem 'sqlite3'

# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'

# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'

# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'

# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'

# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'

# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'

group :doc do
  # bundle exec rake doc:rails generates the API under doc/api.
  gem 'sdoc', require: false
end

# Use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# Use unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano', group: :development

# Use debugger
# gem 'debugger', group: [:development, :test]

gem 'spree', '2.1.1'
gem 'spree_gateway', :git => 'https://github.com/spree/spree_gateway.git', :branch => '2-1-stable'
gem 'spree_auth_devise', :git => 'https://github.com/spree/spree_auth_devise.git', :branch => '2-1-stable'

This gist contains the relevant log entries, starting at adding the payment method: https://gist.github.com/bvpb/6859403

Cannot find gem 'spree_core (~> 2.0.0.beta) ruby'

bundle update
Updating git://github.com/spree/spree_gateway.git
Updating git://github.com/spree/spree_auth_devise.git
Fetching gem metadata from https://rubygems.org/.......
Fetching gem metadata from https://rubygems.org/..
Could not find gem 'spree_core (~> 2.0.0.beta) ruby', which is required by gem 'spree_gateway (>= 0) ruby', in any of the sources.

I tried updating all gems, still looking for 2.0.0.beta. Thoughts?

What is the purpose of the Savon gem dependency?

I noticed that Savon is a dependency for the gem but it appears that the only reason it's there is to turn logging off. Due to the dependency being on an old deprecated version of the gem, would it be advisable to remove it?

Stripe.js support

Stripe.js is a Javascript library that Stripe provides to enable merchants to avoid having credit card information pass through their servers at all. Submitting a form that uses Stripe.js sends a request to Stripe's servers, which respond back with a token that can then be submitted to the merchant's servers and used to authorize and/or capture a payment.

Spree seems currently unable to use this token correctly. I'm using Spree 2.0.5 and spree_gateway branch 2-0-stable from Git. Rails is 3.2.14. I've overridden and modified app/views/spree/checkout/payment/_gateway.html.erb to work with Stripe.js, as shown here https://stripe.com/docs/stripe.js

I assumed that the Stripe token would be a gateway_payment_profile_id, and submitted it as that field. However, this generates validation errors on the Payments page: "Payments credit card Number can't be blank" and "Payments credit card Verification Value can't be blank".

These errors are caused by a line in CreditCard:
validates :number, presence: true, unless: :has_payment_profile?, on: :create

#has_payment_profile? doesn't check whether the gateway_payment_profile_id exists (as you might think from the name), but instead is defined as:
gateway_customer_profile_id.present?

Changing #has_payment_profile? to:
gateway_customer_profile_id.present? || gateway_payment_profile_id.present?
allows the CreditCard model to validate and be created, thus taking the order on to confirmation. I can then confirm the order normally, and everything appears work correctly within Spree, and the test charge shows up in Stripe correctly.

I'm not really sure what gateway_customer_profile_id and gateway_payment_profile_id really are, as there doesn't appear to be any/much documentation on them. So I'm a bit reluctant to submit a pull request until I understand what these fields are really for, and how this change might affect other things.

I'm not even sure if this type of payment token should be saved as a CreditCard instance, but can't really see anywhere else for it to go.

Is this the right way to do this?

Here is my modified view file:

<%# _gateway.html.erb
  # Copied from Spree v 2.0.5
  # Edited to work with Stripe.js 
 %>
<%= image_tag 'credit_cards/credit_card.gif', :id => 'credit-card-image' %>
<% param_prefix = "payment_source[#{payment_method.id}]" %>

<div id='stripe-errors'></div>

<p class="field" data-hook="card_number">
  <%= label_tag "card_number", Spree.t(:card_number) %>
  <span class="required">*</span><br />
  <% options_hash = Rails.env.production? ? {:autocomplete => 'off'} : {} %>
  <input id='card_number' class='required' size=19 maxlength=19 autocomplete="off" type="text" data-stripe="number"/>
  &nbsp;
  <span id="card_type" style="display:none;">
    ( <span id="looks_like" ><%= Spree.t(:card_type_is) %> <span id="type"></span></span>
      <span id="unrecognized"><%= Spree.t(:unrecognized_card_type) %></span>
    )
  </span>
</p>
<p class="field" data-hook="card_expiration">
  <%= label_tag "card_month", Spree.t(:expiration) %><span class="required">*</span><br />
  <%= select_month(Date.today, { :prefix => param_prefix, :field_name => 'month', :use_month_numbers => true }, :class => 'required', :id => "card_month", :"data-stripe" => 'exp-month') %>
  <%= select_year(Date.today, { :prefix => param_prefix, :field_name => 'year', :start_year => Date.today.year, :end_year => Date.today.year + 15 }, :class => 'required', :id => "card_year", :"data-stripe" => 'exp-year') %>
</p>
<p class="field" data-hook="card_code">
  <%= label_tag "card_code", Spree.t(:card_code) %><span class="required">*</span><br />
  <input id='card_code' class='required' size=5 data-stripe='cvc'/>
  <%= link_to "(#{Spree.t(:what_is_this)})", spree.content_path('cvv'), :target => '_blank', "data-hook" => "cvv_link", :id => "cvv_link" %>
</p>

<script type="text/javascript" src="https://js.stripe.com/v2/"></script>

<script type="text/javascript">
  // This identifies your website in the createToken call below
  Stripe.setPublishableKey( "<%= ENV[ Rails.env.production? ? 'STRIPE_PUBLISHABLE_KEY' : 'STRIPE_TEST_PUBLISHABLE_KEY'] %>" );
  // ...
</script>

<script type='text/javascript'>
  // Handle response from Stripe when we request a payment token
  var stripeResponseHandler = function(status, response) {
    var $form = $('#<%= "checkout_form_#{@order.state}" %>');

    if (response.error) {
      // Show the errors on the form
      $form.find('#stripe-errors').text(response.error.message);
      $form.find('#stripe-errors').addClass('errorExplanation');
      $form.find('button').prop('disabled', false);
    } else {
      // token contains id, last4, and card type
      var token = response.id;
      // Insert the token into the form so it gets submitted to the server
      $form.append($('<input type="hidden" name="payment_source[1][gateway_payment_profile_id]" />').val(token));
      // and submit
      $form.get(0).submit();
    }
  };

  // Event handler for form submit button -- create a Stripe payment token
  jQuery(function($) {
    $('#<%= "checkout_form_#{@order.state}" %>').submit(function(event) {
      //alert("submit event handler; key = '<%= ENV[ Rails.env.production? ? 'STRIPE_PUBLISHABLE_KEY' : 'STRIPE_TEST_PUBLISHABLE_KEY'] %>'");
      var $form = $(this);

      event.preventDefault();
      event.stopPropagation();
      //alert("submit event handler - should have killed submission");

      // Disable the submit button to prevent repeated clicks
      $form.find('input.button.continue[type="submit"]').prop('disabled', true);

      Stripe.card.createToken($form, stripeResponseHandler);

      // Prevent the form from submitting with the default action
      return false;
    });
  });
</script>

Can not submit payments to usa_epay without payment_profiles

I am trying to submit payments to usa_epay with the spree_gateway gem version spree_gateway (2.1.0.beta) and spree version spree (1.2.4)

The gateway will not accept the payments because spree is trying to submit customer payment_profiles which is not enabled on the epay account. These are not enabled by default so i'm not sure why spree is trying to use them by default.

I have overridden the payment_profiles_supported? method in UsaEpay with this
https://gist.github.com/variousred/b78b133d7cb62e524501
setting payment_profiles_supported? to return false which leads me to this error:
https://gist.github.com/variousred/138740bba2d397c43a1c

Card number missing from SagePay

On spree 1.3.2 when I submit a payment using SagePay gateway I get:

--- !ruby/object:ActiveMerchant::Billing::Response
authorization: ..;;;;authorization
...
message: "3051 : The CardNumber field is required."
params:
VPSProtocol: "2.23"
Status: MALFORMED
StatusDetail: "3051 : The CardNumber field is required."
success: false
test: true

I have PayPal working fine but am unable to get any further with SagePay.

Capture and Void don't work with Authorize.Net

I believe this happens at least in current Spree master, 1-3-stable and 1-2-stable.

Reproduce:

Sign up for an authorize.net developer test account
Create a Spree::Gateway::AuthorizeNet payment method
Update with your API login ID (login) and Transaction Key (password)
Place an order using this payment method
Go the order in back end and click on payment tab
Press the Capture button
You should get "(TESTMODE) A valid referenced transaction ID is required."

Rails 3.2 not allowed

Spree is moving to support Rails 3.2, but spree_gateway's gemspec only allows for Rails 3.1.x

ActiveModel::MassAssignmentSecurity::Error trying to update Spree::Gateway::WorldPay entry

As discussed on Google Groups, i'm having some troubles updating payment gateway details for a WorldPay gateway - I keep getting a "Can't mass-assign protected attributes: preferred_discover_login" error.

The app is a brand new rails app, with spree 1.2.2 and spree_gateway checked out from master (I also tried the 1-2-stable branch). I have a custom User model/auth system, (using my companies single sign-on), integrated following the spree docs, but no other code at all.

Any ideas what could be happening here?

Thanks,

Daz

1-2-stable branch

Just a gently reminder that spree has a 1-2-stable branch and spree_gateway should do to :)

The VendorName is invalid or the account is not active

I keep getting the following when trying to use SagePay:

! '4000 : The VendorName is invalid or the account is not active.'

I'm not sure whether there's a problem with the code or the details I'm using, could someone please confirm exactly what details need to go in the fields in the payment method backend, i.e. what goes in login/account and where these details come from.

The login I'm using currently is a developer account.

Spree 1.0.0 and Rails 3.1.3

Change Information sent to authorize.net

Using the spree_gateway 1-3-stable (could not access that branch on github):

Currently it appears that authorize.net is not receiving information for the following:

(Categories are authorize.net descriptions)

Order Information:

+) The product description (Spree product name)

Customer Billing Information:

+) Phone number

+) E-Mail

Customer Shipping Information:

+) No customer shipping information

I say appears because at this moment I am not sure if Spree is not providing
that information, or our authorize.net reseller is just not outputting that information
in an order statement.

If it is that Spree v.3.2 is not providing the above information, what changes would I
need to make to implement the missing information?

I looked briefly at models/spree/gateway/authorize_net_cim.rb in the spree_gateway gem

and it has the following method:

 def options_for_create_customer_profile(payment)

...above appears to be billing address. How to also generate the
the shipping address?

The above method uses

 def generate_address_hash(address)

the above sets the phone:

 :phone => address.phone

However, phone is not being output in authorize.net statement.

It does not set the email. Would this be done by adding

 :email => address.email 

to the hash?

This method:

 def create_transaction(amount, creditcard, transaction_type, options = {})

appears to contain the Order Information. If that is true, how would I add a Product Description (Spree product name) to this?

Stripe Void - wrong number of arguments (3 for 2)

When I attempt to void a transaction while using Stripe as my gateway (in the admin > orders screen), I get:

wrong number of arguments (3 for 2)

/Users/ehochber/.rvm/gems/ruby-1.9.3-p194@alarmgrid/bundler/gems/spree_gateway-9053cf7b4dbf/app/models/spree/gateway/stripe.rb:42:in `void'
/Users/ehochber/.rvm/gems/ruby-1.9.3-p194@alarmgrid/bundler/gems/spree-c5194101a318/core/app/models/spree/payment/processing.rb:56:in `block in void_transaction!'
/Users/ehochber/.rvm/gems/ruby-1.9.3-p194@alarmgrid/bundler/gems/spree-c5194101a318/core/app/models/spree/payment/processing.rb:157:in `protect_from_connection_error'
/Users/ehochber/.rvm/gems/ruby-1.9.3-p194@alarmgrid/bundler/gems/spree-c5194101a318/core/app/models/spree/payment/processing.rb:50:in `void_transaction!'
/Users/ehochber/.rvm/gems/ruby-1.9.3-p194@alarmgrid/bundler/gems/spree-c5194101a318/core/app/controllers/spree/admin/payments_controller.rb:58:in `fire'

'confirm_skrill' error during Spree Checkout

I'm testing out the Bogus Gateway. I can't seem to get past the payments state in the checkout process.

on "checkout/update/payment", I get the error:

undefined method `[]' for nil:NilClass

Full Trace:

.rvm/gems/ruby-1.9.3-p194/bundler/gems/spree_gateway-3ab269a05a55/app/controllers/spree/checkout_controller_decorator.rb:36:in `confirm_skrill'
activesupport (3.2.9) lib/active_support/callbacks.rb:506:in `_run__3403971497662231797__process_action__2832325348555505657__callbacks'
activesupport (3.2.9) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.9) lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
activesupport (3.2.9) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.9) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (3.2.9) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (3.2.9) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
activesupport (3.2.9) lib/active_support/notifications.rb:123:in `block in instrument'
activesupport (3.2.9) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (3.2.9) lib/active_support/notifications.rb:123:in `instrument'
actionpack (3.2.9) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
actionpack (3.2.9) lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
activerecord (3.2.9) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (3.2.9) lib/abstract_controller/base.rb:121:in `process'
actionpack (3.2.9) lib/abstract_controller/rendering.rb:45:in `process'
actionpack (3.2.9) lib/action_controller/metal.rb:203:in `dispatch'
actionpack (3.2.9) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
actionpack (3.2.9) lib/action_controller/metal.rb:246:in `block in action'
actionpack (3.2.9) lib/action_dispatch/routing/route_set.rb:73:in `call'
actionpack (3.2.9) lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
actionpack (3.2.9) lib/action_dispatch/routing/route_set.rb:36:in `call'
journey (1.0.4) lib/journey/router.rb:68:in `block in call'
journey (1.0.4) lib/journey/router.rb:56:in `each'
journey (1.0.4) lib/journey/router.rb:56:in `call'
actionpack (3.2.9) lib/action_dispatch/routing/route_set.rb:601:in `call'
spree_core (1.3.0) lib/spree/core/middleware/redirect_legacy_product_url.rb:13:in `call'
spree_core (1.3.0) lib/spree/core/middleware/seo_assist.rb:27:in `call'
railties (3.2.9) lib/rails/engine.rb:479:in `call'
railties (3.2.9) lib/rails/railtie/configurable.rb:30:in `method_missing'
journey (1.0.4) lib/journey/router.rb:68:in `block in call'
journey (1.0.4) lib/journey/router.rb:56:in `each'
journey (1.0.4) lib/journey/router.rb:56:in `call'
actionpack (3.2.9) lib/action_dispatch/routing/route_set.rb:601:in `call'
omniauth (1.1.1) lib/omniauth/strategy.rb:177:in `call!'
omniauth (1.1.1) lib/omniauth/strategy.rb:157:in `call'
client_side_validations (3.2.1) lib/client_side_validations/middleware.rb:21:in `call'
warden (1.2.1) lib/warden/manager.rb:35:in `block in call'
warden (1.2.1) lib/warden/manager.rb:34:in `catch'
warden (1.2.1) lib/warden/manager.rb:34:in `call'
actionpack (3.2.9) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
rack (1.4.1) lib/rack/etag.rb:23:in `call'
rack (1.4.1) lib/rack/conditionalget.rb:35:in `call'
actionpack (3.2.9) lib/action_dispatch/middleware/head.rb:14:in `call'
actionpack (3.2.9) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.2.9) lib/action_dispatch/middleware/flash.rb:242:in `call'
rack (1.4.1) lib/rack/session/abstract/id.rb:205:in `context'
rack (1.4.1) lib/rack/session/abstract/id.rb:200:in `call'
actionpack (3.2.9) lib/action_dispatch/middleware/cookies.rb:341:in `call'
activerecord (3.2.9) lib/active_record/query_cache.rb:64:in `call'
activerecord (3.2.9) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
actionpack (3.2.9) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
activesupport (3.2.9) lib/active_support/callbacks.rb:405:in `_run__4062196906885955079__call__375016622962433561__callbacks'
activesupport (3.2.9) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.9) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
activesupport (3.2.9) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.9) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (3.2.9) lib/action_dispatch/middleware/reloader.rb:65:in `call'
actionpack (3.2.9) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
actionpack (3.2.9) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
actionpack (3.2.9) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.9) lib/rails/rack/logger.rb:32:in `call_app'
railties (3.2.9) lib/rails/rack/logger.rb:16:in `block in call'
activesupport (3.2.9) lib/active_support/tagged_logging.rb:22:in `tagged'
railties (3.2.9) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.9) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.1) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.9) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.4.1) lib/rack/lock.rb:15:in `call'
actionpack (3.2.9) lib/action_dispatch/middleware/static.rb:62:in `call'
railties (3.2.9) lib/rails/engine.rb:479:in `call'
railties (3.2.9) lib/rails/application.rb:223:in `call'
rack (1.4.1) lib/rack/content_length.rb:14:in `call'
railties (3.2.9) lib/rails/rack/log_tailer.rb:17:in `call'
rack (1.4.1) lib/rack/handler/webrick.rb:59:in `service'
/Users/abhiramesh/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
/Users/abhiramesh/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
/Users/abhiramesh/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'
Request

Parameters:

{"utf8"=>"✓",
 "_method"=>"put",
 "authenticity_token"=>"pJ2QMNkfLOQAOnJsFmLzYHAcIubo/NUXdEOVYa5B8Os=",
 "payment_source"=>{"931422125"=>{"number"=>"[FILTERED]",
 "month"=>"12",
 "year"=>"2012",
 "verification_value"=>"",
 "first_name"=>"",
 "last_name"=>""}},
 "state"=>"payment"}

Referencing Top-Level Constant Gateway::Stripe

If the Stripe Gem is added to the Gemfile it throws that warning. I think this is caused as the Stripe Gem as well this Extension are referencing a constant with the same name. The Stripe Gem might be needed if you want to make use of the full Stripe functionality.

I saw a similar issue with Braintree, where simply remaining the Gateway to BraintreeGateway seemed to solve the problem.

braintree gateway giving me an undefined method error

spree 1.3.2, NoMethodError in Spree::CheckoutController#update, undefined method `to_sym' for nil:NilClass

spree_core (1.3.2) app/models/spree/gateway.rb:24:in `provider'
/home/geoff/.rvm/gems/ruby-1.9.2-p320/bundler/gems/spree_gateway-b13d777aecf3/app/models/spree/gateway/braintree_gateway.rb:13:in `provider'
/home/geoff/.rvm/gems/ruby-1.9.2-p320/bundler/gems/spree_gateway-b13d777aecf3/app/models/spree/gateway/braintree_gateway.rb:35:in `create_profile'

Gemfile

gem 'spree', '1.3.2'
gem 'spree_gateway', :github => 'spree/spree_gateway', :branch => '1-3-stable'
gem 'spree_auth_devise', :github => 'spree/spree_auth_devise', :branch => '1-3-stable'

Did I set up something wrong? I set environment to :sandbox.

Stripe does not work with Spree

Hi Team:

I'm so close to launching our new platform shop.senseswines.com with Spree (thanks for all!) but cannot get Stripe to function as a payment method. The gateway plugin currently asks for the 'Secret' and 'Publishable' keys but with them entered I can't get Stripe to process cards. With the test keys entered, I can get Stripe to work at a basic level but never past customer creation within Stripe's world. The transaction always fails due to 'This card number is incorrect'.

Does anyone else have ideas because as of now we're using PayPal and I would much rather switch.

Thanks!

Chris

From Stripe support:

I haven't personally used Spree myself, but I took a look at your account. You're successfully creating customers and creating cards for those customers, which is great. But the problem seems to be specific to charge attempts. If you look at the logs for all failed charge attempts--

You'll see how the card is being passed to Stripe:

card: {number: "card_***xdc29tk6fVuomz8rgNbAr"}

That's why you're getting the "card number is incorrect" error message. A card can be represented by a card ID or a token. But the request is passing an altered version of the card ID (note the asterisks) as the card number.

When creating charges, you need to pass either a representation of the customer or of the card (normally as a token):

I'm pretty sure that's what the problem is, although I couldn't say whether this is specific to Spree or the use of Spree.

Incorrect setting of options for Authorize.NET sandbox mode?

Not sure if I'm just confused or seeing this correctly. In authorize_net.rb, we've got:

def options_with_test_preference
  options_without_test_preference.merge(:test => self.preferred_test_mode)
end

In [active_merchant's authorize_net.rb], they've got:

      # ==== Options
      #
      # * <tt>:login</tt> -- The Authorize.Net API Login ID (REQUIRED)
      # * <tt>:password</tt> -- The Authorize.Net Transaction Key. (REQUIRED)
      # * <tt>:test</tt> -- +true+ or +false+. If true, perform transactions against the test server.
      #   Otherwise, perform transactions against the production server.
      def initialize(options = {})
        requires!(options, :login, :password)
        super
      end

According to the comment for the test option, that wouldn't correspond to the prefered_test_mode option would it? I understand that test_mode correspond's to Authorize.NET's test mode, which could be set on either production or sandbox accounts. If I'm understanding correctly, options_with_test_preference should be something like this

options_without_test_preference.merge(:test => self.preferred_server == "test")

Am I confused about this?

No documentation, broken generators, numerous bugs

Trying to install this gem provided to be slightly more effort than I thought, as the readme leaves out many extremely important install instructions that I dug to find myself. Here are the things I had to do to get it to work, as the instructions in the readme got me absolutely nowhere:

  • add the git source to the gemfile, as in gem 'spree_gateway', :git => "https://github.com/spree/spree_gateway.git" - this way the gem installs correctly
  • after install, you have to run rails g spree_gateway:install - this will actually place the files where they need to be and run the migrations
  • after running these migrations, you must restart your app (as usual with migrations, but sometimes people forget so it's worth putting in the instructions) in order to get access to the new gateways
  • after restarting the app, you must override models > spree > payment_method.rb and add attr_accessible :name, :description, :environment, :display_on, :active, :type

In addition, the install generator adds a number of require statements to files that don't exist, so you will immediately get errors unless you remove these require statements... not to mention the larger problem that the files have been left out of this project. Also, although it indicates as the most recent commit that attr_accessible was added for payment methods, this did not work and I had to manually override the payment_methods model and add attr_accessible statements in order to add any new gateways.

Finally, there is no documentation on what inputs the different gateways require and where to obtain these values. I was trying to set up stripe and it gave me two inputs: "login" and "server". This is completely inaccurate and unhelpful - by guessing and digging through the source I found that "login" should be the Stripe secret api key. I still don't know what 'server' is. I can only imagine that the other gateways have similar problems with understandability.

Once I make sure everything is working with these modifications, I will attach a pull request that fixes these issues. That being said, I am really surprised and disappointed at the quality of this gem. It's an extremely important (I might even say the most important) piece of spree and is poorly documented and completely broken. How can something like this slip by a full time core team? I'm using spree for a large and important client project, and after finding numerous instances of bugs and poor documentation throughout spree and any extensions I've used, I've lost more or less all confidence in spree and certainly will not be using it again if I can help it.

add label for preferences in gateway configuration

It would be nice to be able to customize preferences field to match the label used by payment gateways. For example, the provider Moneris calls the login "Store ID" and the password "API Key". I think it would be easier to understand for the administrator configuring the payment method.

Error: SubclassNotFound in Spree/admin/payment_methods#index Stripe

I am using Spree 1.2 with the spree_gateway gem on rails 3.2.14. I want to use Stripe, but and getting this error when I go to localhost:3000/admin/payment_methods :

ActiveRecord::SubclassNotFound in Spree/admin/payment_methods#index

Showing /Users/sam/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/bundler/gems/spree-45f5fa829701/core/app/views/spree/admin/payment_methods/index.html.erb where line #24 raised:

The single-table inheritance mechanism failed to locate the subclass: 'Gateway::Stripe'. This error is raised because the column 'type' is reserved for storing the class in case of inheritance. Please rename this column if you didn't intend it to be used for storing the inheritance class or overwrite Spree::PaymentMethod.inheritance_column to use another column for that information.
Extracted source (around line #24):

21:     <th data-hook="admin_payment_methods_index_header_actions"></th>
22:   </tr>
23:   <tbody>
24:     <% @payment_methods.each do |method|%>
25:       <tr id="<%= spree_dom_id method %>" data-hook="admin_payment_methods_index_rows">
26:         <td width="120px"><%= method.name %></td>
27:         <td width="140px"><%= method.type %></td>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.