lib/active_merchant/billing/gateways/maxipago.rb in activemerchant-1.43.3 vs lib/active_merchant/billing/gateways/maxipago.rb in activemerchant-1.44.0
- old
+ new
@@ -75,10 +75,11 @@
end
def add_aux_data(post, options)
post[:processorID] = (test? ? 1 : 4) # test: 1, redecard: 2, cielo: 4
post[:referenceNum] = options[:order_id]
+ post[:installments] = options[:installments] if options.has_key?(:installments) && options[:installments] > 1 # only send installments if it is a deferred payment
end
def add_amount(post, money)
post[:amount] = amount(money)
end
@@ -134,9 +135,15 @@
}
}
}
xml.payment {
xml.chargeTotal params[:amount]
+ if params[:installments].present?
+ xml.creditInstallment {
+ xml.numberOfInstallments params[:installments]
+ xml.chargeInterest 'N'
+ }
+ end
}
xml.billing {
xml.name params[:billing_name]
xml.address params[:billing_address] if params[:billing_address].present?
xml.address2 params[:billing_address2] if params[:billing_address2].present?