Hi,

I trying to update this gem to spree 2.0.3:
https://github.com/tuttinator/spree_pxpay_paymentmethod/blob/master/app/controllers/checkout_controller_decorator.rb

  if payment then
      if response[:success] == '1'
        payment.started_processing
        payment.response_code = response[:auth_code]
        payment.save
        payment.complete
#till here it works, it makes the payment complete and orders is paid
         @order = payment.order
# @order.next is always false..
  @order.next

         state_callback(:after)
        if @order.state == "complete" || @order.completed?
          state_callback(:before)
          flash.notice = t(:order_processed_successfully)
          flash[:commerce_tracking] = "nothing special"
          redirect_to completion_route
        else
          respond_with(@order, :location => checkout_state_path(@order.state
))
        end

Search Discussions

  • Ryan Bigg at Sep 26, 2013 at 9:11 am
    What seems to be the problem here?

    On Thu, Sep 26, 2013 at 5:38 PM, Michael Annex
    wrote:
    Hi,
    I trying to update this gem to spree 2.0.3:
    https://github.com/tuttinator/spree_pxpay_paymentmethod/blob/master/app/controllers/checkout_controller_decorator.rb
    if payment then
    if response[:success] == '1'
    payment.started_processing
    payment.response_code = response[:auth_code]
    payment.save
    payment.complete
    #till here it works, it makes the payment complete and orders is paid
    @order = payment.order
    # @order.next is always false..
    @order.next
    state_callback(:after)
    if @order.state == "complete" || @order.completed?
    state_callback(:before)
    flash.notice = t(:order_processed_successfully)
    flash[:commerce_tracking] = "nothing special"
    redirect_to completion_route
    else
    respond_with(@order, :location => checkout_state_path(@order.state
    ))
    end
  • Michael Annex at Sep 27, 2013 at 4:52 am
    it works now in development, but not in production, it sends false amounts
    to pxpay gateway,
    in the database the payment and order table looks good. Do I have to update
    other db tables like shipments?

    How can I make improvements? I am not sure about the skip_before_filters.

    here is the code:

    https://github.com/Michael1969/spree_pxpay_paymentmethod

    thanks, Michael
  • Ryan Bigg at Oct 1, 2013 at 11:27 pm
    What do you mean by "false amounts"?

    Can you please provide me with some steps to reproduce the issue that
    you're seeing so that I can quickly investigate it?

    On Fri, Sep 27, 2013 at 2:51 PM, Michael Annex wrote:

    it works now in development, but not in production, it sends false amounts
    to pxpay gateway,
    in the database the payment and order table looks good. Do I have to
    update other db tables like shipments?

    How can I make improvements? I am not sure about the skip_before_filters.

    here is the code:

    https://github.com/Michael1969/spree_pxpay_paymentmethod

    thanks, Michael


    --

    Ryan Bigg
    Community Manager
    Spree Commerce, Inc.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupspree-user @
categoriesrubyonrails
postedSep 26, '13 at 7:38a
activeOct 1, '13 at 11:27p
posts4
users2
websitespreecommerce.com
irc#RubyOnRails

2 users in discussion

Ryan Bigg: 2 posts Michael Annex: 2 posts

People

Translate

site design / logo © 2022 Grokbase