app/controllers/effective/providers/stripe.rb
# TODO: Make stripe charge work with admin checkout workflow, purchased_url and declined_url
# Make it save the customer and not require typing in a CC every time.
Make stripe charge work with admin checkout workflow, purchased_url and declined_url
Make it save the customer and not require typing in a CC every time.
Make stripe charge work with admin checkout workflow purchased_url and declined_url Make it save the customer and not require typing in a CC every time .
def stripe_charge
        @order ||= Effective::Order.find(stripe_charge_params[:effective_order_id])
        @stripe_charge = Effective::Providers::StripeCharge.new(stripe_charge_params)
        @stripe_charge.order = @order
        EffectiveOrders.authorized?(self, :update, @order)
        if @stripe_charge.valid? && (response = process_stripe_charge(@stripe_charge)) != false
          order_purchased(
            details: response,
            provider: (EffectiveOrders.stripe_connect_enabled ? 'stripe_connect' : 'stripe'),
            card: (response[:charge]['source']['brand'] rescue nil)
          )
        else
          @page_title = 'Checkout'
          flash.now[:danger] = @stripe_charge.errors.full_messages.to_sentence
          render :show
        end
      end
def stripe_charge @order ||= Effective :: Order . find ( stripe_charge_params [ :effective_order_id ] ) @stripe_charge = Effective :: Providers :: StripeCharge . new ( stripe_charge_params ) @stripe_charge . order = @order EffectiveOrders . authorized? ( self , :update , @order ) if @stripe_charge . valid? && ( response = process_stripe_charge ( @stripe_charge ) ) != false order_purchased ( details : response , provider : ( EffectiveOrders . stripe_connect_enabled ? 'stripe_connect' : 'stripe' ) , card : ( response [ :charge ] [ 'source' ] [ 'brand' ] rescue nil ) ) else @page_title = 'Checkout' flash . now [ :danger ] = @stripe_charge . errors . full_messages . to_sentence render :show end end
TODO: Make stripe charge work with admin checkout workflow, purchased_url and declined_url
Make it save the customer and not require typing in a CC every time.
TODO : Make stripe charge work with admin checkout workflow purchased_url and declined_url Make it save the customer and not require typing in a CC every time .