Module: Effective::Providers::AppCheckout
- Extended by:
- ActiveSupport::Concern
- Included in:
- OrdersController
- Defined in:
- app/controllers/effective/providers/app_checkout.rb
Instance Method Summary collapse
-
#app_checkout ⇒ Object
TODO: Make app checkout work with admin checkout workflow.
Instance Method Details
#app_checkout ⇒ Object
TODO: Make app checkout work with admin checkout workflow
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'app/controllers/effective/providers/app_checkout.rb', line 11 def app_checkout @order = Order.find(params[:id]) (EffectiveOrders.(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 |