ActiveMerchant::Billing::Integrations::Helper
# 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
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
# File lib/active_merchant/billing/integrations/direc_pay/helper.rb, line 84 def billing_address(params = {}) super(update_address(:billing_address, params)) end
# 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
Generated with the Darkfish Rdoc Generator 2.