Sha256: 9f2f48c6a2087ced30bbac2eac66c5cd45ed466d95ad96b0c8832801c4ae24f4
Contents?: true
Size: 1.12 KB
Versions: 36
Compression:
Stored size: 1.12 KB
Contents
require 'rubygems' require 'yaml' require 'authorizenet' require 'securerandom' include AuthorizeNet::API def get_subscription_status(subscriptionId = '4792732') config = YAML.load_file(File.dirname(__FILE__) + "/../credentials.yml") transaction = Transaction.new(config['api_login_id'], config['api_transaction_key'], :gateway => :sandbox) #subscription = Subscription.new(config['api_login_id'], config['api_subscription_key'], :gateway => :sandbox) request = ARBGetSubscriptionStatusRequest.new request.refId = '2238251168' request.subscriptionId = subscriptionId response = transaction.get_subscription_status(request) if response != nil if response.messages.resultCode == MessageTypeEnum::Ok puts "Successfully got subscription status." puts " Status: #{response.status}" else puts response.messages.messages[0].code puts response.messages.messages[0].text raise "Failed to get a subscriptions status" end end return response end if __FILE__ == $0 get_subscription_status() end
Version data entries
36 entries across 36 versions & 1 rubygems