lib/active_merchant/billing/gateways/culqi.rb in activemerchant-1.101.0 vs lib/active_merchant/billing/gateways/culqi.rb in activemerchant-1.102.0

- old
+ new

@@ -171,25 +171,26 @@ if (billing_address = options[:billing_address] || options[:address]) post[:street] = [billing_address[:address1], billing_address[:address2]].join(' ') post[:city] = billing_address[:city] post[:state] = billing_address[:state] post[:countrycode] = billing_address[:country] - post[:zip] = billing_address[:zip] + post[:zip] = billing_address[:zip] post[:telno] = billing_address[:phone] post[:telnocc] = options[:telephone_country_code] || '051' end end def add_checksum(action, post) - checksum_elements = case action - when :capture then [post[:toid], post[:trackingid], post[:captureamount], @options[:secret_key]] - when :void then [post[:toid], post[:description], post[:trackingid], @options[:secret_key]] - when :refund then [post[:toid], post[:trackingid], post[:refundamount], @options[:secret_key]] - when :tokenize then [post[:partnerid], post[:cardnumber], post[:cvv], @options[:secret_key]] - when :invalidate then [post[:partnerid], post[:token], @options[:secret_key]] - else [post[:toid], post[:totype], post[:amount], post[:description], post[:redirecturl], - post[:cardnumber] || post[:token], @options[:secret_key]] - end + checksum_elements = + case action + when :capture then [post[:toid], post[:trackingid], post[:captureamount], @options[:secret_key]] + when :void then [post[:toid], post[:description], post[:trackingid], @options[:secret_key]] + when :refund then [post[:toid], post[:trackingid], post[:refundamount], @options[:secret_key]] + when :tokenize then [post[:partnerid], post[:cardnumber], post[:cvv], @options[:secret_key]] + when :invalidate then [post[:partnerid], post[:token], @options[:secret_key]] + else [post[:toid], post[:totype], post[:amount], post[:description], post[:redirecturl], + post[:cardnumber] || post[:token], @options[:secret_key]] + end post[:checksum] = Digest::MD5.hexdigest(checksum_elements.compact.join('|')) end def add_reference(post, authorization)