Sha256: d6efce01c7aaade5d4239b5c21f470cfb4a260f41558a9e0cb0bab34180a83e7

Contents?: true

Size: 1.18 KB

Versions: 1

Compression:

Stored size: 1.18 KB

Contents

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

  include AuthorizeNet::API
  #Function to get the token to load customer profile form
  def get_accept_customer_profile_page(api_login_id,api_transaction_key,iframeCommunicatorUrl,customerProfileId = '37696245')
    
    transaction = Transaction.new(api_login_id, api_transaction_key, :gateway => :sandbox)
    
    setting = SettingType.new
    setting.settingName = SettingNameEnum::HostedProfileReturnUrl
    setting.settingValue = "https://returnurl.com/return/"
    #Iframe URL to load the customer profile page
    setting1 = SettingType.new
    setting1.settingName = SettingNameEnum::HostedProfileIFrameCommunicatorUrl
    setting1.settingValue = iframeCommunicatorUrl
    
    settings = Settings.new([setting,setting1])

    request = GetHostedProfilePageRequest.new
    request.customerProfileId = customerProfileId
    request.refId = ""
    request.hostedProfileSettings = settings
    #response with token details to load the customer profile page from server(Error handling in web api)
    response = transaction.get_hosted_profile_page(request)
    return response
  end
  

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
authorizenetsample-1.1.6 lib/CustomerProfiles/get-accept-customer-profile-page.rb