Skip to content

StateMachine::InvalidTransition (Cannot transition state via :next from :payment (Reason(s): Нет незавершённых платежей) #1

@BRZInc

Description

@BRZInc

Hello,

Thanks for development of spree_robokassa gem. It looks excellent. Though I have a small issue with it.

Yesterday I've installed it to my site and still can't make it work for me in the test mode. Whenever I try to proceed with payment I get the following exception: StateMachine::InvalidTransition (Cannot transition state via :next from :payment (Reason(s): Нет незавершённых платежей) (in english exception message says 'No payment found').

This exception occurs when I get to the "http://test.robokassa.ru/ReturnResults.aspx?Culture=ru" page and click on "Перейти" button.

I use spree 2.1.4. I've made a fork of this gem and added a few small changes into it: https://github.com/BRZInc/spree_robokassa.git

Here is my log:
I, [2014-01-29T16:45:05.960022 #1095] INFO -- : Completed 200 OK in 1065ms (Views: 775.6ms | ActiveRecord: 43.6ms)
I, [2014-01-29T16:45:15.142067 #1090] INFO -- : Started GET "/gateway/robokassa/result?OutSum=2690.0&InvId=724416111&SignatureValue=A08D9FEE8B0972A64D34802D92546F48" $
I, [2014-01-29T16:45:15.151368 #1090] INFO -- : Processing by Spree::Gateway::RobokassaController#result as HTML
I, [2014-01-29T16:45:15.151471 #1090] INFO -- : Parameters: {"OutSum"=>"2690.0", "InvId"=>"724416111", "SignatureValue"=>"A08D9FEE8B0972A64D34802D92546F48"}
I, [2014-01-29T16:45:15.304705 #1090] INFO -- : Completed 500 Internal Server Error in 153ms
F, [2014-01-29T16:45:15.308554 #1090] FATAL -- :
StateMachine::InvalidTransition (Cannot transition state via :next from :payment (Reason(s): Нет незавершённых платежей)):
state_machine (1.2.0) lib/state_machine/event.rb:252:in block in add_actions' state_machine (1.2.0) lib/state_machine/machine.rb:765:incall'
state_machine (1.2.0) lib/state_machine/machine.rb:765:in block (2 levels) in define_helper' /home/spree/jersey_shop/shared/bundle/ruby/1.9.1/bundler/gems/spree_robokassa-1257d39b8ac2/app/controllers/spree/gateway/robokassa_controller.rb:34:inresult'
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:inprocess_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:inblock in process_action'
activesupport (4.0.0) lib/active_support/callbacks.rb:463:in _run__187398052__process_action__callbacks' activesupport (4.0.0) lib/active_support/callbacks.rb:80:inrun_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:inprocess_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:inblock 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:ininstrument'
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:inprocess_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:inprocess'
actionpack (4.0.0) lib/abstract_controller/rendering.rb:44:in process' actionpack (4.0.0) lib/action_controller/metal.rb:195:indispatch'
actionpack (4.0.0) lib/action_controller/metal/rack_delegation.rb:13:in dispatch' actionpack (4.0.0) lib/action_controller/metal.rb:231:inblock in action'
actionpack (4.0.0) lib/action_dispatch/routing/route_set.rb:80:in `call'

From the log I see that Robokassa tries to call back my site by the Return URL, but an exception occurs on my side, when I try to call @order.next!. I've checked by InvId - I have such an order in my list in the Payment state.

Please help! This thing blows my mind for 2 days already. Can't figure out what else to try

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions