lib/active_merchant/billing/gateways/paybox_direct.rb in activemerchant-1.86.0 vs lib/active_merchant/billing/gateways/paybox_direct.rb in activemerchant-1.87.0
- old
+ new
@@ -84,12 +84,12 @@
def capture(money, authorization, options = {})
requires!(options, :order_id)
post = {}
add_invoice(post, options)
add_amount(post, money, options)
- post[:numappel] = authorization[0,10]
- post[:numtrans] = authorization[10,10]
+ post[:numappel] = authorization[0, 10]
+ post[:numtrans] = authorization[10, 10]
commit('capture', money, post)
end
def void(identification, options = {})
@@ -128,38 +128,38 @@
post[:dateval] = expdate(creditcard)
post[:cvv] = creditcard.verification_value if creditcard.verification_value?
end
def add_reference(post, identification)
- post[:numappel] = identification[0,10]
- post[:numtrans] = identification[10,10]
+ post[:numappel] = identification[0, 10]
+ post[:numtrans] = identification[10, 10]
end
def add_amount(post, money, options)
post[:montant] = ('0000000000' + (money ? amount(money) : ''))[-10..-1]
post[:devise] = CURRENCY_CODES[options[:currency] || currency(money)]
end
def parse(body)
results = {}
body.split(/&/).each do |pair|
- key,val = pair.split(/\=/)
+ key, val = pair.split(/\=/)
results[key.downcase.to_sym] = CGI.unescape(val) if val
end
results
end
def commit(action, money = nil, parameters = nil)
- request_data = post_data(action,parameters)
+ request_data = post_data(action, parameters)
response = parse(ssl_post(test? ? self.test_url : self.live_url, request_data))
response = parse(ssl_post(self.live_url_backup, request_data)) if service_unavailable?(response) && !test?
Response.new(success?(response), message_from(response), response.merge(
:timestamp => parameters[:dateq]),
:test => test?,
:authorization => response[:numappel].to_s + response[:numtrans].to_s,
:fraud_review => false,
- :sent_params => parameters.delete_if{|key,value| ['porteur','dateval','cvv'].include?(key.to_s)}
+ :sent_params => parameters.delete_if { |key, value| ['porteur', 'dateval', 'cvv'].include?(key.to_s) }
)
end
def success?(response)
SUCCESS_CODES.include?(response[:codereponse])
@@ -177,10 +177,10 @@
parameters.update(
:version => API_VERSION,
:type => TRANSACTIONS[action.to_sym],
:dateq => Time.now.strftime('%d%m%Y%H%M%S'),
:numquestion => unique_id(parameters[:order_id]),
- :site => @options[:login].to_s[0,7],
+ :site => @options[:login].to_s[0, 7],
:rang => @options[:rang] || @options[:login].to_s[7..-1],
:cle => @options[:password],
:pays => '',
:archivage => parameters[:order_id]
)