Browse files

added raw_body attribute to payment method for error processing

  • Loading branch information...
1 parent 135742c commit dffaa73eed57d1a7caba5c05baaa130f1460d224 @rufo committed Dec 26, 2011
Showing with 5 additions and 2 deletions.
  1. +5 −2 lib/spreedly_core/payment_method.rb
View
7 lib/spreedly_core/payment_method.rb
@@ -5,6 +5,8 @@ class PaymentMethod < Base
:last_name, :month, :number, :payment_method_type, :phone_number,
:state, :token, :updated_at, :verification_value, :year, :zip)
+ attr_reader :raw_body
+
# configure additional required fiels. Like :address1, :city, :state
def self.additional_required_cc_fields *fields
@@additional_required_fields ||= Set.new
@@ -20,13 +22,14 @@ def self.reset_additional_required_cc_fields
def self.find(token)
return nil if token.nil?
verify_get("/payment_methods/#{token}.xml") do |response|
- new(response.parsed_response["payment_method"])
+ new(response.parsed_response["payment_method"], response.body)
end
end
# Create a new PaymentMethod based on the attrs hash and then validate
- def initialize(attrs={})
+ def initialize(attrs={}, raw_body = nil)
super(attrs)
+ @raw_body = raw_body
validate
end

0 comments on commit dffaa73

Please sign in to comment.