Sha256: c3883e478a9ee4449970e9931edbe38d514374ccd702eef2e6fbf47c2d5d57c2
Contents?: true
Size: 997 Bytes
Versions: 15
Compression:
Stored size: 997 Bytes
Contents
module Effective module Providers module Paypal extend ActiveSupport::Concern included do skip_before_action :verify_authenticity_token, only: [:paypal_postback] end # TODO: Make paypal postback work with admin checkout workflow def paypal_postback @order ||= Effective::Order.where(id: (params[:invoice].to_i rescue 0)).first (EffectiveOrders.authorize!(self, :update, @order) rescue false) if @order.present? if @order.purchased? order_purchased(details: params, provider: 'paypal', card: params[:payment_type]) elsif (params[:payment_status] == 'Completed' && params[:custom] == EffectiveOrders.paypal[:secret]) order_purchased(details: params, provider: 'paypal', card: params[:payment_type]) else order_declined(details: params, provider: 'paypal', card: params[:payment_type]) end end head(:ok) end end end end
Version data entries
15 entries across 15 versions & 1 rubygems