lib/active_merchant/billing/gateways/payflow.rb in tlconnor-activemerchant-1.20.4 vs lib/active_merchant/billing/gateways/payflow.rb in tlconnor-activemerchant-1.23.0

- old
+ new

@@ -196,20 +196,25 @@ xml.tag! 'Name', options[:name] unless options[:name].nil? xml.tag! 'TotalAmt', amount(money), 'Currency' => options[:currency] || currency(money) xml.tag! 'PayPeriod', get_pay_period(options) xml.tag! 'Term', options[:payments] unless options[:payments].nil? xml.tag! 'Comment', options[:comment] unless options[:comment].nil? + xml.tag! 'RetryNumDays', options[:retry_num_days] unless options[:retry_num_days].nil? - if initial_tx = options[:initial_transaction] requires!(initial_tx, [:type, :authorization, :purchase]) requires!(initial_tx, :amount) if initial_tx[:type] == :purchase xml.tag! 'OptionalTrans', TRANSACTIONS[initial_tx[:type]] xml.tag! 'OptionalTransAmt', amount(initial_tx[:amount]) unless initial_tx[:amount].blank? end - - xml.tag! 'Start', format_rp_date(options[:starting_at] || Date.today + 1 ) + + if action == :add + xml.tag! 'Start', format_rp_date(options[:starting_at] || Date.today + 1 ) + else + xml.tag! 'Start', format_rp_date(options[:starting_at]) unless options[:starting_at].nil? + end + xml.tag! 'EMail', options[:email] unless options[:email].nil? 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]