Giter Club home page Giter Club logo

better_spree_paypal_express's People

Contributors

alepore avatar azinazadi avatar bbonislawski avatar cmrd-senya avatar damianlegawiec avatar dmgr avatar fdocr avatar finelineautomation avatar fredjean avatar futhr avatar geermc4 avatar hates avatar jackkinsella avatar jhawthorn avatar mrpollo avatar peterberkenbosch avatar pszyszkaspark avatar pusewicz avatar radar avatar redglory avatar rohanm avatar romul avatar sbasir avatar sbounmy avatar simontseng avatar ssendev avatar traels avatar vygovskysergey avatar willianvdv avatar witekl avatar

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

better_spree_paypal_express's Issues

Addition to installation instructions - restart rails server

Can I suggest an addition to the installation instructions?

  1. restart your rails server.

I kept getting an error that the store/spree_paypal_express javascript file could not be found. Restarting the server fixed it.

It's probably obvious to more experienced rails devs that you have to do this, but as a rails newb, it wasn't.

API endpoints

If a user selects the PayPal Express payment method, there is currently no way for them to proceed through the checkout process if they're doing it through Spree's API component. (see this thread for an example of that)

Therefore I propose that we add an API controller to this extension which serves up two endpoints:

  • /orders/:number/paypal/start - Same as Spree::PaypalController#express
  • /orders/:number/paypal/confirm - Same as Spree::PaypalController#confirm

With the code for the API + frontend controllers being identical, I think we should move that logic out of the controllers and into a service object of sorts.

Complete checkout flow

Currently the extension goes to the confirm action which will trigger a purchase call for the gateway. We need to handle the response from this call, creating a new payment for the order and transitioning the order to its complete state.

PaypalController cannot handle redirect due to incorrect number of arguments

On being redirected from sandbox payment on Paypal using Paypal balance, like the following:

http://jewelify.us/paypal/confirm?payment_method_id=1&token=EC-2XE09284H1460651V&PayerID=PRABSRTRSY2CS

My rails app is returning the following:

