Fix some attr_accessible problems to do with log entries, payments and PaypalAccount

This commit is contained in:
Ryan Bigg 2012-05-01 21:51:49 -05:00
parent be9e259fdc
commit 51caa03295
2 changed files with 6 additions and 3 deletions

View File

@ -120,13 +120,14 @@ module Spree
paypal_account = Spree::PaypalAccount.find_by_payer_id(params[:PayerID])
payment = @order.payments.create(
payment = @order.payments.create({
:amount => ppx_auth_response.params["gross_amount"].to_f,
:source => paypal_account,
:source_type => 'Spree::PaypalAccount',
:payment_method_id => params[:payment_method_id],
:response_code => ppx_auth_response.params["ack"],
:avs_response => ppx_auth_response.avs_result["code"])
:avs_response => ppx_auth_response.avs_result["code"]},
:without_protection => true)
payment.started_processing!
@ -176,7 +177,7 @@ module Spree
end
def record_log(payment, response)
payment.log_entries.create(:details => response.to_yaml)
payment.log_entries.create({:details => response.to_yaml}, :without_protection => true)
end
def redirect_to_paypal_express_form_if_needed

View File

@ -2,6 +2,8 @@ class Spree::PaypalAccount < ActiveRecord::Base
attr_accessible :email, :payer_id, :payer_country, :payer_status
has_many :payments, :as => :source
attr_accessible :email, :payer_id, :payer_country, :payer_status
def actions
%w{capture credit}
end