lib/active_merchant/billing/gateways/cyber_source.rb in activemerchant-1.86.0 vs lib/active_merchant/billing/gateways/cyber_source.rb in activemerchant-1.87.0
- old
+ new
@@ -25,11 +25,11 @@
self.live_url = 'https://ics2wsa.ic3.com/commerce/1.x/transactionProcessor'
XSD_VERSION = '1.121'
self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club, :jcb, :dankort, :maestro]
- self.supported_countries = %w(US BR CA CN DK FI FR DE JP MX NO SE GB SG LB)
+ self.supported_countries = %w(US BR CA CN DK FI FR DE IN JP MX NO SE GB SG LB)
self.default_currency = 'USD'
self.currencies_without_fractions = %w(JPY)
self.homepage_url = 'http://www.cybersource.com'
@@ -111,11 +111,11 @@
super
end
def authorize(money, creditcard_or_reference, options = {})
setup_address_hash(options)
- commit(build_auth_request(money, creditcard_or_reference, options), :authorize, money, options )
+ commit(build_auth_request(money, creditcard_or_reference, options), :authorize, money, options)
end
def capture(money, authorization, options = {})
setup_address_hash(options)
commit(build_capture_request(money, authorization, options), :capture, money, options)
@@ -207,11 +207,11 @@
end
# Determines if a card can be used for Pinless Debit Card transactions
def validate_pinless_debit_card(creditcard, options = {})
requires!(options, :order_id)
- commit(build_validate_pinless_debit_request(creditcard,options), :validate_pinless_debit_card, nil, options)
+ commit(build_validate_pinless_debit_request(creditcard, options), :validate_pinless_debit_card, nil, options)
end
def supports_scrubbing?
true
end
@@ -390,11 +390,11 @@
add_subscription(xml, options, reference)
add_subscription_retrieve_service(xml, options)
xml.target!
end
- def build_validate_pinless_debit_request(creditcard,options)
+ def build_validate_pinless_debit_request(creditcard, options)
xml = Builder::XmlMarkup.new :indent => 2
add_creditcard(xml, creditcard)
add_validate_pinless_debit_service(xml)
xml.target!
end
@@ -408,11 +408,11 @@
xml.tag!('ignoreCVResult', 'true') if extract_option(prioritized_options, :ignore_cvv)
end
end
end
- def extract_option prioritized_options, option_name
+ def extract_option(prioritized_options, option_name)
options_matching_key = prioritized_options.detect do |options|
options.has_key? option_name
end
options_matching_key[option_name] if options_matching_key
end
@@ -430,11 +430,11 @@
end
def add_merchant_data(xml, options)
xml.tag! 'merchantID', @options[:login]
xml.tag! 'merchantReferenceCode', options[:order_id] || generate_unique_id
- xml.tag! 'clientLibrary','Ruby Active Merchant'
+ xml.tag! 'clientLibrary', 'Ruby Active Merchant'
xml.tag! 'clientLibraryVersion', VERSION
xml.tag! 'clientEnvironment', RUBY_PLATFORM
end
def add_purchase_data(xml, money = 0, include_grand_total = false, options={})
@@ -467,11 +467,11 @@
def add_creditcard(xml, creditcard)
xml.tag! 'card' do
xml.tag! 'accountNumber', creditcard.number
xml.tag! 'expirationMonth', format(creditcard.month, :two_digits)
xml.tag! 'expirationYear', format(creditcard.year, :four_digits)
- xml.tag!('cvNumber', creditcard.verification_value) unless (@options[:ignore_cvv] || creditcard.verification_value.blank? )
+ xml.tag!('cvNumber', creditcard.verification_value) unless @options[:ignore_cvv] || creditcard.verification_value.blank?
xml.tag! 'cardType', @@credit_card_codes[card_brand(creditcard).to_sym]
end
end
def add_decision_manager_fields(xml, options)
@@ -753,10 +753,10 @@
return reply
end
def parse_element(reply, node)
if node.has_elements?
- node.elements.each{|e| parse_element(reply, e) }
+ node.elements.each { |e| parse_element(reply, e) }
else
if node.parent.name =~ /item/
parent = node.parent.name
parent += '_' + node.parent.attributes['id'] if node.parent.attributes['id']
parent += '_'