lib/active_merchant/billing/gateways/payflow.rb in activemerchant-1.54.0 vs lib/active_merchant/billing/gateways/payflow.rb in activemerchant-1.55.0
- old
+ new
@@ -63,11 +63,11 @@
def recurring(money, credit_card, options = {})
ActiveMerchant.deprecated RECURRING_DEPRECATION_MESSAGE
options[:name] = credit_card.name if options[:name].blank? && credit_card
request = build_recurring_request(options[:profile_id] ? :modify : :add, money, options) do |xml|
- add_credit_card(xml, credit_card) if credit_card
+ add_credit_card(xml, credit_card, options) if credit_card
end
commit(request, options.merge(:request_type => :recurring))
end
def cancel_recurring(profile_id)
@@ -153,11 +153,11 @@
xml.tag! 'TotalAmt', amount(money), 'Currency' => options[:currency] || currency(money)
end
xml.tag! 'Tender' do
- add_credit_card(xml, credit_card)
+ add_credit_card(xml, credit_card, options)
end
end
end
xml.target!
end
@@ -185,16 +185,29 @@
end
end
xml.target!
end
- def add_credit_card(xml, credit_card)
+ def add_credit_card(xml, credit_card, options = {})
xml.tag! 'Card' do
xml.tag! 'CardType', credit_card_type(credit_card)
xml.tag! 'CardNum', credit_card.number
xml.tag! 'ExpDate', expdate(credit_card)
xml.tag! 'NameOnCard', credit_card.first_name
xml.tag! 'CVNum', credit_card.verification_value if credit_card.verification_value?
+
+ if options[:three_d_secure]
+ three_d_secure = options[:three_d_secure]
+ xml.tag! 'BuyerAuthResult' do
+ xml.tag! 'Status', three_d_secure[:status] unless three_d_secure[:status].blank?
+ xml.tag! 'AuthenticationId', three_d_secure[:authentication_id] unless three_d_secure[:authentication_id].blank?
+ xml.tag! 'PAReq', three_d_secure[:pareq] unless three_d_secure[:pareq].blank?
+ xml.tag! 'ACSUrl', three_d_secure[:acs_url] unless three_d_secure[:acs_url].blank?
+ xml.tag! 'ECI', three_d_secure[:eci] unless three_d_secure[:eci].blank?
+ xml.tag! 'CAVV', three_d_secure[:cavv] unless three_d_secure[:cavv].blank?
+ xml.tag! 'XID', three_d_secure[:xid] unless three_d_secure[:xid].blank?
+ end
+ end
if requires_start_date_or_issue_number?(credit_card)
xml.tag!('ExtData', 'Name' => 'CardStart', 'Value' => startdate(credit_card)) unless credit_card.start_month.blank? || credit_card.start_year.blank?
xml.tag!('ExtData', 'Name' => 'CardIssue', 'Value' => format(credit_card.issue_number, :two_digits)) unless credit_card.issue_number.blank?
end