lib/active_merchant/billing/gateways/sage_pay.rb in activemerchant-1.83.0 vs lib/active_merchant/billing/gateways/sage_pay.rb in activemerchant-1.84.0
- old
+ new
@@ -26,12 +26,10 @@
CREDIT_CARDS = {
:visa => 'VISA',
:master => 'MC',
:delta => 'DELTA',
- :solo => 'SOLO',
- :switch => 'MAESTRO',
:maestro => 'MAESTRO',
:american_express => 'AMEX',
:electron => 'UKE',
:diners_club => 'DC',
:jcb => 'JCB'
@@ -69,11 +67,11 @@
recipient_surname: :FIRecipientSurname ,
recipient_postcode: :FIRecipientPostcode ,
recipient_dob: :FIRecipientDoB
}
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :jcb, :switch, :solo, :maestro, :diners_club]
+ self.supported_cardtypes = [:visa, :master, :american_express, :discover, :jcb, :maestro, :diners_club]
self.supported_countries = ['GB', 'IE']
self.default_currency = 'GBP'
self.homepage_url = 'http://www.sagepay.com'
self.display_name = 'SagePay'
@@ -181,10 +179,11 @@
gsub(%r((&?CardNumber=)\d+(&?)), '\1[FILTERED]\2').
gsub(%r((&?CV2=)\d+(&?)), '\1[FILTERED]\2')
end
private
+
def truncate(value, max_size)
return nil unless value
return value.to_s if CGI.escape(value.to_s).length <= max_size
if value.size > max_size
@@ -289,15 +288,10 @@
def add_credit_card(post, credit_card)
add_pair(post, :CardHolder, truncate(credit_card.name, 50), :required => true)
add_pair(post, :CardNumber, credit_card.number, :required => true)
add_pair(post, :ExpiryDate, format_date(credit_card.month, credit_card.year), :required => true)
-
- if requires_start_date_or_issue_number?(credit_card)
- add_pair(post, :StartDate, format_date(credit_card.start_month, credit_card.start_year))
- add_pair(post, :IssueNumber, credit_card.issue_number)
- end
add_pair(post, :CardType, map_card_type(credit_card))
add_pair(post, :CV2, credit_card.verification_value)
end
@@ -434,8 +428,7 @@
def past_purchase_reference?(payment_method)
return false unless payment_method.is_a?(String)
payment_method.split(';').last == 'purchase'
end
end
-
end
end