lib/active_merchant/billing/gateways/swipe_checkout.rb in activemerchant-1.79.2 vs lib/active_merchant/billing/gateways/swipe_checkout.rb in activemerchant-1.80.0

- old
+ new

@@ -67,11 +67,11 @@ def add_invoice(post, options) # store shopping-cart order ID in Swipe for merchant's records post[:td_user_data] = options[:order_id] if options[:order_id] post[:td_item] = options[:description] if options[:description] post[:td_description] = options[:description] if options[:description] - post[:item_quantity] = "1" + post[:item_quantity] = '1' end def add_creditcard(post, creditcard) post[:card_number] = creditcard.number post[:card_type] = creditcard.brand @@ -93,19 +93,19 @@ post[:currency] = (options[:currency] || currency(money)) end def commit(action, money, parameters) case action - when "sale" + when 'sale' begin response = call_api(TRANSACTION_API, parameters) # response code and message params should always be present - code = response["response_code"] - message = response["message"] + code = response['response_code'] + message = response['message'] if code == 200 - result = response["data"]["result"] + result = response['data']['result'] success = (result == 'accepted' || (test? && result == 'test-accepted')) Response.new(success, success ? TRANSACTION_APPROVED_MSG :