lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb in activemerchant-1.79.2 vs lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb in activemerchant-1.80.0
- old
+ new
@@ -158,14 +158,14 @@
:authorization => authorization_from(response)
)
end
def authorization_from(response)
- if response["token"]
- response["token"].to_s
+ if response['token']
+ response['token'].to_s
else
- response["id"].to_s
+ response['id'].to_s
end
end
def add_currency(post, money, options)
post[:currency] = options[:currency] || currency(money)
@@ -229,17 +229,17 @@
!(has_error || invalid_code)
end
def message_from(success, response)
- success ? 'OK' : (response['message'] || invalid_operation_message(response) || "Unknown error - please contact QuickPay")
+ success ? 'OK' : (response['message'] || invalid_operation_message(response) || 'Unknown error - please contact QuickPay')
end
def invalid_operation_code?(response)
if response['operations']
operation = response['operations'].last
- operation && operation['qp_status_code'] != "20000"
+ operation && operation['qp_status_code'] != '20000'
end
end
def invalid_operation_message(response)
response['operations'] && response['operations'].last['qp_status_msg']
@@ -265,15 +265,15 @@
end
def headers
auth = Base64.strict_encode64(":#{@options[:api_key]}")
{
- "Authorization" => "Basic " + auth,
- "User-Agent" => "Quickpay-v#{API_VERSION} ActiveMerchantBindings/#{ActiveMerchant::VERSION}",
- "Accept" => "application/json",
- "Accept-Version" => "v#{API_VERSION}",
- "Content-Type" => "application/json"
+ 'Authorization' => 'Basic ' + auth,
+ 'User-Agent' => "Quickpay-v#{API_VERSION} ActiveMerchantBindings/#{ActiveMerchant::VERSION}",
+ 'Accept' => 'application/json',
+ 'Accept-Version' => "v#{API_VERSION}",
+ 'Content-Type' => 'application/json'
}
end
def response_error(raw_response)
begin
@@ -284,10 +284,10 @@
end
def json_error(raw_response)
msg = 'Invalid response received from the Quickpay API.'
msg += " (The raw response returned by the API was #{raw_response.inspect})"
- { "message" => msg }
+ { 'message' => msg }
end
def synchronized_path(path)
"#{path}?synchronized"
end