Sha256: de1e82f766c71ccd126a918cd5c6e60ddb83ae76192c582f24526b9f079305ca
Contents?: true
Size: 952 Bytes
Versions: 15
Compression:
Stored size: 952 Bytes
Contents
module Effective module Providers module AppCheckout extend ActiveSupport::Concern included do 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 private def payment_details(checkout) default = 'App Checkout' if checkout.respond_to?(:payment_details) checkout.payment_details.presence || default else default end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems