Class: MerbMerchant::Billing::Integrations::TwoCheckout::Helper

Inherits:
Helper
  • Object
show all
Defined in:
lib/merb_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, #billing_address, #form_fields, mapping, #shipping_address

Constructor Details

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

Returns a new instance of Helper.



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

def initialize(order, , options = {})
  super
  add_field('fixed', 'Y')
  
  if MerbMerchant::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 MerbMerchant::Billing::Integrations::Helper

Instance Method Details

#customer(params = {}) ⇒ Object

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



50
51
52
53
54
# File 'lib/merb_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