lib/processout/transaction.rb in processout-2.5.0 vs lib/processout/transaction.rb in processout-2.6.0
- old
+ new
@@ -26,10 +26,12 @@
attr_reader :refunds
attr_reader :name
attr_reader :amount
attr_reader :authorized_amount
attr_reader :captured_amount
+ attr_reader :refunded_amount
+ attr_reader :available_amount
attr_reader :currency
attr_reader :error_code
attr_reader :three_d_s_status
attr_reader :status
attr_reader :authorized
@@ -240,10 +242,18 @@
def captured_amount=(val)
@captured_amount = val
end
+ def refunded_amount=(val)
+ @refunded_amount = val
+ end
+
+ def available_amount=(val)
+ @available_amount = val
+ end
+
def currency=(val)
@currency = val
end
def error_code=(val)
@@ -317,10 +327,12 @@
self.refunds = data.fetch(:refunds, nil)
self.name = data.fetch(:name, nil)
self.amount = data.fetch(:amount, nil)
self.authorized_amount = data.fetch(:authorized_amount, nil)
self.captured_amount = data.fetch(:captured_amount, nil)
+ self.refunded_amount = data.fetch(:refunded_amount, nil)
+ self.available_amount = data.fetch(:available_amount, nil)
self.currency = data.fetch(:currency, nil)
self.error_code = data.fetch(:error_code, nil)
self.three_d_s_status = data.fetch(:three_d_s_status, nil)
self.status = data.fetch(:status, nil)
self.authorized = data.fetch(:authorized, nil)
@@ -407,10 +419,16 @@
self.authorized_amount = data["authorized_amount"]
end
if data.include? "captured_amount"
self.captured_amount = data["captured_amount"]
end
+ if data.include? "refunded_amount"
+ self.refunded_amount = data["refunded_amount"]
+ end
+ if data.include? "available_amount"
+ self.available_amount = data["available_amount"]
+ end
if data.include? "currency"
self.currency = data["currency"]
end
if data.include? "error_code"
self.error_code = data["error_code"]
@@ -475,9 +493,11 @@
self.refunds = data.fetch(:refunds, self.refunds)
self.name = data.fetch(:name, self.name)
self.amount = data.fetch(:amount, self.amount)
self.authorized_amount = data.fetch(:authorized_amount, self.authorized_amount)
self.captured_amount = data.fetch(:captured_amount, self.captured_amount)
+ self.refunded_amount = data.fetch(:refunded_amount, self.refunded_amount)
+ self.available_amount = data.fetch(:available_amount, self.available_amount)
self.currency = data.fetch(:currency, self.currency)
self.error_code = data.fetch(:error_code, self.error_code)
self.three_d_s_status = data.fetch(:three_d_s_status, self.three_d_s_status)
self.status = data.fetch(:status, self.status)
self.authorized = data.fetch(:authorized, self.authorized)