Sha256: 7be40625ae82313a072eca9eda712231ef443a49a95769ac61650fa28134b52f
Contents?: true
Size: 907 Bytes
Versions: 12
Compression:
Stored size: 907 Bytes
Contents
module Spree class PagSeguroController < BaseController protect_from_forgery :except => [:notify] skip_before_filter :restriction_access def notify notification = Spree::PaymentNotification.create_from_params(params) if notification.approved? Order.transaction do @order = Spree::Order.find(notification.id) # 1. Assume that if payment notification comes, it's exactly for the amount # sent to pagseguro (safe assumption -- cart can't be edited while on pagseguro) # 2. Can't use Order#total, as it's intercepted by spree-multi-currency # which might lead to lots of false "credit owed" payment states # (when they should be "complete") @order.payment.complete end end render nothing: true, head: :ok end def callback end end end
Version data entries
12 entries across 12 versions & 1 rubygems