Sha256: d13ccbfcdf2e7bfc0326a0d55c30d4ac85635f12df8de4718d90c50e40574c96

Contents?: true

Size: 1.51 KB

Versions: 36

Compression:

Stored size: 1.51 KB

Contents

require 'rubygems'
require 'yaml'
require 'authorizenet' 
require 'securerandom'

  include AuthorizeNet::API

  def get_merchant_details()
    config = YAML.load_file(File.dirname(__FILE__) + "/../credentials.yml")
    
      transaction = AuthorizeNet::API::Transaction.new(config['api_login_id'], config['api_transaction_key'], :gateway => :sandbox)
      
      request = GetMerchantDetailsRequest.new
      
      #standard api call to retrieve response
      response = transaction.get_merchant_details(request)
      
      if response.messages.resultCode == MessageTypeEnum::Ok
        puts "Get Merchant Details Successful " 
        puts "Gateway Id:   #{response.gatewayId}"
        puts "Merchant Name:   #{response.merchantName}"
        response.processors.processor.each do |processor|
          puts "Processor Name: #{processor.name}"
        end
        response.marketTypes.each do |marketType|
          puts "MarketType: #{marketType}"
        end
        response.productCodes.each do |productCode|
          puts "Product Code: #{productCode}"
        end
        response.paymentMethods.each do |paymentMethod|
          puts "Payment Method: #{paymentMethod}"
        end
        response.currencies.each do |currency|
          puts "Currency: #{currency}"
        end

      else
        puts response.messages.messages[0].code
        puts response.messages.messages[0].text
        raise "Failed to get transaction Details."
      end
    
    return response
  end
  
  
if __FILE__ == $0
  get_merchant_details()
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
authorizenetsample-1.2.5 lib/TransactionReporting/get-merchant-details.rb
authorizenetsample-1.2.4 lib/TransactionReporting/get-merchant-details.rb
authorizenetsample-1.2.3 lib/TransactionReporting/get-merchant-details.rb
authorizenetsample-1.2.2 lib/TransactionReporting/get-merchant-details.rb
authorizenetsample-1.2.1 lib/TransactionReporting/get-merchant-details.rb
authorizenetsample-1.2.0 lib/TransactionReporting/get-merchant-details.rb
authorizenetsample-1.1.9 lib/TransactionReporting/get-merchant-details.rb
authorizenetsample-1.1.8 lib/TransactionReporting/get-merchant-details.rb
authorizenetsample-1.1.7 lib/TransactionReporting/get-merchant-details.rb
authorizenetsample-1.1.5 lib/TransactionReporting/get-merchant-details.rb
authorizenetsample-1.1.4 lib/TransactionReporting/get-merchant-details.rb
authorizenetsample-1.1.3 lib/TransactionReporting/get-merchant-details.rb
authorizenetsample-1.1.2 lib/TransactionReporting/get-merchant-details.rb
authorizenetsample-1.1.1 lib/TransactionReporting/get-merchant-details.rb
authorizenetsample-1.1.0 lib/TransactionReporting/get-merchant-details.rb
authorizenetsample-1.0.9 lib/TransactionReporting/get-merchant-details.rb
authorizenetsample-1.0.8 lib/TransactionReporting/get-merchant-details.rb
authorizenetsample-1.0.7 lib/TransactionReporting/get-merchant-details.rb
authorizenetsample-1.0.6 lib/TransactionReporting/get-merchant-details.rb
authorizenetsample-1.0.5 lib/TransactionReporting/get-merchant-details.rb