I, [2013-10-01T16:11:26.988184 #27761]  INFO -- : Processing by Spree::CheckoutController#update as HTML
I, [2013-10-01T16:11:26.988275 #27761]  INFO -- :   Parameters: {"utf8"=>"✓", "authenticity_token"=>"FT8v7vOtpYb8ONDJ4FVob2rCe/frKeoCdfDYQrI/0QM=", "order"=>{"shipments_attributes"=>{"0"=>{"selected_shipping_rate_id"=>"6", "id"=>"9"}}}, "commit"=>"Save and Continue", "state"=>"delivery"}
I, [2013-10-01T16:11:27.287181 #27761]  INFO -- : Redirected to http://jewelify.us/checkout/payment
I, [2013-10-01T16:11:27.287529 #27761]  INFO -- : Completed 302 Found in 299ms (ActiveRecord: 18.5ms)
I, [2013-10-01T16:11:27.424877 #27761]  INFO -- : Started GET "/checkout/payment" for 108.185.71.133 at 2013-10-01 16:11:27 +0000
I, [2013-10-01T16:11:27.426684 #27761]  INFO -- : Processing by Spree::CheckoutController#edit as HTML
I, [2013-10-01T16:11:27.426756 #27761]  INFO -- :   Parameters: {"state"=>"payment"}
I, [2013-10-01T16:11:27.459959 #27761]  INFO -- :   Rendered /var/www/jewelify/shared/bundle/ruby/2.0.0/gems/spree_core-2.1.1/app/views/spree/shared/_error_messages.html.erb (0.2ms)
I, [2013-10-01T16:11:27.568390 #27761]  INFO -- :   Rendered /var/www/jewelify/shared/bundle/ruby/2.0.0/bundler/gems/better_spree_paypal_express-d62aed547d6c/app/views/spree/checkout/payment/_paypal.html.erb (1.5ms)
I, [2013-10-01T16:11:27.570119 #27761]  INFO -- :   Rendered /var/www/jewelify/shared/bundle/ruby/2.0.0/gems/spree_frontend-2.1.1/app/views/spree/checkout/_payment.html.erb (100.6ms)
I, [2013-10-01T16:11:27.580291 #27761]  INFO -- :   Rendered /var/www/jewelify/shared/bundle/ruby/2.0.0/gems/spree_frontend-2.1.1/app/views/spree/checkout/_summary.html.erb (9.5ms)
I, [2013-10-01T16:11:27.580500 #27761]  INFO -- :   Rendered /var/www/jewelify/shared/bundle/ruby/2.0.0/gems/spree_frontend-2.1.1/app/views/spree/checkout/edit.html.erb within spree/layouts/spree_application (121.2ms)
I, [2013-10-01T16:11:27.583868 #27761]  INFO -- :   Rendered /var/www/jewelify/shared/bundle/ruby/2.0.0/gems/spree_core-2.1.1/app/views/spree/shared/_routes.html.erb (0.4ms)
I, [2013-10-01T16:11:27.584014 #27761]  INFO -- :   Rendered /var/www/jewelify/shared/bundle/ruby/2.0.0/gems/spree_frontend-2.1.1/app/views/spree/shared/_head.html.erb (3.0ms)
I, [2013-10-01T16:11:27.587423 #27761]  INFO -- :   Rendered /var/www/jewelify/shared/bundle/ruby/2.0.0/gems/spree_frontend-2.1.1/app/views/spree/shared/_search.html.erb (1.6ms)
I, [2013-10-01T16:11:27.587534 #27761]  INFO -- :   Rendered /var/www/jewelify/shared/bundle/ruby/2.0.0/gems/spree_frontend-2.1.1/app/views/spree/shared/_nav_bar.html.erb (2.5ms)
I, [2013-10-01T16:11:27.589649 #27761]  INFO -- :   Rendered /var/www/jewelify/shared/bundle/ruby/2.0.0/gems/spree_frontend-2.1.1/app/views/spree/shared/_main_nav_bar.html.erb (1.9ms)
I, [2013-10-01T16:11:27.589755 #27761]  INFO -- :   Rendered /var/www/jewelify/shared/bundle/ruby/2.0.0/gems/spree_frontend-2.1.1/app/views/spree/shared/_header.html.erb (5.5ms)
I, [2013-10-01T16:11:27.590305 #27761]  INFO -- :   Rendered /var/www/jewelify/shared/bundle/ruby/2.0.0/gems/spree_frontend-2.1.1/app/views/spree/shared/_footer.html.erb (0.2ms)
I, [2013-10-01T16:11:27.591441 #27761]  INFO -- :   Rendered /var/www/jewelify/shared/bundle/ruby/2.0.0/gems/spree_frontend-2.1.1/app/views/spree/shared/_google_analytics.html.erb (0.9ms)
I, [2013-10-01T16:11:27.591880 #27761]  INFO -- : Completed 200 OK in 165ms (Views: 130.6ms | ActiveRecord: 6.9ms)
I, [2013-10-01T16:11:27.677255 #27761]  INFO -- : Started GET "/assets/store/cart.png" for 108.185.71.133 at 2013-10-01 16:11:27 +0000
F, [2013-10-01T16:11:27.678777 #27761] FATAL -- : 
ActionController::RoutingError (No route matches [GET] "/assets/store/cart.png"):
  actionpack (4.0.0) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
  actionpack (4.0.0) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  railties (4.0.0) lib/rails/rack/logger.rb:38:in `call_app'
  railties (4.0.0) lib/rails/rack/logger.rb:21:in `block in call'
  activesupport (4.0.0) lib/active_support/tagged_logging.rb:67:in `block in tagged'
  activesupport (4.0.0) lib/active_support/tagged_logging.rb:25:in `tagged'
  activesupport (4.0.0) lib/active_support/tagged_logging.rb:67:in `tagged'
  railties (4.0.0) lib/rails/rack/logger.rb:21:in `call'
  actionpack (4.0.0) lib/action_dispatch/middleware/request_id.rb:21:in `call'
  rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
  rack (1.5.2) lib/rack/runtime.rb:17:in `call'
  activesupport (4.0.0) lib/active_support/cache/strategy/local_cache.rb:83:in `call'
  railties (4.0.0) lib/rails/engine.rb:511:in `call'
  railties (4.0.0) lib/rails/application.rb:97:in `call'
  /usr/local/rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.19/lib/phusion_passenger/rack/thread_handler_extension.rb:77:in `process_request'
  /usr/local/rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.19/lib/phusion_passenger/request_handler/thread_handler.rb:140:in `accept_and_process_next_request'
  /usr/local/rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.19/lib/phusion_passenger/request_handler/thread_handler.rb:108:in `main_loop'
  /usr/local/rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.19/lib/phusion_passenger/request_handler.rb:441:in `block (3 levels) in start_threads'


I, [2013-10-01T16:11:30.420110 #27761]  INFO -- : Started POST "/paypal?payment_method_id=1" for 108.185.71.133 at 2013-10-01 16:11:30 +0000
I, [2013-10-01T16:11:30.426454 #27761]  INFO -- : Processing by Spree::PaypalController#express as HTML
I, [2013-10-01T16:11:30.426550 #27761]  INFO -- :   Parameters: {"authenticity_token"=>"FT8v7vOtpYb8ONDJ4FVob2rCe/frKeoCdfDYQrI/0QM=", "payment_method_id"=>"1"}
I, [2013-10-01T16:11:31.881664 #27761]  INFO -- : Redirected to https://www.sandbox.paypal.com/webscr?cmd=_express-checkout&token=EC-2XE09284H1460651V
I, [2013-10-01T16:11:31.881936 #27761]  INFO -- : Completed 302 Found in 1455ms (ActiveRecord: 5.7ms)
I, [2013-10-01T16:12:01.972008 #27761]  INFO -- : Started GET "/paypal/confirm?payment_method_id=1&token=EC-2XE09284H1460651V&PayerID=PRABSRTRSY2CS" for 108.185.71.133 at 2013-10-01 16:12:01 +0000
I, [2013-10-01T16:12:01.981601 #27761]  INFO -- : Processing by Spree::PaypalController#confirm as HTML
I, [2013-10-01T16:12:01.981780 #27761]  INFO -- :   Parameters: {"payment_method_id"=>"1", "token"=>"EC-2XE09284H1460651V", "PayerID"=>"PRABSRTRSY2CS"}
I, [2013-10-01T16:12:02.117161 #27761]  INFO -- : Completed 500 Internal Server Error in 135ms
F, [2013-10-01T16:12:02.120692 #27761] FATAL -- : 
ArgumentError (wrong number of arguments (2 for 0..1)):
  activerecord (4.0.0) lib/active_record/persistence.rb:32:in `create'
  /var/www/jewelify/shared/bundle/ruby/2.0.0/bundler/gems/better_spree_paypal_express-d62aed547d6c/app/controllers/spree/paypal_controller.rb:63:in `confirm'
  actionpack (4.0.0) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
  actionpack (4.0.0) lib/abstract_controller/base.rb:189:in `process_action'
  actionpack (4.0.0) lib/action_controller/metal/rendering.rb:10:in `process_action'
  actionpack (4.0.0) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
  activesupport (4.0.0) lib/active_support/callbacks.rb:453:in `_run__941592807079783878__process_action__callbacks'
  activesupport (4.0.0) lib/active_support/callbacks.rb:80:in `run_callbacks'
  actionpack (4.0.0) lib/abstract_controller/callbacks.rb:17:in `process_action'
  actionpack (4.0.0) lib/action_controller/metal/rescue.rb:29:in `process_action'
  actionpack (4.0.0) lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
  activesupport (4.0.0) lib/active_support/notifications.rb:159:in `block in instrument'
  activesupport (4.0.0) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (4.0.0) lib/active_support/notifications.rb:159:in `instrument'
  actionpack (4.0.0) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
  actionpack (4.0.0) lib/action_controller/metal/params_wrapper.rb:245:in `process_action'
  activerecord (4.0.0) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
  actionpack (4.0.0) lib/abstract_controller/base.rb:136:in `process'
  actionpack (4.0.0) lib/abstract_controller/rendering.rb:44:in `process'
  actionpack (4.0.0) lib/action_controller/metal.rb:195:in `dispatch'
  actionpack (4.0.0) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
  actionpack (4.0.0) lib/action_controller/metal.rb:231:in `block in action'
  actionpack (4.0.0) lib/action_dispatch/routing/route_set.rb:80:in `call'
  actionpack (4.0.0) lib/action_dispatch/routing/route_set.rb:80:in `dispatch'
  actionpack (4.0.0) lib/action_dispatch/routing/route_set.rb:48:in `call'
  actionpack (4.0.0) lib/action_dispatch/journey/router.rb:71:in `block in call'
  actionpack (4.0.0) lib/action_dispatch/journey/router.rb:59:in `each'
  actionpack (4.0.0) lib/action_dispatch/journey/router.rb:59:in `call'
  actionpack (4.0.0) lib/action_dispatch/routing/route_set.rb:655:in `call'
  railties (4.0.0) lib/rails/engine.rb:511:in `call'
  railties (4.0.0) lib/rails/railtie/configurable.rb:30:in `method_missing'
  actionpack (4.0.0) lib/action_dispatch/journey/router.rb:71:in `block in call'
  actionpack (4.0.0) lib/action_dispatch/journey/router.rb:59:in `each'
  actionpack (4.0.0) lib/action_dispatch/journey/router.rb:59:in `call'
  actionpack (4.0.0) lib/action_dispatch/routing/route_set.rb:655:in `call'
  warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
  warden (1.2.3) lib/warden/manager.rb:34:in `catch'
  warden (1.2.3) lib/warden/manager.rb:34:in `call'
  rack (1.5.2) lib/rack/etag.rb:23:in `call'
  rack (1.5.2) lib/rack/conditionalget.rb:25:in `call'
  rack (1.5.2) lib/rack/head.rb:11:in `call'
  actionpack (4.0.0) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
  actionpack (4.0.0) lib/action_dispatch/middleware/flash.rb:241:in `call'
  rack (1.5.2) lib/rack/session/abstract/id.rb:225:in `context'
  rack (1.5.2) lib/rack/session/abstract/id.rb:220:in `call'
  actionpack (4.0.0) lib/action_dispatch/middleware/cookies.rb:486:in `call'
  activerecord (4.0.0) lib/active_record/query_cache.rb:36:in `call'
  activerecord (4.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in `call'
  actionpack (4.0.0) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
  activesupport (4.0.0) lib/active_support/callbacks.rb:373:in `_run__1457700310619317659__call__callbacks'
  activesupport (4.0.0) lib/active_support/callbacks.rb:80:in `run_callbacks'
  actionpack (4.0.0) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  actionpack (4.0.0) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
  actionpack (4.0.0) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
  actionpack (4.0.0) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  railties (4.0.0) lib/rails/rack/logger.rb:38:in `call_app'
  railties (4.0.0) lib/rails/rack/logger.rb:21:in `block in call'
  activesupport (4.0.0) lib/active_support/tagged_logging.rb:67:in `block in tagged'
  activesupport (4.0.0) lib/active_support/tagged_logging.rb:25:in `tagged'
  activesupport (4.0.0) lib/active_support/tagged_logging.rb:67:in `tagged'
  railties (4.0.0) lib/rails/rack/logger.rb:21:in `call'
  actionpack (4.0.0) lib/action_dispatch/middleware/request_id.rb:21:in `call'
  rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
  rack (1.5.2) lib/rack/runtime.rb:17:in `call'
  activesupport (4.0.0) lib/active_support/cache/strategy/local_cache.rb:83:in `call'
  railties (4.0.0) lib/rails/engine.rb:511:in `call'
  railties (4.0.0) lib/rails/application.rb:97:in `call'
  /usr/local/rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.19/lib/phusion_passenger/rack/thread_handler_extension.rb:77:in `process_request'
  /usr/local/rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.19/lib/phusion_passenger/request_handler/thread_handler.rb:140:in `accept_and_process_next_request'
  /usr/local/rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.19/lib/phusion_passenger/request_handler/thread_handler.rb:108:in `main_loop'
  /usr/local/rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.19/lib/phusion_passenger/request_handler.rb:441:in `block (3 levels) in start_threads'

Any clues - could it be a setup issue - I have my test account registered right on Paypal Developer with some balance. I don't think this better gem has any much configuration either apart from API access setup through Spree admin?

I am using everything stable-2-1.

How to remove the spree_paypal_express to install better_spree_paypal_express ?

Hello and HAPPY NEW YEAR !!!

I have some issues after change to better_spree_paypal_express maybe is due to a some incompatibility ?

I comment the Spree_paypal_express in my gem file and bundle , after this i follow all instructions show in radar/better_spree_paypal_express but when i go to ../admin/admin/payment_methods is like the routes are wrong ... all others sections into admin works fine..

My gemfile is:

source 'https://rubygems.org'

gem 'rails', '3.2.14'
gem 'mysql2'

group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'

  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'
gem 'spree', github: 'spree/spree', branch: '2-0-stable'
gem 'spree_paypal_express', :github => "radar/better_spree_paypal_express", :branch => "2-0-stable"
# gem 'spree_paypal_express', :git => 'git://github.com/spree/spree_paypal_express.git', branch: '2-0-stable'
gem 'spree_gateway', github: 'spree/spree_gateway', branch: '2-0-stable'
gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: '2-0-stable'
gem 'spree_static_content', :github => 'spree/spree_static_content', branch: '2-0-stable'

gem 'spree_i18n', :git => 'git://github.com/spree/spree_i18n.git', :branch => '2-0-stable'

gem 'globalize', '~> 3.0.0'

I've tried rake routes, restart server and precompile assets again and again but nothing works .. please help me radar !!!

Regards,

Maria

Add Line Item Adjustments to the list of items sent to Paypal

In the PaypalController, the method express sums together all the line items + shipping and tax adjustments + any other adjustments on the order.

Do you not think that it should also add to this sum the custom adjustments, which were defined on LineItem level. It needs to be almost a repetition of the code in between the lines 21-31 in the paypal.rb controller, but loop through the order line items as well.

      order.adjustments.eligible.each do |adjustment|
        next if (tax_adjustments + shipping_adjustments).include?(adjustment)
        items << {
          :Name => adjustment.label,
          :Quantity => 1,
          :Amount => {
            :currencyID => order.currency,
            :value => adjustment.amount
          }
        }
      end

I think this change is especially relevant for the 2.2 Spree.

Unable to UPDATE a new payment on Admin::PaymentController#new due to this extension's JS disabling the button

Not sure if my integration is wrong, but here's the offending code:

https://github.com/radar/better_spree_paypal_express/blob/c273417ff284177326e44e09d53cc0f2af6f40e9/app/assets/javascripts/spree/backend/paypal_express.js#L12

I have a feeling that selector is overly broad since it's picking up more than one element and disabling both of 'em:

Chrome console output

> $('button[type=submit]')

  [<button type="submit" disabled="disabled">​Save​</button>,
   <button class="icon-refresh button" name="button" type="submit" disabled="disabled">…​</button>]

>

Where to put the preferred_solution_type

I followed the set up, and there are options for solution type and landing page, namely:

payment_method.preferred_solution_type = "Sole"

If I put the set up in config/initializers/spree.rb, there will be a method not found error.

Where should I put the set up?

Problem with quantity of payments in Paypal Sandbox

Hi guys! Thanks for your work. In the payment process it's all right and the order total quantity is ok in Spree, but I've a problem with the quantity of payments in Paypal Sandbox. I'm working on Euros, and for example if I purchase a product which price is 25 euros, in my paypal sandbox I have a payment for 2.500 euros for this. My Spree config is:

  • Currency decimal mark: ","
  • Currency thousand separator: "."

Thanks!

Error due to app/assets/stylesheets/application.css not existing on installation

Version 2.1

When installing with bundle exec rails g spree_paypal_express:install I get the following error:

      append  app/assets/javascripts/store/all.js
      append  app/assets/javascripts/admin/all.js
      insert  app/assets/stylesheets/application.css
/Users/joshuapaling/.rvm/gems/ruby-1.9.3-p429/gems/thor-0.18.1/lib/thor/actions/inject_into_file.rb:99:in `binread': No such file or directory - /Users/joshuapaling/dev/Espionage/Sneakerology_Website_2013/www/app/assets/stylesheets/application.css (Errno::ENOENT)
    from /Users/joshuapaling/.rvm/gems/ruby-1.9.3-p429/gems/thor-0.18.1/lib/thor/actions/inject_into_file.rb:99:in `replace!'
    from /Users/joshuapaling/.rvm/gems/ruby-1.9.3-p429/gems/thor-0.18.1/lib/thor/actions/inject_into_file.rb:60:in `invoke!'
    from /Users/joshuapaling/.rvm/gems/ruby-1.9.3-p429/gems/thor-0.18.1/lib/thor/actions.rb:95:in `action'
    from /Users/joshuapaling/.rvm/gems/ruby-1.9.3-p429/gems/thor-0.18.1/lib/thor/actions/inject_into_file.rb:31:in `insert_into_file'
    from /Users/joshuapaling/.rvm/gems/ruby-1.9.3-p429/bundler/gems/better_spree_paypal_express-f1a062d84237/lib/generators/spree_paypal_express/install/install_generator.rb:21:in `add_stylesheets'
    from /Users/joshuapaling/.rvm/gems/ruby-1.9.3-p429/gems/thor-0.18.1/lib/thor/command.rb:27:in `run'
    from /Users/joshuapaling/.rvm/gems/ruby-1.9.3-p429/gems/thor-0.18.1/lib/thor/invocation.rb:120:in `invoke_command'
    from /Users/joshuapaling/.rvm/gems/ruby-1.9.3-p429/gems/thor-0.18.1/lib/thor/invocation.rb:127:in `block in invoke_all'
    from /Users/joshuapaling/.rvm/gems/ruby-1.9.3-p429/gems/thor-0.18.1/lib/thor/invocation.rb:127:in `each'
    from /Users/joshuapaling/.rvm/gems/ruby-1.9.3-p429/gems/thor-0.18.1/lib/thor/invocation.rb:127:in `map'
    from /Users/joshuapaling/.rvm/gems/ruby-1.9.3-p429/gems/thor-0.18.1/lib/thor/invocation.rb:127:in `invoke_all'
    from /Users/joshuapaling/.rvm/gems/ruby-1.9.3-p429/gems/thor-0.18.1/lib/thor/group.rb:233:in `dispatch'
    from /Users/joshuapaling/.rvm/gems/ruby-1.9.3-p429/gems/thor-0.18.1/lib/thor/base.rb:439:in `start'
    from /Users/joshuapaling/.rvm/gems/ruby-1.9.3-p429/gems/railties-4.0.0/lib/rails/generators.rb:156:in `invoke'
    from /Users/joshuapaling/.rvm/gems/ruby-1.9.3-p429/gems/railties-4.0.0/lib/rails/commands/generate.rb:11:in `<top (required)>'
    from /Users/joshuapaling/.rvm/gems/ruby-1.9.3-p429/gems/polyglot-0.3.3/lib/polyglot.rb:63:in `require'
    from /Users/joshuapaling/.rvm/gems/ruby-1.9.3-p429/gems/polyglot-0.3.3/lib/polyglot.rb:63:in `require'
    from /Users/joshuapaling/.rvm/gems/ruby-1.9.3-p429/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `block in require'
    from /Users/joshuapaling/.rvm/gems/ruby-1.9.3-p429/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
    from /Users/joshuapaling/.rvm/gems/ruby-1.9.3-p429/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
    from /Users/joshuapaling/.rvm/gems/ruby-1.9.3-p429/gems/railties-4.0.0/lib/rails/commands.rb:49:in `<top (required)>'
    from bin/rails:4:in `require'
    from bin/rails:4:in `<main>'

If I add app/assets/stylesheets/application.css and re-run the install, it works fine, and doesn't appear to change application.css in any way.

screen shot 2013-10-25 at 1 49 59 pm

Specs not passing

I cloned the repository, set up the dummy rails app and ran the specs all as laid out in the README. The specs do not run through, however.

Ruby version 2.0.0p247

Here is the output of bundle exec rspec spec:

I, [2013-10-24T11:29:56.680834 #92681]  INFO -- : Action: SetExpressCheckout
I, [2013-10-24T11:29:56.680916 #92681]  INFO -- : Request[post]: https://api-3t.sandbox.paypal.com/2.0/
I, [2013-10-24T11:29:58.055786 #92681]  INFO -- : Response[200]: OK, Duration: 1.375s
I, [2013-10-24T11:30:24.487061 #92681]  INFO -- : Action: DoExpressCheckoutPayment
I, [2013-10-24T11:30:24.487130 #92681]  INFO -- : Request[post]: https://api-3t.sandbox.paypal.com/2.0/
I, [2013-10-24T11:30:26.971268 #92681]  INFO -- : Response[200]: OK, Duration: 2.484s
.
An error occurred in an after hook
  NoMethodError: undefined method `compute_amount' for nil:NilClass
  occurred at /Users/aljoscha/.rvm/gems/ruby-2.0.0-p247/bundler/gems/spree-0ecc44d745c5/core/app/models/spree/adjustment.rb:78:in `update!'

FI, [2013-10-24T11:30:37.718875 #92681]  INFO -- : Action: SetExpressCheckout
I, [2013-10-24T11:30:37.718950 #92681]  INFO -- : Request[post]: https://api-3t.sandbox.paypal.com/2.0/
I, [2013-10-24T11:30:38.407675 #92681]  INFO -- : Response[200]: OK, Duration: 0.689s
.
An error occurred in an after hook
  NoMethodError: undefined method `compute_amount' for nil:NilClass
  occurred at /Users/aljoscha/.rvm/gems/ruby-2.0.0-p247/bundler/gems/spree-0ecc44d745c5/core/app/models/spree/adjustment.rb:78:in `update!'

FI, [2013-10-24T11:30:52.362963 #92681]  INFO -- : Action: SetExpressCheckout
I, [2013-10-24T11:30:52.363042 #92681]  INFO -- : Request[post]: https://api-3t.sandbox.paypal.com/2.0/
I, [2013-10-24T11:30:53.311739 #92681]  INFO -- : Response[200]: OK, Duration: 0.949s
.I, [2013-10-24T11:30:58.912981 #92681]  INFO -- : Action: SetExpressCheckout
I, [2013-10-24T11:30:58.913094 #92681]  INFO -- : Request[post]: https://api-3t.sandbox.paypal.com/2.0/
I, [2013-10-24T11:30:59.617104 #92681]  INFO -- : Response[200]: OK, Duration: 0.704s
I, [2013-10-24T11:31:19.856531 #92681]  INFO -- : Action: DoExpressCheckoutPayment
I, [2013-10-24T11:31:19.856606 #92681]  INFO -- : Request[post]: https://api-3t.sandbox.paypal.com/2.0/
I, [2013-10-24T11:31:21.971583 #92681]  INFO -- : Response[200]: OK, Duration: 2.115s
I, [2013-10-24T11:31:28.730983 #92681]  INFO -- : Action: RefundTransaction
I, [2013-10-24T11:31:28.731042 #92681]  INFO -- : Request[post]: https://api-3t.sandbox.paypal.com/2.0/
I, [2013-10-24T11:31:31.681058 #92681]  INFO -- : Response[200]: OK, Duration: 2.950s
.I, [2013-10-24T11:31:37.953228 #92681]  INFO -- : Action: SetExpressCheckout
I, [2013-10-24T11:31:37.953306 #92681]  INFO -- : Request[post]: https://api-3t.sandbox.paypal.com/2.0/
I, [2013-10-24T11:31:38.917046 #92681]  INFO -- : Response[200]: OK, Duration: 0.964s
I, [2013-10-24T11:31:52.463800 #92681]  INFO -- : Action: DoExpressCheckoutPayment
I, [2013-10-24T11:31:52.463868 #92681]  INFO -- : Request[post]: https://api-3t.sandbox.paypal.com/2.0/
I, [2013-10-24T11:31:55.933687 #92681]  INFO -- : Response[200]: OK, Duration: 3.470s
I, [2013-10-24T11:31:59.859025 #92681]  INFO -- : Action: RefundTransaction
I, [2013-10-24T11:31:59.859092 #92681]  INFO -- : Request[post]: https://api-3t.sandbox.paypal.com/2.0/
I, [2013-10-24T11:32:01.677916 #92681]  INFO -- : Response[200]: OK, Duration: 1.819s
.I, [2013-10-24T11:32:06.745024 #92681]  INFO -- : Action: SetExpressCheckout
I, [2013-10-24T11:32:06.745096 #92681]  INFO -- : Request[post]: https://api-3t.sandbox.paypal.com/2.0/
I, [2013-10-24T11:32:07.361806 #92681]  INFO -- : Response[200]: OK, Duration: 0.617s
I, [2013-10-24T11:32:20.678161 #92681]  INFO -- : Action: DoExpressCheckoutPayment
I, [2013-10-24T11:32:20.678251 #92681]  INFO -- : Request[post]: https://api-3t.sandbox.paypal.com/2.0/
I, [2013-10-24T11:32:23.176994 #92681]  INFO -- : Response[200]: OK, Duration: 2.499s
I, [2013-10-24T11:32:26.635893 #92681]  INFO -- : Action: RefundTransaction
I, [2013-10-24T11:32:26.635954 #92681]  INFO -- : Request[post]: https://api-3t.sandbox.paypal.com/2.0/
I, [2013-10-24T11:32:27.405915 #92681]  INFO -- : Response[200]: OK, Duration: 0.770s
...

Failures:

  1) PayPal includes adjustments in PayPal summary
     Failure/Error: within("#guest_checkout") do
     Capybara::ElementNotFound:
       Unable to find css "#guest_checkout"
     # ./spec/features/paypal_spec.rb:75:in `block (2 levels) in <top (required)>'

  2) PayPal can process an order with $0 item total
     Failure/Error: within("#guest_checkout") do
     Capybara::ElementNotFound:
       Unable to find css "#guest_checkout"
     # ./spec/features/paypal_spec.rb:139:in `block (3 levels) in <top (required)>'

Finished in 2 minutes 58.3 seconds
10 examples, 2 failures

Failed examples:

rspec ./spec/features/paypal_spec.rb:61 # PayPal includes adjustments in PayPal summary
rspec ./spec/features/paypal_spec.rb:131 # PayPal can process an order with $0 item total

What am I missing?

1 error prohibited this record from being saved:

1 error prohibited this record from being saved:

There were problems with the following fields:

No payment methods are configured for this environment

Hello,

I am using the spree Paypal express gem for spree commerce.
I am running on ruby 2 rails 3.2.14 and spree 1.3. I have followed the gems readme
file to a 'T' and I am unable to make paypal work for test or live.

another not on this is I have also tried to use the cutting edge master for spree and this gem on rails 4 and i am still unable to make it work.

any help would be great I would like to us paypal.

Major Security Vulnerability

Working on customizing this extension, and I found what appears to be a major security hole. A carefully crafted URL can cause an order to be processed w/o any payment being taken. Happy to share more details offline.

No such file or directory - config/paypal.yml

Occasionaly I'm seeing the following error in production. Sadly no details yet on how to reproduce:

Errno::ENOENT: No such file or directory - config/paypal.yml
gems/paypal-sdk-core-0.2.5/lib/paypal-sdk/core/config.rb:241 • read
gems/paypal-sdk-core-0.2.5/lib/paypal-sdk/core/config.rb:241 • read_configurations
gems/paypal-sdk-core-0.2.5/lib/paypal-sdk/core/config.rb:227 • configurations
gems/paypal-sdk-core-0.2.5/lib/paypal-sdk/core/config.rb:208 • default_config
gems/paypal-sdk-core-0.2.5/lib/paypal-sdk/core/config.rb:200 • config
gems/paypal-sdk-core-0.2.5/lib/paypal-sdk/core/config.rb:45 • set_config
gems/paypal-sdk-core-0.2.5/lib/paypal-sdk/core/authentication.rb:50 • set_config
gems/paypal-sdk-core-0.2.5/lib/paypal-sdk/core/api/base.rb:50 • set_config
gems/paypal-sdk-core-0.2.5/lib/paypal-sdk/core/api/base.rb:31 • initialize
gems/paypal-sdk-merchant-1.103.0/lib/paypal-sdk/merchant/api.rb:11 • initialize
bundler/gems/better_spree_paypal_express-a1ecbf1086af/app/models/spree/gateway/pay_pal_express.rb:12 • new
bundler/gems/better_spree_paypal_express-a1ecbf1086af/app/models/spree/gateway/pay_pal_express.rb:12 • provider_class
bundler/gems/spree-c8b4d22c2a25/core/app/models/spree/gateway.rb:51 • supports?
bundler/gems/spree-c8b4d22c2a25/core/app/models/spree/payment/processing.rb:8 • process!
bundler/gems/spree-c8b4d22c2a25/core/app/models/spree/order.rb:406 • block in process_payments!
bundler/gems/spree-c8b4d22c2a25/core/app/models/spree/order.rb:403 • each
bundler/gems/spree-c8b4d22c2a25/core/app/models/spree/order.rb:403 • process_payments!
bundler/gems/spree-c8b4d22c2a25/core/app/models/spree/order/checkout.rb:68 • block (2 levels) in define_state_machine!

NameError in Spree::PaypalController#express uninitialized constant Spree::Gateway::PayPal::SDK

Hi,

I have my sandbox account in PayPal UK, and I have added this gem to a Spree store, when I go through the checkout and I click the button "Pay with paypal express" in the step 3 I get this error:

NameError in Spree::PaypalController#express
uninitialized constant Spree::Gateway::PayPal::SDK

Full Stack Trace

vendor/bundle/bundler/gems/better_spree_paypal_express-67513f9e1704/app/models/spree/gateway/pay_pal_express.rb:16:in provider' vendor/bundle/bundler/gems/better_spree_paypal_express-67513f9e1704/app/controllers/spree/paypal_controller.rb:87:inprovider'
vendor/bundle/bundler/gems/better_spree_paypal_express-67513f9e1704/app/controllers/spree/paypal_controller.rb:26:in express' vendor/bundle/gems/actionpack-3.2.13/lib/action_controller/metal/implicit_render.rb:4:insend_action'
vendor/bundle/gems/actionpack-3.2.13/lib/abstract_controller/base.rb:167:in process_action' vendor/bundle/gems/actionpack-3.2.13/lib/action_controller/metal/rendering.rb:10:inprocess_action'
vendor/bundle/gems/actionpack-3.2.13/lib/abstract_controller/callbacks.rb:18:in block in process_action' vendor/bundle/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:480:in_run__4437486736803518934__process_action__2455199317537605590__callbacks'
vendor/bundle/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:405:in __run_callback' vendor/bundle/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:385:in_run_process_action_callbacks'
vendor/bundle/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:81:in run_callbacks' vendor/bundle/gems/actionpack-3.2.13/lib/abstract_controller/callbacks.rb:17:inprocess_action'
vendor/bundle/gems/actionpack-3.2.13/lib/action_controller/metal/rescue.rb:29:in process_action' vendor/bundle/gems/actionpack-3.2.13/lib/action_controller/metal/instrumentation.rb:30:inblock in process_action'
vendor/bundle/gems/activesupport-3.2.13/lib/active_support/notifications.rb:123:in block in instrument' vendor/bundle/gems/activesupport-3.2.13/lib/active_support/notifications/instrumenter.rb:20:ininstrument'
vendor/bundle/gems/activesupport-3.2.13/lib/active_support/notifications.rb:123:in instrument' vendor/bundle/gems/actionpack-3.2.13/lib/action_controller/metal/instrumentation.rb:29:inprocess_action'
vendor/bundle/gems/actionpack-3.2.13/lib/action_controller/metal/params_wrapper.rb:207:in process_action' vendor/bundle/gems/activerecord-3.2.13/lib/active_record/railties/controller_runtime.rb:18:inprocess_action'
vendor/bundle/gems/actionpack-3.2.13/lib/abstract_controller/base.rb:121:in process' vendor/bundle/gems/actionpack-3.2.13/lib/abstract_controller/rendering.rb:45:inprocess'
vendor/bundle/gems/actionpack-3.2.13/lib/action_controller/metal.rb:203:in dispatch' vendor/bundle/gems/actionpack-3.2.13/lib/action_controller/metal/rack_delegation.rb:14:indispatch'
vendor/bundle/gems/actionpack-3.2.13/lib/action_controller/metal.rb:246:in block in action' vendor/bundle/gems/actionpack-3.2.13/lib/action_dispatch/routing/route_set.rb:73:incall'
vendor/bundle/gems/actionpack-3.2.13/lib/action_dispatch/routing/route_set.rb:73:in dispatch' vendor/bundle/gems/actionpack-3.2.13/lib/action_dispatch/routing/route_set.rb:36:incall'
vendor/bundle/gems/journey-1.0.4/lib/journey/router.rb:68:in block in call' vendor/bundle/gems/journey-1.0.4/lib/journey/router.rb:56:ineach'
vendor/bundle/gems/journey-1.0.4/lib/journey/router.rb:56:in call' vendor/bundle/gems/actionpack-3.2.13/lib/action_dispatch/routing/route_set.rb:612:incall'
vendor/bundle/gems/railties-3.2.13/lib/rails/engine.rb:479:in call' vendor/bundle/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:30:inmethod_missing'
vendor/bundle/gems/journey-1.0.4/lib/journey/router.rb:68:in block in call' vendor/bundle/gems/journey-1.0.4/lib/journey/router.rb:56:ineach'
vendor/bundle/gems/journey-1.0.4/lib/journey/router.rb:56:in call' vendor/bundle/gems/actionpack-3.2.13/lib/action_dispatch/routing/route_set.rb:612:incall'
vendor/bundle/gems/warden-1.2.2/lib/warden/manager.rb:35:in block in call' vendor/bundle/gems/warden-1.2.2/lib/warden/manager.rb:34:incatch'
vendor/bundle/gems/warden-1.2.2/lib/warden/manager.rb:34:in call' vendor/bundle/gems/actionpack-3.2.13/lib/action_dispatch/middleware/best_standards_support.rb:17:incall'
vendor/bundle/gems/rack-1.4.5/lib/rack/etag.rb:23:in call' vendor/bundle/gems/rack-1.4.5/lib/rack/conditionalget.rb:35:incall'
vendor/bundle/gems/actionpack-3.2.13/lib/action_dispatch/middleware/head.rb:14:in call' vendor/bundle/gems/actionpack-3.2.13/lib/action_dispatch/middleware/params_parser.rb:21:incall'
vendor/bundle/gems/actionpack-3.2.13/lib/action_dispatch/middleware/flash.rb:242:in call' vendor/bundle/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:210:incontext'
vendor/bundle/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:205:in call' vendor/bundle/gems/actionpack-3.2.13/lib/action_dispatch/middleware/cookies.rb:341:incall'
vendor/bundle/gems/activerecord-3.2.13/lib/active_record/query_cache.rb:64:in call' vendor/bundle/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:479:incall'
vendor/bundle/gems/actionpack-3.2.13/lib/action_dispatch/middleware/callbacks.rb:28:in block in call' vendor/bundle/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:405:in_run__1523493566117622442__call__1022140308468651419__callbacks'
vendor/bundle/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:405:in __run_callback' vendor/bundle/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:385:in_run_call_callbacks'
vendor/bundle/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:81:in run_callbacks' vendor/bundle/gems/actionpack-3.2.13/lib/action_dispatch/middleware/callbacks.rb:27:incall'
vendor/bundle/gems/actionpack-3.2.13/lib/action_dispatch/middleware/reloader.rb:65:in call' vendor/bundle/gems/actionpack-3.2.13/lib/action_dispatch/middleware/remote_ip.rb:31:incall'
vendor/bundle/gems/actionpack-3.2.13/lib/action_dispatch/middleware/debug_exceptions.rb:16:in call' vendor/bundle/gems/actionpack-3.2.13/lib/action_dispatch/middleware/show_exceptions.rb:56:incall'
vendor/bundle/gems/railties-3.2.13/lib/rails/rack/logger.rb:32:in call_app' vendor/bundle/gems/railties-3.2.13/lib/rails/rack/logger.rb:16:inblock in call'
vendor/bundle/gems/activesupport-3.2.13/lib/active_support/tagged_logging.rb:22:in tagged' vendor/bundle/gems/railties-3.2.13/lib/rails/rack/logger.rb:16:incall'
vendor/bundle/gems/actionpack-3.2.13/lib/action_dispatch/middleware/request_id.rb:22:in call' vendor/bundle/gems/rack-1.4.5/lib/rack/methodoverride.rb:21:incall'
vendor/bundle/gems/rack-1.4.5/lib/rack/runtime.rb:17:in call' vendor/bundle/gems/activesupport-3.2.13/lib/active_support/cache/strategy/local_cache.rb:72:incall'
vendor/bundle/gems/rack-1.4.5/lib/rack/lock.rb:15:in call' vendor/bundle/gems/actionpack-3.2.13/lib/action_dispatch/middleware/static.rb:63:incall'
vendor/bundle/gems/railties-3.2.13/lib/rails/engine.rb:479:in call' vendor/bundle/gems/railties-3.2.13/lib/rails/application.rb:223:incall'
vendor/bundle/gems/rack-1.4.5/lib/rack/content_length.rb:14:in call' vendor/bundle/gems/railties-3.2.13/lib/rails/rack/log_tailer.rb:17:incall'
vendor/bundle/gems/rack-1.4.5/lib/rack/handler/webrick.rb:59:in service' /Users/pedro/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/webrick/httpserver.rb:138:inservice'
/Users/pedro/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in run' /Users/pedro/.rbenv/versions/2.0.0-p0/lib/ruby/2.0.0/webrick/server.rb:295:inblock in start_thread'
Request

Parameters:

{"_method"=>"post",
"authenticity_token"=>"cOOKk5EdVnNSFLKutiShuo8QZ4f7Bn2zmsceMTzLXjM=",
"payment_method_id"=>"16"}

Thanks for your work!

ActiveRecord::SubclassNotFound in Spree/checkout#edit

Trying to use this with a pretty vanilla spree 2.0.5 setup. Am I doing something wrong or is this a legit error? (Given my track record, probably the former)

Add one item to cart, proceed through checkout. Crash at payment.

Showing /home/ajbusch/.rvm/gems/ruby-1.9.3-p448/gems/spree_frontend-2.0.5/app/views/spree/checkout/_payment.html.erb where line #4 raised:

The single-table inheritance mechanism failed to locate the subclass: 'Spree::BillingIntegration::PaypalExpress'. 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.

Parameters:
{"state"=>"payment"}

Gemfile:

source 'https://rubygems.org'
ruby '1.9.3'
gem 'rails', '3.2.14'
gem 'pg'
gem 'braintree'

group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'
  gem 'uglifier', '>= 1.0.3'
end

group :development do
  gem 'webrick', '~> 1.3.1'
end


gem 'jquery-rails'
gem 'unicorn'

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

# gem 'spree_paypal_express', :git => 'https://github.com/spree/spree_paypal_express.git', :branch => '2-0-stable'
gem 'spree_paypal_express', :git => "https://github.com/radar/better_spree_paypal_express", :branch => "2-0-stable"
gem 'spree_active_shipping', :git => "git://github.com/spree/spree_active_shipping", :branch => '2-0-stable'

Hide billing address in checkout

Hi,

For PayPal Express Checkout, a customer doesn't have to input billing address. How can I hide the billing address section?

Sam

Users can't confirm orders

When clicking on the Paypal express button, the user has to login, review the order then click on the "continue" button.

review_your_information

The text next to the button says "You're almost done. You will confirm your payment on Alain Pilon's Test Store."

This is faulty since clicking on the button will redirect to the order#show page:

order_r382023264_-_spree_demo_site

There are 2 possibles fixes:

1- Have the Paypal redirect to the Spree order confirmation page.
2- Change the Paypal behaviour so the confirmation is done on Paypal.

Related to #2:
According to this page (at the bottom):

https://developer.paypal.com/webapps/developer/docs/classic/express-checkout/integration-guide/ECCustomizing/

the call to Paypal should add &useraction=commit in the param string.

The single-table inheritance mechanism failed to locate the subclass: 'Spree::BillingIntegration::PaypalExpress'.

Hi everyone,

I'm in the checkout delivery step and when I click on Save and Continue I get this error:

The single-table inheritance mechanism failed to locate the subclass: 'Spree::BillingIntegration::PaypalExpress'. 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.

My Ruby, Rails and Gemfile are:

» ruby -v
ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-darwin11.4.2]
» rails -v
Rails 3.2.14
» cat Gemfile
source 'https://rubygems.org'

gem 'rails', '3.2.14'

gem 'mysql2'
gem 'rmagick'
gem 'friendly_id'

gem 'capistrano'
gem 'capistrano-rbenv'
gem 'unicorn'
gem 'thin'
gem 'slim'

group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'
  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

gem 'spree', git: 'https://github.com/spree/spree.git', branch: '2-0-stable'
gem 'spree_gateway', git: 'https://github.com/spree/spree_gateway.git', branch: '2-0-stable'
gem 'spree_auth_devise', git: 'https://github.com/spree/spree_auth_devise.git', branch: '2-0-stable'
gem 'spree_i18n', git: 'git://github.com/spree/spree_i18n.git', branch: '2-0-stable'

gem 'spree_paypal_express', :github => "radar/better_spree_paypal_express", :branch => "2-0-stable"
gem "spree_sermepa", git: 'git://github.com/picazoH/spree_sermepa.git'

group :development do
  gem 'better_errors'
  gem 'meta_request'
  gem 'quiet_assets'
end

Breaks the Spree frontend after updating to Spree 2.2

After updating my store from 2.1 to 2.2, and moving all the assets around from store/spree_frontend to spree/frontend, updating (installing) better_spree_paypal_express breaks the store by failing to render the screen.

This is running rails s on the console.

  Rendered vendor/cache/spree-c88ab87d4b7f/frontend/app/views/spree/shared/_head.html.erb (141.0ms)
Completed 500 Internal Server Error in 621ms

ActionView::Template::Error (couldn't find file 'spree/frontend/spree_paypal_express'
  (in /home/sofy/projects/interhijab/store/vendor/assets/stylesheets/spree/frontend/all.css:14)):
     5: <%== meta_data_tags %>
     6: <%= canonical_tag %>
     7: <%= favicon_link_tag image_path('favicon.ico') %>
     8: <%= stylesheet_link_tag 'spree/frontend/all', :media => 'screen' %>
     9: <%= csrf_meta_tags %>
    10: <%= javascript_include_tag 'spree/frontend/all' %>
    11: <!--[if lt IE 9]>

I believe this is due to the better_spree_paypal_installer referring to spree/frontend/spree_paypal_express rather than spree/frontend/paypal_express

Orders which contain a tax refund cannot checkout.

If an order is to a zone which requires a tax refund, then during checkout Paypal returns the error PayPal failed. Tax total is invalid. as the tax amount will be a minus amount, i.e. -£5.00.

Changing this so that the tax amount is zero if a minus amount then returns the error PayPal failed. The totals of the cart item amounts do not match order amounts..

Including tax_adjustments in the initial request line items resolves the issue for me:

Hates@c5629ff

You may have a better fix than the one I did. I just needed a quick fix for production.

PayPal Gateway Error

Hi Ryan - back again sorry!

I have now setup my test paypal account in Spree and are able to select PayPal in checkout, I get redirected to PP where I can login to my test account and pay. Once I click the "Continue" button on PP to return back to my Spree install I see errors in the logs and get sent back to the /checkout/payment page to do payment again.

I have no idea what the PP gateway error means so I have attached the log from when I first visit the payment page as a customer up till I get bounced back - https://gist.github.com/samhamilton/7461735

Thanks
Sam

Capturing payment through spree admin fails (works on paypal)

This issue effects capture on paypal direct uk payments but i am informed its this gem causing the issue.

Using the 'capture' button in spree admin, error displayed:

ArgumentError in Spree::Admin::PaymentsController#fire

wrong number of arguments (3 for 1)

However, the payment can be accepted through the paypal interface

Running on site using
remote: git://github.com/spree/spree.git
revision: af20e3e
branch: 2-1-stable

remote: git://github.com/radar/better_spree_paypal_express.git
revision: 7bf25d5
branch: 2-1-stable

2013-12-04T17:47:43.880699+00:00 app[web.1]: Started PUT "/admin/orders/R543366581/payments/351/fire?e=capture" for 80.169.224.70 at 2013-12-04 17:47:43 +0000
2013-12-04T17:47:43.880764+00:00 app[web.1]: Started PUT "/admin/orders/R543366581/payments/351/fire?e=capture" for 80.169.224.70 at 2013-12-04 17:47:43 +0000
2013-12-04T17:47:43.886296+00:00 app[web.1]: Processing by Spree::Admin::PaymentsController#fire as HTML
2013-12-04T17:47:43.886771+00:00 app[web.1]: Processing by Spree::Admin::PaymentsController#fire as HTML
2013-12-04T17:47:43.886844+00:00 app[web.1]: Parameters: {"authenticity_token"=>"v3H0N7dk1iq/xhm6ie/6P352HNV+GI+SMw3v43b/+4M=", "e"=>"capture", "order_id"=>"R543366581", "id"=>"351"}
2013-12-04T17:47:43.886880+00:00 app[web.1]: Parameters: {"authenticity_token"=>"v3H0N7dk1iq/xhm6ie/6P352HNV+GI+SMw3v43b/+4M=", "e"=>"capture", "order_id"=>"R543366581", "id"=>"351"}
2013-12-04T17:47:44.887982+00:00 heroku[router]: at=info method=POST path=/admin/orders/R543366581/payments/351/fire?e=capture host=www.thegentlemansgroomroom.com fwd="80.169.224.70" dyno=web.1 connect=1ms service=1697ms status=500 bytes=1266
2013-12-04T17:47:44.881564+00:00 app[web.1]: Redirected to https://www.thegentlemansgroomroom.com/admin/orders/R543366581/payments
2013-12-04T17:47:44.881571+00:00 app[web.1]: Redirected to https://www.thegentlemansgroomroom.com/admin/orders/R543366581/payments
2013-12-04T17:47:44.881831+00:00 app[web.1]: Completed 500 Internal Server Error in 995ms
2013-12-04T17:47:44.881907+00:00 app[web.1]: Completed 500 Internal Server Error in 995ms
2013-12-04T17:47:44.890773+00:00 app[web.1]:
2013-12-04T17:47:44.890776+00:00 app[web.1]: ArgumentError (wrong number of arguments (3 for 1)):
https://gist.github.com/Cabbit/7792180

Backend paypal payment doesn't show warning

there is logic in place (fb5748a) to warn users that this payment method can't be used via the backend but it's not working because the view changed and the selector we are trying to use returns an empty set, this affects master and 2-1-stable

Error on after payment returning to website

Hi, I'm trying to use it with Spree v 2.1 stable and I encountered this problem.

After payment paypal redirect user to the original website by an url like:

mydomain.com/paypal/confirm?payment_method_id=5&token=XX-XXXXXXXXXXXXXXXXX&PayerID=XXXXXXXXXXXXX

So, I get this error:

wrong number of arguments (2 for 0..1)

on paypal_controller.rb:63

The origin of this issue appears be the without_protection param. I tried to remove it. Result code was:

      order.payments.create!({
        :source => Spree::PaypalExpressCheckout.create({
          :token => params[:token],
          :payer_id => params[:PayerID]
        }),
        :amount => order.total,
        :payment_method => payment_method
      })

By this way it goes on, but it crash ahead with this error:

No such file or directory - config/paypal.yml

on read_configuration paypal-sdk-core (0.2.6) lib/paypal-sdk/core/config.rb:241
This last error appears be likely #15

Getting failed payment everytime

Hi! I'm getting a Failed attempt of payment everytime I try. I've setup my business account and I'm trying to buy with the personal account I've previouly setted up.

Any clues? Or any place I can find logs of the error?

Thanks!

Neither product name nor SKU in paypal order

We use rails 3.2.14 and spree 2.0.5.beta

This is our Gemfile:

source 'https://rubygems.org'
ruby '1.9.3'

if RUBY_VERSION =~ /1.9/
  Encoding.default_external = Encoding::UTF_8
  Encoding.default_internal = Encoding::UTF_8
end

gem 'rails',        '~> 3.2'
gem 'sass-rails',   '~> 3.2'
gem 'compass-rails'
gem 'slim-rails'
gem 'authlogic'
gem 'maruku'

gem 'spree', '2.0.5.beta',  :github => 'spree/spree',                 :branch => '2-0-stable'
gem 'spree_i18n',           :github => 'spree/spree_i18n',            :branch => '2-0-stable'
gem 'spree_gateway',        :github => 'spree/spree_gateway',         :branch => '2-0-stable'
gem 'spree_auth_devise',    :github => 'spree/spree_auth_devise',     :branch => '2-0-stable'
gem 'spree_static_content', :github => 'spree/spree_static_content',  :branch => '2-0-stable'
gem 'spree_editor',         :github => 'spree/spree_editor'
gem 'spree_paypal_express', :github => "radar/better_spree_paypal_express", :branch => "2-0-stable"

# Gems used only for assets and not required in production environments by default.
group :assets do
  gem 'coffee-rails', '~> 3.2'
  gem 'uglifier', '>= 1.0.3'
  gem 'compass-rails'
end

group :development, :test do
  gem 'rspec-rails'
  gem 'capybara'
  gem 'sqlite3-ruby'
  gem 'debugger'
  gem 'mocha'
  gem 'factory_girl_rails'
end

# heroku stuff
gem 'pg'
gem 'activerecord-postgresql-adapter'
gem 'heroku'
gem 'taps'
gem 'thin'
gem 'foreman'
gem 'sentry-raven' # https://devcenter.heroku.com/articles/sentry

# our extensions
gem 'spree_multilingual_static_content', :github => 'momolog/spree_multilingual_static_content'

When checking out the Paypal cart is reached and contains the ordered item with name:
cart
After ordering, the item name does not turn up in the order confirmation (neither for the customer nor the shop):
cart
Nor is it visible in the paypal backend. This makes it impossible to know, which product was ordered.

There obviously is no stacktrace but a inspect of the object returned by BuildSetExpressCheckout (lib/paypal-sdk/merchant/services.rb:573) looks like this

#<PayPal::SDK::Merchant::DataTypes::SetExpressCheckoutRequestType:0x007fb4e30dfd00 
  @SetExpressCheckoutRequestDetails=#<PayPal::SDK::Merchant::DataTypes::SetExpressCheckoutRequestDetailsType:0x007fb4e30dfb70 
    @ReturnURL="http://localhost:3000/paypal/confirm?payment_method_id=3", 
    @CancelURL="http://localhost:3000/paypal/cancel", 
    @PaymentDetails=[
      #<PayPal::SDK::Merchant::DataTypes::PaymentDetailsType:0x007fb4ed476428 
        @OrderTotal=#<PayPal::SDK::Merchant::DataTypes::BasicAmountType:0x007fb4ed476338 
          @currencyID="EUR", 
          @value="0.1"
        >, 
      @ItemTotal=#<PayPal::SDK::Merchant::DataTypes::BasicAmountType:0x007fb4ed47bb80 
        @currencyID="EUR", 
        @value="0.1"
       >, 
       @ShippingTotal=#<PayPal::SDK::Merchant::DataTypes::BasicAmountType:0x007fb4ed4796c8 
         @currencyID="EUR", 
         @value="0.0"
       >, 
       @TaxTotal=#<PayPal::SDK::Merchant::DataTypes::BasicAmountType:0x007fb4ed47f078 
         @currencyID="EUR", 
         @value="0"
       >, 
       @ShipToAddress=#<PayPal::SDK::Merchant::DataTypes::AddressType:0x007fb4ed47eb78 
         @Name="Olaf Perkins", 
         @Street1="Luisestr. 1", 
         @Street2=nil, 
         @CityName="Berlin", 
         @StateOrProvince="Germany", 
         @Country="DE", 
         @PostalCode="10188"
        >, 
        @PaymentDetailsItem=[
          #<PayPal::SDK::Merchant::DataTypes::PaymentDetailsItemType:0x007fb4ed47ddb8 
            @Name="COPY OF Testprodukt", 
            @Quantity=1, 
            @Amount=#<PayPal::SDK::Merchant::DataTypes::BasicAmountType:0x007fb4ed47d9f8 
              @currencyID="EUR", 
              @value="0.01"
            >, 
           @ItemCategory="Physical"
         >
       ], 
       @ShippingMethod="Shipping Method Name Goes Here", 
       @PaymentAction="Sale", 
       @ButtonSource="PayPal_SDK"
     >
   ]
 >, 
 @Version="106.0"
>

The products SKU seems to be never to transferred to Paypal at all.

I was expecting

  1. the name of the product to be part of the final paypal transaction
  2. that the SKU of the product is transferred as part of the item description to avoid confusion when products have similar names

PayPal uses billing address for the shipping address is this right?

Looking at the following controller:

app/controllers/spree/paypal_controller.rb

It seems as thought the method address_options returns the billing address rather than the shipping address:

    def address_options
      {
        :Name => current_order.bill_address.try(:full_name),
        :Street1 => current_order.bill_address.address1,
        :Street2 => current_order.bill_address.address2,
        :CityName => current_order.bill_address.city,
        # :phone => current_order.bill_address.phone,
        :StateOrProvince => current_order.bill_address.state_text,
        :Country => current_order.bill_address.country.iso,
        :PostalCode => current_order.bill_address.zipcode
      }
    end

This causes an issue, as the callback from paypal updated the shipping address details in the backend.

Should the above be based on shipping address?

Google analytics are stilling reporting Paypal as a referrer.

I know this change was added to add ?utm_nooverride=1 to the returning confirmation URL but I still see Paypal as the referrer for any purchases paid for with them:

0246dde

referral_traffic_-_google_analytics-6

The only thing I could this was it might be related to me not having a confirmation step, but I have adjusted my fork to also include the parameter on the redirects: Hates@b5f930b

Any ideas?

"Save and continue" does nothing useful when PayPal method is selected

On /checkout/payment, pick a PayPal Express payment method and click "Save and continue". You get the same page again with a red banner that helpfully proclaims,

Payment could not be processed, please check the details you entered

Granted the button is supposed to be hidden by JS, but not everyone has JS enabled, and also someone might hypothetically have forgotten to finish the install process (but what are the chances of that?).

Would be nice if this error actually said something like, say, "please click the paypal logo that doesn't look entirely like a button".

In 2-2-stable: ArgumentError in Spree::PaypalController#confirm

I guess you can forget my long explanations, because the tests fail for the same reason.

Failures:

  1) PayPal pays for an order successfully
     Failure/Error: page.should have_content("Your order has been processed successfully")
       expected to find text "Your order has been processed successfully" in "Internal Server Error wrong number of arguments (3 for 1) WEBrick/1.3.1 (Ruby/2.1.0/2013-12-25) at 127.0.0.1:53727"
     # ./spec/features/paypal_spec.rb:56:in `block (2 levels) in <top (required)>'

  2) PayPal includes adjustments in PayPal summary
     Failure/Error: within("#guest_checkout") do
     Capybara::ElementNotFound:
       Unable to find css "#guest_checkout"
     # ./spec/features/paypal_spec.rb:75:in `block (2 levels) in <top (required)>'

  3) PayPal can process an order with $0 item total 
     Failure/Error: within("#guest_checkout") do
     Capybara::ElementNotFound:
       Unable to find css "#guest_checkout"
     # ./spec/features/paypal_spec.rb:139:in `block (3 levels) in <top (required)>'

  4) PayPal as an admin refunding payments can refund payments fully
     Failure/Error: page.should have_content("Your order has been processed successfully")
       expected to find text "Your order has been processed successfully" in "Internal Server Error wrong number of arguments (3 for 1) WEBrick/1.3.1 (Ruby/2.1.0/2013-12-25) at 127.0.0.1:53727"
     # ./spec/features/paypal_spec.rb:201:in `block (4 levels) in <top (required)>'

  5) PayPal as an admin refunding payments can refund payments partially
     Failure/Error: page.should have_content("Your order has been processed successfully")
       expected to find text "Your order has been processed successfully" in "Internal Server Error wrong number of arguments (3 for 1) WEBrick/1.3.1 (Ruby/2.1.0/2013-12-25) at 127.0.0.1:53727"
     # ./spec/features/paypal_spec.rb:201:in `block (4 levels) in <top (required)>'

  6) PayPal as an admin refunding payments errors when given an invalid refund amount
     Failure/Error: page.should have_content("Your order has been processed successfully")
       expected to find text "Your order has been processed successfully" in "Internal Server Error wrong number of arguments (3 for 1) WEBrick/1.3.1 (Ruby/2.1.0/2013-12-25) at 127.0.0.1:53727"
     # ./spec/features/paypal_spec.rb:201:in `block (4 levels) in <top (required)>'

I installed the better_spree_paypal_express into 2-2-stable by strictly following the instructions in the README. The settings I used for the PayPal gateway:

SERVER: sandbox
SOLUTION: Sole
LANDING PAGE: Login

The problem

After the payment in PayPal, when returning back to the Spree storefront, I get this error:

ArgumentError in Spree::PaypalController#confirm
wrong number of arguments (3 for 1)

Occured in 2-2-stable store that is under development, but I confirmed this in sandbox using the head of 2-2-stable that has only this line added to the end of Gemfile:

gem 'spree_paypal_express', github: 'radar/better_spree_paypal_express', branch: '2-2-stable'

Full Trace

ArgumentError in Spree::PaypalController#confirm
wrong number of arguments (3 for 1)

Rails.root: /Users/xxx/Documents/sprees/spree_spree/sandbox

activesupport (4.0.2) lib/active_support/core_ext/kernel/reporting.rb:82:in `capture'
/Users/xxx/Documents/sprees/spree_spree/core/app/models/spree/gateway.rb:3:in `capture'
/Users/xxx/Documents/sprees/spree_spree/core/app/models/spree/payment/processing.rb:47:in `block in capture!'
/Users/xxx/Documents/sprees/spree_spree/core/app/models/spree/payment/processing.rb:182:in `protect_from_connection_error'
/Users/xxx/Documents/sprees/spree_spree/core/app/models/spree/payment/processing.rb:44:in `capture!'
/Users/xxx/Documents/sprees/spree_spree/core/app/models/spree/payment/processing.rb:10:in `process!'
/Users/xxx/Documents/sprees/spree_spree/core/app/models/spree/order.rb:379:in `block in process_payments!'
/Users/xxx/Documents/sprees/spree_spree/core/app/models/spree/order.rb:376:in `each'
/Users/xxx/Documents/sprees/spree_spree/core/app/models/spree/order.rb:376:in `process_payments!'
/Users/xxx/Documents/sprees/spree_spree/core/app/models/spree/order/checkout.rb:74:in `block (2 levels) in define_state_machine!'
state_machine (1.2.0) lib/state_machine/eval_helpers.rb:79:in `call'
state_machine (1.2.0) lib/state_machine/eval_helpers.rb:79:in `evaluate_method'
state_machine (1.2.0) lib/state_machine/callback.rb:191:in `block in run_methods'
state_machine (1.2.0) lib/state_machine/callback.rb:190:in `each'
state_machine (1.2.0) lib/state_machine/callback.rb:190:in `run_methods'
state_machine (1.2.0) lib/state_machine/callback.rb:159:in `call'
state_machine (1.2.0) lib/state_machine/transition.rb:420:in `before'
state_machine (1.2.0) lib/state_machine/transition.rb:246:in `block in run_callbacks'
state_machine (1.2.0) lib/state_machine/transition.rb:348:in `block in pausable'
state_machine (1.2.0) lib/state_machine/transition.rb:348:in `catch'
state_machine (1.2.0) lib/state_machine/transition.rb:348:in `pausable'
state_machine (1.2.0) lib/state_machine/transition.rb:246:in `run_callbacks'
state_machine (1.2.0) lib/state_machine/transition_collection.rb:127:in `run_callbacks'
state_machine (1.2.0) lib/state_machine/transition_collection.rb:212:in `run_callbacks'
state_machine (1.2.0) lib/state_machine/transition_collection.rb:63:in `block (2 levels) in perform'
state_machine (1.2.0) lib/state_machine/transition_collection.rb:63:in `catch'
state_machine (1.2.0) lib/state_machine/transition_collection.rb:63:in `block in perform'
state_machine (1.2.0) lib/state_machine/transition_collection.rb:186:in `within_transaction'
state_machine (1.2.0) lib/state_machine/transition_collection.rb:62:in `perform'
state_machine (1.2.0) lib/state_machine/integrations/active_record.rb:502:in `block in around_save'
state_machine (1.2.0) lib/state_machine/integrations/active_record.rb:530:in `block in transaction'
activerecord (4.0.2) lib/active_record/connection_adapters/abstract/database_statements.rb:202:in `block in transaction'
activerecord (4.0.2) lib/active_record/connection_adapters/abstract/database_statements.rb:210:in `within_new_transaction'
activerecord (4.0.2) lib/active_record/connection_adapters/abstract/database_statements.rb:202:in `transaction'
activerecord (4.0.2) lib/active_record/transactions.rb:209:in `transaction'
state_machine (1.2.0) lib/state_machine/integrations/active_record.rb:529:in `transaction'
state_machine (1.2.0) lib/state_machine/integrations/active_record.rb:501:in `around_save'
state_machine (1.2.0) lib/state_machine/integrations/active_record.rb:483:in `save'
state_machine (1.2.0) lib/state_machine/transition_collection.rb:154:in `block (2 levels) in run_actions'
state_machine (1.2.0) lib/state_machine/transition_collection.rb:154:in `each'
state_machine (1.2.0) lib/state_machine/transition_collection.rb:154:in `block in run_actions'
state_machine (1.2.0) lib/state_machine/transition_collection.rb:170:in `catch_exceptions'
state_machine (1.2.0) lib/state_machine/transition_collection.rb:148:in `run_actions'
state_machine (1.2.0) lib/state_machine/transition_collection.rb:60:in `perform'
state_machine (1.2.0) lib/state_machine/transition.rb:219:in `perform'
state_machine (1.2.0) lib/state_machine/event.rb:172:in `fire'
state_machine (1.2.0) lib/state_machine/event.rb:247:in `block in add_actions'
state_machine (1.2.0) lib/state_machine/machine.rb:765:in `call'
state_machine (1.2.0) lib/state_machine/machine.rb:765:in `block (2 levels) in define_helper'
/Users/xxx/.rvm/gems/ruby-2.1.0/bundler/gems/better_spree_paypal_express-821f2452b17d/app/controllers/spree/paypal_controller.rb:74:in `confirm'
actionpack (4.0.2) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (4.0.2) lib/abstract_controller/base.rb:189:in `process_action'
actionpack (4.0.2) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (4.0.2) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
activesupport (4.0.2) lib/active_support/callbacks.rb:443:in `_run__515079234719357064__process_action__callbacks'
activesupport (4.0.2) lib/active_support/callbacks.rb:80:in `run_callbacks'
actionpack (4.0.2) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (4.0.2) lib/action_controller/metal/rescue.rb:29:in `process_action'
actionpack (4.0.2) lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
activesupport (4.0.2) lib/active_support/notifications.rb:159:in `block in instrument'
activesupport (4.0.2) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
activesupport (4.0.2) lib/active_support/notifications.rb:159:in `instrument'
actionpack (4.0.2) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (4.0.2) lib/action_controller/metal/params_wrapper.rb:245:in `process_action'
activerecord (4.0.2) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (4.0.2) lib/abstract_controller/base.rb:136:in `process'
actionpack (4.0.2) lib/abstract_controller/rendering.rb:44:in `process'
actionpack (4.0.2) lib/action_controller/metal.rb:195:in `dispatch'
actionpack (4.0.2) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
actionpack (4.0.2) lib/action_controller/metal.rb:231:in `block in action'
actionpack (4.0.2) lib/action_dispatch/routing/route_set.rb:80:in `call'
actionpack (4.0.2) lib/action_dispatch/routing/route_set.rb:80:in `dispatch'
actionpack (4.0.2) lib/action_dispatch/routing/route_set.rb:48:in `call'
actionpack (4.0.2) lib/action_dispatch/journey/router.rb:71:in `block in call'
actionpack (4.0.2) lib/action_dispatch/journey/router.rb:59:in `each'
actionpack (4.0.2) lib/action_dispatch/journey/router.rb:59:in `call'
actionpack (4.0.2) lib/action_dispatch/routing/route_set.rb:680:in `call'
railties (4.0.2) lib/rails/engine.rb:511:in `call'
railties (4.0.2) lib/rails/railtie/configurable.rb:30:in `method_missing'
actionpack (4.0.2) lib/action_dispatch/journey/router.rb:71:in `block in call'
actionpack (4.0.2) lib/action_dispatch/journey/router.rb:59:in `each'
actionpack (4.0.2) lib/action_dispatch/journey/router.rb:59:in `call'
actionpack (4.0.2) lib/action_dispatch/routing/route_set.rb:680:in `call'
warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
warden (1.2.3) lib/warden/manager.rb:34:in `catch'
warden (1.2.3) lib/warden/manager.rb:34:in `call'
rack (1.5.2) lib/rack/etag.rb:23:in `call'
rack (1.5.2) lib/rack/conditionalget.rb:25:in `call'
rack (1.5.2) lib/rack/head.rb:11:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/flash.rb:241:in `call'
rack (1.5.2) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.5.2) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/cookies.rb:486:in `call'
activerecord (4.0.2) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.0.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in `call'
activerecord (4.0.2) lib/active_record/migration.rb:369:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.0.2) lib/active_support/callbacks.rb:373:in `_run__4384139033541375386__call__callbacks'
activesupport (4.0.2) lib/active_support/callbacks.rb:80:in `run_callbacks'
actionpack (4.0.2) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/reloader.rb:64:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.0.2) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.0.2) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.0.2) lib/active_support/tagged_logging.rb:67:in `block in tagged'
activesupport (4.0.2) lib/active_support/tagged_logging.rb:25:in `tagged'
activesupport (4.0.2) lib/active_support/tagged_logging.rb:67:in `tagged'
railties (4.0.2) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
rack (1.5.2) lib/rack/runtime.rb:17:in `call'
activesupport (4.0.2) lib/active_support/cache/strategy/local_cache.rb:83:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/static.rb:64:in `call'
rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
railties (4.0.2) lib/rails/engine.rb:511:in `call'
railties (4.0.2) lib/rails/application.rb:97:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
rack (1.5.2) lib/rack/content_length.rb:14:in `call'
rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service'
/Users/xxx/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/webrick/httpserver.rb:138:in `service'
/Users/xxx/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/webrick/httpserver.rb:94:in `run'
/Users/xxx/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/webrick/server.rb:295:in `block in start_thread'

Line Item details not transferring to Paypal

I'm having an issue where lineitem information is not coming across from my spree store to paypal. The information that is missing is the item title, item description, item number, quantity, tax info, etc..

To reproduce, add your item to the cart and checkout using paypal. When you get redirected to paypal, you would typically see all the info I'm referring to above but it is missing. All I'm seeing is "Goods from xxxxx" (I blanked out my store name)

This is using better_spree_paypal_express:
paypal

This is using spree_paypal_express:
paypal_working

Incompatible with Rails 4 because 'attr_accessible'

Hi,
as I understand, the v 2.1 of Spree is totally based on Rails 4. So this extension, in the branch 2.1-stable, shouldn't use rails4 deprecated 'attr_accessible', is it right?

=> Booting Puma
=> Rails 4.0.0 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Exiting
/usr/local/Cellar/ruby/2.0.0-p247/lib/ruby/gems/2.0.0/gems/activemodel-4.0.0/lib/active_model/deprecated_mass_assignment_security.rb:14:in `attr_accessible': `attr_accessible` is extracted out of Rails into a gem. Please use new recommended protection model for params(strong_parameters) or add `protected_attributes` to your Gemfile to use old one. (RuntimeError)
    from /usr/local/lib/ruby/gems/2.0.0/bundler/gems/better_spree_paypal_express-11c747cac357/app/models/spree/gateway/pay_pal_express.rb:9:in `<class:PayPalExpress>'
    from /usr/local/lib/ruby/gems/2.0.0/bundler/gems/better_spree_paypal_express-11c747cac357/app/models/spree/gateway/pay_pal_express.rb:3:in `<module:Spree>'
    from /usr/local/lib/ruby/gems/2.0.0/bundler/gems/better_spree_paypal_express-11c747cac357/app/models/spree/gateway/pay_pal_express.rb:2:in `<top (required)>'
...

Deal with adjustments

Currently this extension only uses Order#item_total, when it should use Order#total. The extension doesn't currently acknowledge adjustments, but it will need to.

Wrong specs: Unable to find link "PayPal"

Failing specs:

  2) PayPal as an admin refunding payments can refund payments fully
     Failure/Error: click_link "PayPal"
     Capybara::ElementNotFound:
       Unable to find link "PayPal"
     # ./spec/features/paypal_spec.rb:206:in `block (4 levels) in <top (required)>'

  3) PayPal as an admin refunding payments can refund payments partially
     Failure/Error: click_link "PayPal"
     Capybara::ElementNotFound:
       Unable to find link "PayPal"
     # ./spec/features/paypal_spec.rb:206:in `block (4 levels) in <top (required)>'

At least in 2-2-stable there really isn't such a link, so the specs should find the link from the first column of the same row.

PayPal is not a link.

NoMethodError thrown when someones accesses paypal urls without an order

I'm using the 2-0-stable version in production for two weeks and woke up to the following two exceptions this morning. They are the first of their kind so they might be a a once-off, but given the key importance of payment processing to e-commerce I thought the issues were worth bringing to your attention.

 GET  /paypal/confirm
 undefined method `payments' for nil:NilClass
 vendor/bundle/ruby/1.9.1/bundler/gems/better_spree_paypal_express-0ec25a294b06/app/controllers/spree/paypal_controller.rb:65:in `confirm'

GET:  /paypal
undefined method `line_items' for nil:NilClass
vendor/bundle/ruby/1.9.1/bundler/gems/better_spree_paypal_express-0ec25a294b06/app/controllers/spree/paypal_controller.rb:4:in `express'

Both occurred when no user was logged in, but the headers appeared to be from a human rather than from a bot.

It's a minor issue but I'm not comfortable with unhandled exceptions in here. Perhaps a named exception (NoOrder) then a redirect back to homepage instead?

auto_capture? always true

I'm using Rails 4.02 with Spree 2-1-stable and trying to setup Spree to only authorize and not capture. This is the behavior of our current PHP app that we are trying to replicate w/ Spree.

After talking with @GeekOnCoffee on IRC referred me to http://guides.spreecommerce.com/developer/payments.html . I've set "config.auto_capture=false" in my spree initializer to authorize and not capture payments as per the doc.

I've done this in our spree initializer, but spree_paypal_express seems to ignore this value and always performs a purchase.

Is this a bug? or does the gem not support authorize only ?

Spree.config do |config|
  config.auto_capture=false
end
gem 'rails', '~> 4.0.2'

# spree stuff
gem 'spree', git: 'https://github.com/spree/spree.git', :branch => '2-1-stable'
gem 'spree_paypal_express', :git => 'https://github.com/radar/better_spree_paypal_express.git', :branch => '2-1-stable'
gem 'spree_gateway', :git => 'https://github.com/spree/spree_gateway.git', :branch => '2-1-stable'
gem 'spree_volume_pricing', :git => 'https://github.com/spree/spree_volume_pricing.git', :branch => '2-1-stable'
gem 'spree_sitemap', git: 'https://github.com/jdutil/spree_sitemap.git'

Allow configuration of confirmation step

Currently it's hardcoded to have confirmation on the PayPal checkout. There should be a configuration option to allow us to specify whether or not the confirmation happens on PayPal or happens on Spree.

If it happens on PayPal, then the user sees a "Pay Now" button on PayPal and then is immediately taken to the complete order page.

If it happens on Spree, then the user sees a "Continue" button on PayPal and is taken to the order confirmation page on Spree. From there, they click "Place Order" and then they're shown the complete order page.

This is the useraction option within PayPalController which is handling this.

Partials Missing

I tried making an order for multiple items, removing one of the items (out of stock, unable to fulfill) and went to issue a refund. When I go to the order -> payments page and click on Paypal I get

Showing /home/vagrant/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/spree_backend-2.0.3/app/views/spree/admin/payments/show.html.erb where line #14 raised:

Missing partial spree/admin/payments/source_views/paypal with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :coffee, :rabl], :versions=>[:v1]}. Searched in:

If I try to do a new payment (create the refund payment) I get

ActionView::MissingTemplate in Spree/admin/payments#new

Showing /home/vagrant/.rbenv/versions/1.9.3-p429/lib/ruby/gems/1.9.1/gems/spree_backend-2.0.3/app/views/spree/admin/payments/_form.html.erb where line #23 raised:

Missing partial spree/admin/payments/source_forms/paypal with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :coffee, :rabl], :versions=>[:v1]}.

The process of getting paypal itself setup was no problem, but I'm sure issuing refunds will be a common scenario.

Error when adding PayPal Express payment method

Hi Ryan,

I am trying to migrate over to your new extension but I get a "ActiveModel::MassAssignmentSecurity::Error - Can't mass-assign protected attributes: preferred_landing_page:" error when trying to save a new paypal payment method.

I am using the 2-0-stable branch of Spree

Started PUT "/admin/payment_methods/5" for 127.0.0.1 at 2013-11-13 14:42:10 +0800
Processing by Spree::Admin::PaymentMethodsController#update as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"saVRy4JRcIYvmLZme8rb7+arYTZ97gJKKu4Gj3zaG5A=", "payment_method"=>{"type"=>"Spree::Gateway::PayPalExpress", "environment"=>"development", "display_on"=>"", "active"=>"true", "name"=>"PayPal", "description"=>""}, "gateway_pay_pal_express"=>{"preferred_login"=>"[REMOVED]", "preferred_password"=>"[FILTERED]", "preferred_signature"=>"[REMOVED]", "preferred_server"=>"sandbox", "preferred_solution"=>"Mark", "preferred_landing_page"=>"Billing", "preferred_logourl"=>"", "preferred_test_mode"=>"1"}, "button"=>"", "id"=>"5"}
  Spree::User Load (0.7ms)  SELECT "spree_users".* FROM "spree_users" WHERE "spree_users"."id" = 1 LIMIT 1
  Spree::Preference Load (0.5ms)  SELECT "spree_preferences".* FROM "spree_preferences" WHERE "spree_preferences"."key" = 'spree/backend_configuration/locale' LIMIT 1
   (0.4ms)  SELECT COUNT(*) FROM "spree_roles" INNER JOIN "spree_roles_users" ON "spree_roles"."id" = "spree_roles_users"."role_id" WHERE "spree_roles_users"."user_id" = 1 AND "spree_roles"."name" = 'admin'
  Spree::PaymentMethod Load (0.3ms)  SELECT "spree_payment_methods".* FROM "spree_payment_methods" WHERE "spree_payment_methods"."deleted_at" IS NULL AND "spree_payment_methods"."id" = $1 AND ("spree_payment_methods".deleted_at IS NULL) LIMIT 1  [["id", "5"]]
   (0.7ms)  BEGIN
   (0.1ms)  ROLLBACK
Completed 500 Internal Server Error in 52.5ms

ActiveModel::MassAssignmentSecurity::Error - Can't mass-assign protected attributes: preferred_landing_page:
  activemodel (3.2.15) lib/active_model/mass_assignment_security/sanitizer.rb:48:in `process_removed_attributes'
  activemodel (3.2.15) lib/active_model/mass_assignment_security/sanitizer.rb:20:in `debug_protected_attribute_removal'
  activemodel (3.2.15) lib/active_model/mass_assignment_security/sanitizer.rb:12:in `sanitize'
  activemodel (3.2.15) lib/active_model/mass_assignment_security.rb:230:in `sanitize_for_mass_assignment'
  activerecord (3.2.15) lib/active_record/attribute_assignment.rb:75:in `assign_attributes'
  activerecord (3.2.15) lib/active_record/persistence.rb:216:in `block in update_attributes'
  activerecord (3.2.15) lib/active_record/transactions.rb:313:in `block in with_transaction_returning_status'
  activerecord (3.2.15) lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
  activerecord (3.2.15) lib/active_record/transactions.rb:208:in `transaction'
  activerecord (3.2.15) lib/active_record/transactions.rb:311:in `with_transaction_returning_status'
  activerecord (3.2.15) lib/active_record/persistence.rb:215:in `update_attributes'
   () Users/samhamilton/.rvm/gems/ruby-2.0.0-p247@zooron/bundler/gems/spree-48fb48b0dfbb/backend/app/controllers/spree/admin/payment_methods_controller.rb:40:in `update'
  actionpack (3.2.15) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
  actionpack (3.2.15) lib/abstract_controller/base.rb:167:in `process_action'
  actionpack (3.2.15) lib/action_controller/metal/rendering.rb:10:in `process_action'
  actionpack (3.2.15) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
  activesupport (3.2.15) lib/active_support/callbacks.rb:502:in `_run__4336241257387701292__process_action__374441780409628983__callbacks'
  activesupport (3.2.15) lib/active_support/callbacks.rb:405:in `__run_callback'
  activesupport (3.2.15) lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
  activesupport (3.2.15) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (3.2.15) lib/abstract_controller/callbacks.rb:17:in `process_action'
  actionpack (3.2.15) lib/action_controller/metal/rescue.rb:29:in `process_action'
  actionpack (3.2.15) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
  activesupport (3.2.15) lib/active_support/notifications.rb:123:in `block in instrument'
  activesupport (3.2.15) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (3.2.15) lib/active_support/notifications.rb:123:in `instrument'
  actionpack (3.2.15) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
  actionpack (3.2.15) lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
  activerecord (3.2.15) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
  actionpack (3.2.15) lib/abstract_controller/base.rb:121:in `process'
  actionpack (3.2.15) lib/abstract_controller/rendering.rb:45:in `process'
  actionpack (3.2.15) lib/action_controller/metal.rb:203:in `dispatch'
  actionpack (3.2.15) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
  actionpack (3.2.15) lib/action_controller/metal.rb:246:in `block in action'
  actionpack (3.2.15) lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
  actionpack (3.2.15) 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 `call'
  actionpack (3.2.15) lib/action_dispatch/routing/route_set.rb:608:in `call'
  railties (3.2.15) lib/rails/engine.rb:484:in `call'
  railties (3.2.15) 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 `call'
  actionpack (3.2.15) lib/action_dispatch/routing/route_set.rb:608:in `call'
  warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
  warden (1.2.3) lib/warden/manager.rb:34:in `call'
  actionpack (3.2.15) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
  rack (1.4.5) lib/rack/etag.rb:23:in `call'
  rack (1.4.5) lib/rack/conditionalget.rb:35:in `call'
  actionpack (3.2.15) lib/action_dispatch/middleware/head.rb:14:in `call'
  actionpack (3.2.15) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
  actionpack (3.2.15) lib/action_dispatch/middleware/flash.rb:242:in `call'
  rack (1.4.5) lib/rack/session/abstract/id.rb:210:in `context'
  rack (1.4.5) lib/rack/session/abstract/id.rb:205:in `call'
  actionpack (3.2.15) lib/action_dispatch/middleware/cookies.rb:341:in `call'
  activerecord (3.2.15) lib/active_record/query_cache.rb:64:in `call'
  activerecord (3.2.15) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
  actionpack (3.2.15) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
  activesupport (3.2.15) lib/active_support/callbacks.rb:405:in `_run__2289736791653796182__call__2729788661699198417__callbacks'
  activesupport (3.2.15) lib/active_support/callbacks.rb:405:in `__run_callback'
  activesupport (3.2.15) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
  activesupport (3.2.15) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (3.2.15) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  actionpack (3.2.15) lib/action_dispatch/middleware/reloader.rb:65:in `call'
  actionpack (3.2.15) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
  better_errors (1.0.1) lib/better_errors/middleware.rb:84:in `protected_app_call'
  better_errors (1.0.1) lib/better_errors/middleware.rb:79:in `better_errors_call'
  better_errors (1.0.1) lib/better_errors/middleware.rb:56:in `call'
  airbrake (3.1.14) lib/airbrake/rails/middleware.rb:13:in `call'
  actionpack (3.2.15) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
  actionpack (3.2.15) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
  railties (3.2.15) lib/rails/rack/logger.rb:32:in `call_app'
  railties (3.2.15) lib/rails/rack/logger.rb:16:in `block in call'
  activesupport (3.2.15) lib/active_support/tagged_logging.rb:22:in `tagged'
  railties (3.2.15) lib/rails/rack/logger.rb:16:in `call'
  quiet_assets (1.0.2) lib/quiet_assets.rb:18:in `call_with_quiet_assets'
  actionpack (3.2.15) lib/action_dispatch/middleware/request_id.rb:22:in `call'
  rack (1.4.5) lib/rack/methodoverride.rb:21:in `call'
  rack (1.4.5) lib/rack/runtime.rb:17:in `call'
  activesupport (3.2.15) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
  rack (1.4.5) lib/rack/lock.rb:15:in `call'
  actionpack (3.2.15) lib/action_dispatch/middleware/static.rb:63:in `call'
  airbrake (3.1.14) lib/airbrake/user_informer.rb:16:in `_call'
  airbrake (3.1.14) lib/airbrake/user_informer.rb:12:in `call'
  railties (3.2.15) lib/rails/engine.rb:484:in `call'
  railties (3.2.15) lib/rails/application.rb:231:in `call'
  rack (1.4.5) lib/rack/content_length.rb:14:in `call'
  railties (3.2.15) lib/rails/rack/log_tailer.rb:17:in `call'
  rack (1.4.5) lib/rack/handler/webrick.rb:59:in `service'
  webrick (1.3.1) lib/webrick/httpserver.rb:138:in `service'
  webrick (1.3.1) lib/webrick/httpserver.rb:94:in `run'
  webrick (1.3.1) lib/webrick/server.rb:191:in `block in start_thread'

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.