Class: OffsitePayments::Integrations::Doku::Helper

Inherits:
Helper
  • Object
show all
Defined in:
lib/offsite_payments/integrations/doku.rb

Overview

service.shipping_address :city => ‘Jakarta’,

                         :address  => 'Jl. Jendral Sudirman kav 59, Plaza Asia Office Park Unit 3',
                         :state    => 'DKI Jakarta',
                         :zip      => '12190',
                         :country  => 'ID'

service.url 'http://yourstore.com'

end

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_method, inherited, mapping, #raw_html_fields, #shipping_address, #test?

Constructor Details

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

Returns a new instance of Helper.



44
45
46
47
48
# File 'lib/offsite_payments/integrations/doku.rb', line 44

def initialize(order, , options = {})
  @shared_key      = options.delete(:credential2)
  @transidmerchant = order
  super
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class OffsitePayments::Helper

Instance Method Details

#customer(params = {}) ⇒ Object



57
58
59
60
61
62
63
64
# File 'lib/offsite_payments/integrations/doku.rb', line 57

def customer(params = {})
  add_field mappings[:customer][:name], "#{params[:first_name]} #{params[:last_name]}"
  add_field mappings[:customer][:email], params[:email]
  add_field mappings[:customer][:phone], params[:phone]
  add_field mappings[:customer][:mobile_phone], params[:mobile_phone]
  add_field mappings[:customer][:working_phone], params[:working_phone]
  add_field mappings[:customer][:birth_date], params[:birth_date]
end

#form_fieldsObject



50
51
52
53
54
55
# File 'lib/offsite_payments/integrations/doku.rb', line 50

def form_fields
  add_field 'WORDS', words
  add_field 'BASKET', basket
  add_field 'TRANSIDMERCHANT', @transidmerchant
  @fields
end