Parent

Class/Module Index [+]

Quicksearch

ActiveMerchant::Billing::Integrations::DirecPay::Helper

Public Class Methods

new(order, account, options = {}) click to toggle source
# File lib/active_merchant/billing/integrations/direc_pay/helper.rb, line 55
def initialize(order, account, options = {})
  super
  collaborator = ActiveMerchant::Billing::Base.integration_mode == :test || options[:test] ? 'TOML' : 'DirecPay'
  add_field(mappings[:collaborator], collaborator)
  add_field(mappings[:country], 'IND')
  add_field(mappings[:operating_mode], OPERATING_MODE)
  add_field(mappings[:other_details], OTHER_DETAILS)
  add_field(mappings[:edit_allowed], EDIT_ALLOWED)
end

Public Instance Methods

amount=(money) click to toggle source

Need to format the amount to have 2 decimal places

# File lib/active_merchant/billing/integrations/direc_pay/helper.rb, line 72
def amount=(money)
  cents = money.respond_to?(:cents) ? money.cents : money
  if money.is_a?(String) or cents.to_i <= 0
    raise ArgumentError, 'money amount must be either a Money object or a positive integer in cents.'
  end
  add_field(mappings[:amount], sprintf("%.2f", cents.to_f/100))
end
billing_address(params = {}) click to toggle source
# File lib/active_merchant/billing/integrations/direc_pay/helper.rb, line 84
def billing_address(params = {})
  super(update_address(:billing_address, params))
end
customer(params = {}) click to toggle source
# File lib/active_merchant/billing/integrations/direc_pay/helper.rb, line 66
def customer(params = {})
  add_field(mappings[:customer][:name], full_name(params))
  add_field(mappings[:customer][:email], params[:email])
end
form_fields() click to toggle source
# File lib/active_merchant/billing/integrations/direc_pay/helper.rb, line 88
def form_fields
  add_failure_url
  add_request_parameters
  
  unencoded_parameters
end
shipping_address(params = {}) click to toggle source
# File lib/active_merchant/billing/integrations/direc_pay/helper.rb, line 80
def shipping_address(params = {})
  super(update_address(:shipping_address, params))
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.