Class: ActiveMerchant::Billing::Integrations::TwoCheckout::Helper

Inherits:
Helper
  • Object
show all
Defined in:
lib/active_merchant/billing/integrations/two_checkout/helper.rb

Instance Attribute Summary

Attributes inherited from Helper

#fields

Instance Method Summary collapse

Methods inherited from Helper

#add_field, #add_fields, #add_raw_html_field, #billing_address, #form_fields, mapping, #raw_html_fields, #shipping_address, #test?

Constructor Details

#initialize(order, account, options = {}) ⇒ Helper

Returns a new instance of Helper.



6
7
8
9
10
11
12
13
# File 'lib/active_merchant/billing/integrations/two_checkout/helper.rb', line 6

def initialize(order, , options = {})
  super
  add_field('fixed', 'Y')
  
  if ActiveMerchant::Billing::Base.integration_mode == :test || options[:test]
    add_field('demo', 'Y')
  end 
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ActiveMerchant::Billing::Integrations::Helper

Instance Method Details

#customer(params = {}) ⇒ Object

mapping :description, ” mapping :tax, ” mapping :shipping, ”



50
51
52
53
54
# File 'lib/active_merchant/billing/integrations/two_checkout/helper.rb', line 50

def customer(params = {})
  add_field(mappings[:customer][:email], params[:email])
  add_field(mappings[:customer][:phone], params[:phone])
  add_field('card_holder_name', "#{params[:first_name]} #{params[:last_name]}")
end