Sha256: af01910e4a9e052e98c951ace778e60405bc0f9fd1f176bf1619b67a2895e4f0
Contents?: true
Size: 1021 Bytes
Versions: 36
Compression:
Stored size: 1021 Bytes
Contents
require 'rubygems' require 'yaml' require 'authorizenet' require 'securerandom' include AuthorizeNet::API def create_customer_shipping_address(customerProfileId = '1813343337') config = YAML.load_file(File.dirname(__FILE__) + "/../credentials.yml") transaction = Transaction.new(config['api_login_id'], config['api_transaction_key'], :gateway => :sandbox) request = CreateCustomerShippingAddressRequest.new request.address = CustomerAddressType.new('John','Doe') request.customerProfileId = customerProfileId response = transaction.create_customer_shipping_profile(request) if response.messages.resultCode == MessageTypeEnum::Ok puts "Successfully created a customer shipping address with id: #{response.customerAddressId}." else puts "Failed to create a new customer shipping address: #{response.messages.messages[0].text}" end return response end if __FILE__ == $0 create_customer_shipping_address() end
Version data entries
36 entries across 36 versions & 1 rubygems