app/controllers/effective/providers/app_checkout.rb
# TODO: Make app checkout work with admin checkout workflow
Make app checkout work with admin checkout workflow
Make app checkout work with admin checkout workflow
def app_checkout
        @order = Order.find(params[:id])
        (EffectiveOrders.authorized?(self, :update, @order) rescue false)
        checkout = EffectiveOrders.app_checkout[:service].call(order: @order)
        if checkout.success?
          order_purchased(details: payment_details(checkout), provider: 'app_checkout', card: 'none')
        else
          flash = EffectiveOrders.app_checkout[:declined_flash]
          order_declined(details: payment_details(checkout), message: flash, provider: 'app_checkout', card: 'none')
        end
      end
def app_checkout @order = Order . find ( params [ :id ] ) ( EffectiveOrders . authorized? ( self , :update , @order ) rescue false ) checkout = EffectiveOrders . app_checkout [ :service ] . call ( order : @order ) if checkout . success? order_purchased ( details : payment_details ( checkout ) , provider : 'app_checkout' , card : 'none' ) else flash = EffectiveOrders . app_checkout [ :declined_flash ] order_declined ( details : payment_details ( checkout ) , message : flash , provider : 'app_checkout' , card : 'none' ) end end
TODO: Make app checkout work with admin checkout workflow
TODO : Make app checkout work with admin checkout workflow