lib/active_merchant/billing/gateways/payflow_express.rb in activemerchant-1.21.0 vs lib/active_merchant/billing/gateways/payflow_express.rb in activemerchant-1.22.0
- old
+ new
@@ -31,10 +31,11 @@
# [<tt>:return_url</tt>] (req) URL to which the buyer’s browser is returned after choosing to pay.
# [<tt>:cancel_return_url</tt>] (req) URL to which the buyer is returned if the buyer cancels the order.
# [<tt>:notify_url</tt>] (opt) Your URL for receiving Instant Payment Notification (IPN) about this transaction.
# [<tt>:comment</tt>] (opt) Comment field which will be reported to Payflow backend (at manager.paypal.com) as Comment1
# [<tt>:comment2</tt>] (opt) Comment field which will be reported to Payflow backend (at manager.paypal.com) as Comment2
+ # [<tt>:discount</tt>] (opt) Total discounts in cents
#
# ==Line Items
# Support for order line items is available, but has to be enabled on the PayFlow backend. This is what I was told by Todd Sieber at Technical Support:
#
# <em>You will need to call Payflow Support at 1-888-883-9770, choose option #2. Request that they update your account in "Pandora" under Product Settings >> PayPal Mark and update the Features Bitmap to 1111111111111112. This is 15 ones and a two.</em>
@@ -175,13 +176,14 @@
# Note: An ItemURL is supported in Paypal Express (different API), but not PayFlow Express, as far as I can tell.
# L_URLn nor L_ITEMURLn seem to work
end
if items.any?
xml.tag! 'ExtData', 'Name' => 'CURRENCY', 'Value' => options[:currency] || currency(money)
- xml.tag! 'ExtData', 'Name' => "ITEMAMT", 'Value' => amount(money)
+ xml.tag! 'ExtData', 'Name' => "ITEMAMT", 'Value' => amount(options[:subtotal] || money)
end
-
+ xml.tag! 'DiscountAmt', amount(options[:discount]) if options[:discount]
xml.tag! 'TotalAmt', amount(money), 'Currency' => options[:currency] || currency(money)
+
end
xml.tag! 'Tender' do
add_paypal_details(xml, options)
end