lib/active_merchant/billing/gateways/sage_pay.rb in activemerchant-1.29.3 vs lib/active_merchant/billing/gateways/sage_pay.rb in activemerchant-1.30.0

- old
+ new

@@ -63,10 +63,11 @@ add_amount(post, money, options) add_invoice(post, options) add_credit_card(post, credit_card) add_address(post, options) add_customer_data(post, options) + add_optional_data(post, options) commit(:purchase, post) end def authorize(money, credit_card, options = {}) @@ -77,10 +78,11 @@ add_amount(post, money, options) add_invoice(post, options) add_credit_card(post, credit_card) add_address(post, options) add_customer_data(post, options) + add_optional_data(post, options) commit(:authorization, post) end # You can only capture a transaction once, even if you didn't capture the full amount the first time. @@ -152,9 +154,13 @@ def add_customer_data(post, options) add_pair(post, :CustomerEMail, options[:email][0,255]) unless options[:email].blank? add_pair(post, :BillingPhone, options[:phone].gsub(/[^0-9+]/, '')[0,20]) unless options[:phone].blank? add_pair(post, :ClientIPAddress, options[:ip]) + end + + def add_optional_data(post, options) + add_pair(post, :GiftAidPayment, options[:gift_aid_payment]) unless options[:gift_aid_payment].blank? end def add_address(post, options) if billing_address = options[:billing_address] || options[:address] first_name, last_name = parse_first_and_last_name(billing_address[:name])