lib/active_merchant/billing/gateways/payflow.rb in yetanothernguyen-activemerchant-1.16.0 vs lib/active_merchant/billing/gateways/payflow.rb in yetanothernguyen-activemerchant-1.21.0
- old
+ new
@@ -92,10 +92,14 @@
xml.tag! 'CustIP', options[:ip] unless options[:ip].blank?
xml.tag! 'InvNum', options[:order_id].to_s.gsub(/[^\w.]/, '') unless options[:order_id].blank?
xml.tag! 'Description', options[:description] unless options[:description].blank?
xml.tag! 'Comment', options[:comment] unless options[:comment].blank?
xml.tag!('ExtData', 'Name'=> 'COMMENT2', 'Value'=> options[:comment2]) unless options[:comment2].blank?
+ xml.tag! 'TaxAmt', options[:taxamt] unless options[:taxamt].blank?
+ xml.tag! 'FreightAmt', options[:freightamt] unless options[:freightamt].blank?
+ xml.tag! 'DutyAmt', options[:dutyamt] unless options[:dutyamt].blank?
+ xml.tag! 'DiscountAmt', options[:discountamt] unless options[:discountamt].blank?
billing_address = options[:billing_address] || options[:address]
add_address(xml, 'BillTo', billing_address, options) if billing_address
add_address(xml, 'ShipTo', options[:shipping_address],options) if options[:shipping_address]
@@ -120,10 +124,14 @@
xml.tag! 'InvNum', options[:order_id].to_s.gsub(/[^\w.]/, '') unless options[:order_id].blank?
xml.tag! 'Description', options[:description] unless options[:description].blank?
# Comment and Comment2 will show up in manager.paypal.com as Comment1 and Comment2
xml.tag! 'Comment', options[:comment] unless options[:comment].blank?
xml.tag!('ExtData', 'Name'=> 'COMMENT2', 'Value'=> options[:comment2]) unless options[:comment2].blank?
+ xml.tag! 'TaxAmt', options[:taxamt] unless options[:taxamt].blank?
+ xml.tag! 'FreightAmt', options[:freightamt] unless options[:freightamt].blank?
+ xml.tag! 'DutyAmt', options[:dutyamt] unless options[:dutyamt].blank?
+ xml.tag! 'DiscountAmt', options[:discountamt] unless options[:discountamt].blank?
billing_address = options[:billing_address] || options[:address]
add_address(xml, 'BillTo', billing_address, options) if billing_address
add_address(xml, 'ShipTo', options[:shipping_address], options) if options[:shipping_address]
@@ -159,11 +167,11 @@
CARD_MAPPING[card_brand(credit_card).to_sym]
end
def expdate(creditcard)
- year = sprintf("%.4i", creditcard.year)
- month = sprintf("%.2i", creditcard.month)
+ year = sprintf("%.4i", creditcard.year.to_s.sub(/^0+/, ''))
+ month = sprintf("%.2i", creditcard.month.to_s.sub(/^0+/, ''))
"#{year}#{month}"
end
def startdate(creditcard)