lib/processout/transaction.rb in processout-2.23.0 vs lib/processout/transaction.rb in processout-2.24.0

- old
+ new

@@ -20,10 +20,11 @@ attr_reader :token attr_reader :token_id attr_reader :card attr_reader :card_id attr_reader :gateway_configuration + attr_reader :external_three_d_s_gateway_configuration attr_reader :gateway_configuration_id attr_reader :operations attr_reader :refunds attr_reader :name attr_reader :amount @@ -61,10 +62,13 @@ attr_reader :chargedback_at attr_reader :refunded_at attr_reader :three_d_s attr_reader :cvc_check attr_reader :avs_check + attr_reader :initial_scheme_transaction_id + attr_reader :scheme_id + attr_reader :payment_type def id=(val) @id = val end @@ -203,10 +207,26 @@ @gateway_configuration = obj end end + def external_three_d_s_gateway_configuration=(val) + if val.nil? + @external_three_d_s_gateway_configuration = val + return + end + + if val.instance_of? GatewayConfiguration + @external_three_d_s_gateway_configuration = val + else + obj = GatewayConfiguration.new(@client) + obj.fill_with_data(val) + @external_three_d_s_gateway_configuration = obj + end + + end + def gateway_configuration_id=(val) @gateway_configuration_id = val end def operations=(val) @@ -411,10 +431,22 @@ def avs_check=(val) @avs_check = val end + def initial_scheme_transaction_id=(val) + @initial_scheme_transaction_id = val + end + + def scheme_id=(val) + @scheme_id = val + end + + def payment_type=(val) + @payment_type = val + end + # Initializes the Transaction object # Params: # +client+:: +ProcessOut+ client instance # +data+:: data that can be used to fill the object @@ -433,10 +465,11 @@ self.token = data.fetch(:token, nil) self.token_id = data.fetch(:token_id, nil) self.card = data.fetch(:card, nil) self.card_id = data.fetch(:card_id, nil) self.gateway_configuration = data.fetch(:gateway_configuration, nil) + self.external_three_d_s_gateway_configuration = data.fetch(:external_three_d_s_gateway_configuration, nil) self.gateway_configuration_id = data.fetch(:gateway_configuration_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) @@ -474,10 +507,13 @@ self.chargedback_at = data.fetch(:chargedback_at, nil) self.refunded_at = data.fetch(:refunded_at, nil) self.three_d_s = data.fetch(:three_d_s, nil) self.cvc_check = data.fetch(:cvc_check, nil) self.avs_check = data.fetch(:avs_check, nil) + self.initial_scheme_transaction_id = data.fetch(:initial_scheme_transaction_id, nil) + self.scheme_id = data.fetch(:scheme_id, nil) + self.payment_type = data.fetch(:payment_type, nil) end # Create a new Transaction using the current client def new(data = {}) @@ -499,10 +535,11 @@ "token": self.token, "token_id": self.token_id, "card": self.card, "card_id": self.card_id, "gateway_configuration": self.gateway_configuration, + "external_three_d_s_gateway_configuration": self.external_three_d_s_gateway_configuration, "gateway_configuration_id": self.gateway_configuration_id, "operations": self.operations, "refunds": self.refunds, "name": self.name, "amount": self.amount, @@ -540,10 +577,13 @@ "chargedback_at": self.chargedback_at, "refunded_at": self.refunded_at, "three_d_s": self.three_d_s, "cvc_check": self.cvc_check, "avs_check": self.avs_check, + "initial_scheme_transaction_id": self.initial_scheme_transaction_id, + "scheme_id": self.scheme_id, + "payment_type": self.payment_type, }.to_json end # Fills the object with data coming from the API # Params: @@ -592,10 +632,13 @@ self.card_id = data["card_id"] end if data.include? "gateway_configuration" self.gateway_configuration = data["gateway_configuration"] end + if data.include? "external_three_d_s_gateway_configuration" + self.external_three_d_s_gateway_configuration = data["external_three_d_s_gateway_configuration"] + end if data.include? "gateway_configuration_id" self.gateway_configuration_id = data["gateway_configuration_id"] end if data.include? "operations" self.operations = data["operations"] @@ -715,10 +758,19 @@ self.cvc_check = data["cvc_check"] end if data.include? "avs_check" self.avs_check = data["avs_check"] end + if data.include? "initial_scheme_transaction_id" + self.initial_scheme_transaction_id = data["initial_scheme_transaction_id"] + end + if data.include? "scheme_id" + self.scheme_id = data["scheme_id"] + end + if data.include? "payment_type" + self.payment_type = data["payment_type"] + end self end # Prefills the object with the data passed as parameters @@ -740,10 +792,11 @@ self.token = data.fetch(:token, self.token) self.token_id = data.fetch(:token_id, self.token_id) self.card = data.fetch(:card, self.card) self.card_id = data.fetch(:card_id, self.card_id) self.gateway_configuration = data.fetch(:gateway_configuration, self.gateway_configuration) + self.external_three_d_s_gateway_configuration = data.fetch(:external_three_d_s_gateway_configuration, self.external_three_d_s_gateway_configuration) self.gateway_configuration_id = data.fetch(:gateway_configuration_id, self.gateway_configuration_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) @@ -781,9 +834,12 @@ self.chargedback_at = data.fetch(:chargedback_at, self.chargedback_at) self.refunded_at = data.fetch(:refunded_at, self.refunded_at) self.three_d_s = data.fetch(:three_d_s, self.three_d_s) self.cvc_check = data.fetch(:cvc_check, self.cvc_check) self.avs_check = data.fetch(:avs_check, self.avs_check) + self.initial_scheme_transaction_id = data.fetch(:initial_scheme_transaction_id, self.initial_scheme_transaction_id) + self.scheme_id = data.fetch(:scheme_id, self.scheme_id) + self.payment_type = data.fetch(:payment_type, self.payment_type) self end # Get the transaction's refunds.