lib/processout/transaction.rb in processout-2.1.0 vs lib/processout/transaction.rb in processout-2.2.0

- old
+ new

@@ -21,13 +21,15 @@ attr_reader :card attr_reader :card_id attr_reader :operations attr_reader :refunds attr_reader :name + attr_reader :amount attr_reader :authorized_amount attr_reader :captured_amount attr_reader :currency + attr_reader :error_code attr_reader :status attr_reader :authorized attr_reader :captured attr_reader :processout_fee attr_reader :estimated_fee @@ -203,10 +205,14 @@ def name=(val) @name = val end + def amount=(val) + @amount = val + end + def authorized_amount=(val) @authorized_amount = val end def captured_amount=(val) @@ -215,10 +221,14 @@ def currency=(val) @currency = val end + def error_code=(val) + @error_code = val + end + def status=(val) @status = val end def authorized=(val) @@ -275,13 +285,15 @@ self.card = data.fetch(:card, nil) self.card_id = data.fetch(:card_id, nil) self.operations = data.fetch(:operations, nil) 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.currency = data.fetch(:currency, nil) + self.error_code = data.fetch(:error_code, nil) self.status = data.fetch(:status, nil) self.authorized = data.fetch(:authorized, nil) self.captured = data.fetch(:captured, nil) self.processout_fee = data.fetch(:processout_fee, nil) self.estimated_fee = data.fetch(:estimated_fee, nil) @@ -350,19 +362,25 @@ self.refunds = data["refunds"] end if data.include? "name" self.name = data["name"] end + if data.include? "amount" + self.amount = data["amount"] + end if data.include? "authorized_amount" self.authorized_amount = data["authorized_amount"] end if data.include? "captured_amount" self.captured_amount = data["captured_amount"] end if data.include? "currency" self.currency = data["currency"] end + if data.include? "error_code" + self.error_code = data["error_code"] + end if data.include? "status" self.status = data["status"] end if data.include? "authorized" self.authorized = data["authorized"] @@ -413,12 +431,14 @@ self.card = data.fetch(:card, self.card) self.card_id = data.fetch(:card_id, self.card_id) self.operations = data.fetch(:operations, self.operations) 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.currency = data.fetch(:currency, self.currency) + self.error_code = data.fetch(:error_code, self.error_code) self.status = data.fetch(:status, self.status) self.authorized = data.fetch(:authorized, self.authorized) self.captured = data.fetch(:captured, self.captured) self.processout_fee = data.fetch(:processout_fee, self.processout_fee) self.estimated_fee = data.fetch(:estimated_fee, self.estimated_fee)