lib/active_merchant/billing/gateways/paypal_express.rb in activemerchant-1.7.3 vs lib/active_merchant/billing/gateways/paypal_express.rb in activemerchant-1.8.0
- old
+ new
@@ -100,13 +100,21 @@
add_address(xml, 'n2:Address', options[:shipping_address] || options[:address])
xml.tag! 'n2:AddressOverride', options[:address_override] ? '1' : '0'
xml.tag! 'n2:NoShipping', options[:no_shipping] ? '1' : '0'
xml.tag! 'n2:ReturnURL', options[:return_url]
xml.tag! 'n2:CancelURL', options[:cancel_return_url]
- xml.tag! 'n2:IPAddress', options[:ip]
+ xml.tag! 'n2:IPAddress', options[:ip] unless options[:ip].blank?
xml.tag! 'n2:OrderDescription', options[:description]
xml.tag! 'n2:BuyerEmail', options[:email] unless options[:email].blank?
xml.tag! 'n2:InvoiceID', options[:order_id]
+
+ if options[:billing_agreement]
+ xml.tag! 'n2:BillingAgreementDetails' do
+ xml.tag! 'n2:BillingType', options[:billing_agreement][:type]
+ xml.tag! 'n2:BillingAgreementDescription', options[:billing_agreement][:description]
+ xml.tag! 'n2:PaymentType', options[:billing_agreement][:payment_type] || 'InstantOnly'
+ end
+ end
# Customization of the payment page
xml.tag! 'n2:PageStyle', options[:page_style] unless options[:page_style].blank?
xml.tag! 'n2:cpp-image-header', options[:header_image] unless options[:header_image].blank?
xml.tag! 'n2:cpp-header-back-color', options[:header_background_color] unless options[:header_background_color].blank?