Skip to content
This repository has been archived by the owner on Nov 29, 2019. It is now read-only.

StateMachine::InvalidTransition in checkout#paypal_confirm #68

Closed
patrickmcelwee opened this issue Jul 11, 2012 · 3 comments
Closed

StateMachine::InvalidTransition in checkout#paypal_confirm #68

patrickmcelwee opened this issue Jul 11, 2012 · 3 comments

Comments

@patrickmcelwee
Copy link

I am on the edge of Spree's 1-0-stable branch and a customer just got this error when returning from PayPal:

A StateMachine::InvalidTransition occurred in checkout#paypal_confirm:

  Cannot transition state via :next from "payment" (Reason(s): Transition halted)
  state_machine (1.1.1) lib/state_machine/event.rb:241:in `block in add_actions'

The backtrace is:

  state_machine (1.1.1) lib/state_machine/event.rb:241:in `block in add_actions' 
  state_machine (1.1.1) lib/state_machine/machine.rb:753:in `call'
  state_machine (1.1.1) lib/state_machine/machine.rb:753:in `block (2 levels) in define_helper'
  /data/spree/shared/bundle/ruby/1.9.1/bundler/gems/spree_paypal_express-77840ade5a48/app/controllers/spree/checkout_controller_decorator.rb:150:in `paypal_finish'
  /data/spree/shared/bundle/ruby/1.9.1/bundler/gems/spree_paypal_express-77840ade5a48/app/controllers/spree/checkout_controller_decorator.rb:98:in `paypal_confirm'
  actionpack (3.1.6) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
  actionpack (3.1.6) lib/abstract_controller/base.rb:167:in `process_action'
  actionpack (3.1.6) lib/action_controller/metal/rendering.rb:10:in `process_action'
  actionpack (3.1.6) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
  activesupport (3.1.6) lib/active_support/callbacks.rb:497:in `_run__974073426__process_action__998365959__callbacks'
  activesupport (3.1.6) lib/active_support/callbacks.rb:386:in `_run_process_action_callbacks'
  activesupport (3.1.6) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (3.1.6) lib/abstract_controller/callbacks.rb:17:in `process_action'
  actionpack (3.1.6) lib/action_controller/metal/rescue.rb:17:in `process_action'
  actionpack (3.1.6) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
  activesupport (3.1.6) lib/active_support/notifications.rb:53:in `block in instrument'
  activesupport (3.1.6) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
  activesupport (3.1.6) lib/active_support/notifications.rb:53:in `instrument'
  actionpack (3.1.6) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
  actionpack (3.1.6) lib/action_controller/metal/params_wrapper.rb:201:in `process_action'
  activerecord (3.1.6) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
  newrelic_rpm (3.3.2) lib/new_relic/agent/instrumentation/rails3/action_controller.rb:34:in `block in process_action'
  newrelic_rpm (3.3.2) lib/new_relic/agent/instrumentation/controller_instrumentation.rb:255:in `block in perform_action_with_newrelic_trace'
  newrelic_rpm (3.3.2) lib/new_relic/agent/method_tracer.rb:242:in `trace_execution_scoped'
  newrelic_rpm (3.3.2) lib/new_relic/agent/instrumentation/controller_instrumentation.rb:250:in `perform_action_with_newrelic_trace'
  newrelic_rpm (3.3.2) lib/new_relic/agent/instrumentation/rails3/action_controller.rb:33:in `process_action'
  actionpack (3.1.6) lib/abstract_controller/base.rb:121:in `process'
  actionpack (3.1.6) lib/abstract_controller/rendering.rb:45:in `process'
  actionpack (3.1.6) lib/action_controller/metal.rb:193:in `dispatch'
  actionpack (3.1.6) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
  actionpack (3.1.6) lib/action_controller/metal.rb:236:in `block in action'
  actionpack (3.1.6) lib/action_dispatch/routing/route_set.rb:71:in `call'
  actionpack (3.1.6) lib/action_dispatch/routing/route_set.rb:71:in `dispatch'
  actionpack (3.1.6) lib/action_dispatch/routing/route_set.rb:35:in `call'
  rack-mount (0.8.3) lib/rack/mount/route_set.rb:152:in `block in call'
  rack-mount (0.8.3) lib/rack/mount/code_generation.rb:96:in `block in recognize'
  rack-mount (0.8.3) lib/rack/mount/code_generation.rb:96:in `optimized_each'
  rack-mount (0.8.3) lib/rack/mount/code_generation.rb:95:in `recognize'
  rack-mount (0.8.3) lib/rack/mount/route_set.rb:141:in `call'
  actionpack (3.1.6) lib/action_dispatch/routing/route_set.rb:538:in `call'
  /data/spree/shared/bundle/ruby/1.9.1/bundler/gems/spree-0760b901247f/core/lib/spree/core/middleware/redirect_legacy_product_url.rb:13:in `call'
  /data/spree/shared/bundle/ruby/1.9.1/bundler/gems/spree-0760b901247f/core/lib/spree/core/middleware/seo_assist.rb:27:in `call'
  railties (3.1.6) lib/rails/engine.rb:456:in `call'
  railties (3.1.6) lib/rails/railtie/configurable.rb:30:in `method_missing'
  rack-mount (0.8.3) lib/rack/mount/prefix.rb:26:in `call'
  rack-mount (0.8.3) lib/rack/mount/route_set.rb:152:in `block in call'
  rack-mount (0.8.3) lib/rack/mount/code_generation.rb:96:in `block in recognize'
  rack-mount (0.8.3) lib/rack/mount/code_generation.rb:68:in `optimized_each'
  rack-mount (0.8.3) lib/rack/mount/code_generation.rb:95:in `recognize'
  rack-mount (0.8.3) lib/rack/mount/route_set.rb:141:in `call'
  actionpack (3.1.6) lib/action_dispatch/routing/route_set.rb:538:in `call'
  newrelic_rpm (3.3.2) lib/new_relic/rack/browser_monitoring.rb:23:in `call'
  exception_notification (2.6.1) lib/exception_notifier.rb:34:in `call'
  warden (1.0.6) lib/warden/manager.rb:35:in `block in call'
  warden (1.0.6) lib/warden/manager.rb:34:in `catch'
  warden (1.0.6) lib/warden/manager.rb:34:in `call'
  actionpack (3.1.6) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
  rack (1.3.6) lib/rack/etag.rb:23:in `call'
  rack (1.3.6) lib/rack/conditionalget.rb:25:in `call'
  actionpack (3.1.6) lib/action_dispatch/middleware/head.rb:14:in `call'
  actionpack (3.1.6) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
  actionpack (3.1.6) lib/action_dispatch/middleware/flash.rb:243:in `call'
  rack (1.3.6) lib/rack/session/abstract/id.rb:195:in `context'
  rack (1.3.6) lib/rack/session/abstract/id.rb:190:in `call'
  actionpack (3.1.6) lib/action_dispatch/middleware/cookies.rb:331:in `call'
  activerecord (3.1.6) lib/active_record/query_cache.rb:64:in `call'
  activerecord (3.1.6) lib/active_record/connection_adapters/abstract/connection_pool.rb:477:in `call'
  actionpack (3.1.6) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
  activesupport (3.1.6) lib/active_support/callbacks.rb:392:in `_run_call_callbacks'
  activesupport (3.1.6) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (3.1.6) lib/action_dispatch/middleware/callbacks.rb:28:in `call'
  rack (1.3.6) lib/rack/sendfile.rb:101:in `call'
  actionpack (3.1.6) lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
  actionpack (3.1.6) lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
  railties (3.1.6) lib/rails/rack/logger.rb:13:in `call'
  rack (1.3.6) lib/rack/methodoverride.rb:24:in `call'
  rack (1.3.6) lib/rack/runtime.rb:17:in `call'
  activesupport (3.1.6) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
  rack (1.3.6) lib/rack/lock.rb:15:in `call'
  rack-cache (1.2) lib/rack/cache/context.rb:136:in `forward'
  rack-cache (1.2) lib/rack/cache/context.rb:245:in `fetch'
  rack-cache (1.2) lib/rack/cache/context.rb:185:in `lookup'
  rack-cache (1.2) lib/rack/cache/context.rb:66:in `call!'
  rack-cache (1.2) lib/rack/cache/context.rb:51:in `call'
  railties (3.1.6) lib/rails/engine.rb:456:in `call'
  railties (3.1.6) lib/rails/application.rb:143:in `call'
  railties (3.1.6) lib/rails/railtie/configurable.rb:30:in `method_missing'
  unicorn (4.2.0) lib/unicorn/http_server.rb:530:in `process_client'
  unicorn (4.2.0) lib/unicorn/http_server.rb:604:in `worker_loop'
  newrelic_rpm (3.3.2) lib/new_relic/agent/instrumentation/unicorn_instrumentation.rb:17:in `call'
  newrelic_rpm (3.3.2) lib/new_relic/agent/instrumentation/unicorn_instrumentation.rb:17:in `block (4 levels) in <top (required)>'
  unicorn (4.2.0) lib/unicorn/http_server.rb:487:in `spawn_missing_workers'
  unicorn (4.2.0) lib/unicorn/http_server.rb:498:in `maintain_worker_count'
  unicorn (4.2.0) lib/unicorn/http_server.rb:272:in `join'
  unicorn (4.2.0) bin/unicorn_rails:209:in `<top (required)>'
  /data/spree/shared/bundle/ruby/1.9.1/bin/unicorn_rails:19:in `load'
  /data/spree/shared/bundle/ruby/1.9.1/bin/unicorn_rails:19:in `<main>'
@radar
Copy link

radar commented Jul 13, 2012

Please provide steps to reproduce this issue

@patrickmcelwee
Copy link
Author

I can confirm that this was caused by bumping my version of Spree 1.0 from 33035d8bff158a2a18b43806a27accf590d23f16 (where a PayPal checkout works) to 0760b901247f0bf8839a69a620a0d31d8afc9aef

In order to reproduce, I had to add attr_accessible to the 1-0-stable branch. I have a pull request to fix that separate issue: #69

Here are the steps:

  1. Setup Spree store using Spree ref: 0760b901247f0bf8839a69a620a0d31d8afc9aef
  2. Add gem spree_paypal_express, branch: 1-0-stable
  3. You will need a PayPal Developer Account to create a test Business Account.
  4. In Development Server, as admin on /admin/payment_methods, create a Spree::BillingIntegration::PaypalExpress with the following options: Environment => 'Development', Display => 'Both', Active => 'Yes', Fill in Login, Password and Signature with test developer account information. Server => 'test', Test Mode => checked; [I also have Review unchecked and "No Shipping" Checked]. Click update.
  5. Create an order with one product.
  6. Proceed through checkout to payment and choose PayPal.
  7. Go to PayPal and fill in information. Confirm payment.
  8. The above error is raised.

Thanks for taking a look radar!

@radar
Copy link

radar commented Jul 13, 2012

Fixed with #69.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants