Sha256: bae23fb8d4b52e685ec3af6c47a81d8bd109669f396ba61bc130d8f7262222d7

Contents?: true

Size: 950 Bytes

Versions: 36

Compression:

Stored size: 950 Bytes

Contents

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

  include AuthorizeNet::API

  def delete_customer_profile(customerProfileId = '36551110')
    config = YAML.load_file(File.dirname(__FILE__) + "/../credentials.yml")

    transaction = Transaction.new(config['api_login_id'], config['api_transaction_key'], :gateway => :sandbox)

    
    request = DeleteCustomerProfileRequest.new
    request.customerProfileId = customerProfileId

    response = transaction.delete_customer_profile(request)


    if response.messages.resultCode == MessageTypeEnum::Ok
      puts "Successfully deleted customer with customer profile ID #{request.customerProfileId}."
    else
      puts response.messages.messages[0].text
      raise "Failed to delete customer with customer profile ID #{request.customerProfileId}."
    end
    return response
  end

if __FILE__ == $0
  delete_customer_profile()
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
authorizenetsample-1.2.5 lib/CustomerProfiles/delete-customer-profile.rb
authorizenetsample-1.2.4 lib/CustomerProfiles/delete-customer-profile.rb
authorizenetsample-1.2.3 lib/CustomerProfiles/delete-customer-profile.rb
authorizenetsample-1.2.2 lib/CustomerProfiles/delete-customer-profile.rb
authorizenetsample-1.2.1 lib/CustomerProfiles/delete-customer-profile.rb
authorizenetsample-1.2.0 lib/CustomerProfiles/delete-customer-profile.rb
authorizenetsample-1.1.9 lib/CustomerProfiles/delete-customer-profile.rb
authorizenetsample-1.1.8 lib/CustomerProfiles/delete-customer-profile.rb
authorizenetsample-1.1.7 lib/CustomerProfiles/delete-customer-profile.rb
authorizenetsample-1.1.5 lib/CustomerProfiles/delete-customer-profile.rb
authorizenetsample-1.1.4 lib/CustomerProfiles/delete-customer-profile.rb
authorizenetsample-1.1.3 lib/CustomerProfiles/delete-customer-profile.rb
authorizenetsample-1.1.2 lib/CustomerProfiles/delete-customer-profile.rb
authorizenetsample-1.1.1 lib/CustomerProfiles/delete-customer-profile.rb
authorizenetsample-1.1.0 lib/CustomerProfiles/delete-customer-profile.rb
authorizenetsample-1.0.9 lib/CustomerProfiles/delete-customer-profile.rb
authorizenetsample-1.0.8 lib/CustomerProfiles/delete-customer-profile.rb
authorizenetsample-1.0.7 lib/CustomerProfiles/delete-customer-profile.rb
authorizenetsample-1.0.6 lib/CustomerProfiles/delete-customer-profile.rb
authorizenetsample-1.0.5 lib/CustomerProfiles/delete-customer-profile.rb