lib/active_merchant/billing/gateways/nab_transact.rb in activemerchant-1.23.0 vs lib/active_merchant/billing/gateways/nab_transact.rb in activemerchant-1.24.0

- old
+ new

@@ -79,10 +79,19 @@ commit_periodic(build_periodic_item(:deletecrn, options[:amount], nil, options)) end private + def add_metadata(xml, options) + if options[:merchant_name] || options[:merchant_location] + xml.tag! 'metadata' do + xml.tag! 'meta', :name => 'ca_name', :value => options[:merchant_name] if options[:merchant_name] + xml.tag! 'meta', :name => 'ca_location', :value => options[:merchant_location] if options[:merchant_location] + end + end + end + def build_purchase_request(money, credit_card, options) xml = Builder::XmlMarkup.new xml.tag! 'amount', amount(money) xml.tag! 'currency', options[:currency] || currency(money) xml.tag! 'purchaseOrderNo', options[:order_id].to_s.gsub(/[ ']/, '') @@ -90,9 +99,11 @@ xml.tag! 'CreditCardInfo' do xml.tag! 'cardNumber', credit_card.number xml.tag! 'expiryDate', expdate(credit_card) xml.tag! 'cvv', credit_card.verification_value if credit_card.verification_value? end + + add_metadata(xml, options) xml.target! end #Generate payment request XML