Sha256: 7886ed3dd3c1b21a342672ba6bd86122e7076363fe5ba65e4687c060b64a4c9c
Contents?: true
Size: 997 Bytes
Versions: 69
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(payment: params, provider: 'paypal', card: params[:payment_type]) elsif (params[:payment_status] == 'Completed' && params[:custom] == EffectiveOrders.paypal[:secret]) order_purchased(payment: params, provider: 'paypal', card: params[:payment_type]) else order_declined(payment: params, provider: 'paypal', card: params[:payment_type]) end end head(:ok) end end end end
Version data entries
69 entries across 69 versions & 1 rubygems