Included Modules

Class Index [+]

Quicksearch

ActiveMerchant::Billing::Integrations::PayflowLink::Helper

Public Class Methods

new(order, account, options = {}) click to toggle source
    # File lib/active_merchant/billing/integrations/payflow_link/helper.rb, line 8
 8:           def initialize(order, account, options = {})
 9:             super
10:             add_field('login', account)
11:             add_field('echodata', 'True')
12:             add_field('user2', self.test?)
13:             add_field('invoice', order)
14:             add_field('vendor', account)
15:             add_field('user', options[:credential4] || account)
16:             add_field('trxtype', 'S')
17:           end

Public Instance Methods

billing_address(params = {}) click to toggle source
    # File lib/active_merchant/billing/integrations/payflow_link/helper.rb, line 42
42:           def billing_address(params = {})
43:             # Get the country code in the correct format
44:             # Use what we were given if we can't find anything
45:             country_code = lookup_country_code(params.delete(:country))
46:             add_field(mappings[:billing_address][:country], country_code)
47: 
48:             add_field(mappings[:billing_address][:address], [params.delete(:address1), params.delete(:address2)].compact.join(' '))
49: 
50:             province_code = params.delete(:state)
51:             add_field(mappings[:billing_address][:state], province_code.blank? ? 'N/A' : province_code.upcase)
52: 
53:             # Everything else
54:             params.each do |k, v|
55:               field = mappings[:billing_address][k]
56:               add_field(field, v) unless field.nil?
57:             end
58:           end
customer(params = {}) click to toggle source
    # File lib/active_merchant/billing/integrations/payflow_link/helper.rb, line 38
38:           def customer(params = {})
39:             add_field(mappings[:customer][:name], [params.delete(:first_name), params.delete(:last_name)].compact.join(' '))
40:           end
form_fields() click to toggle source
    # File lib/active_merchant/billing/integrations/payflow_link/helper.rb, line 60
60:           def form_fields
61:             token, token_id = request_secure_token
62: 
63:             {"securetoken" => token, "securetokenid" => token_id, "mode" => test? ? "test" : "live"}
64:           end

Private Instance Methods

parse_response(response) click to toggle source
    # File lib/active_merchant/billing/integrations/payflow_link/helper.rb, line 87
87:           def parse_response(response)
88:             response = response.split("&").inject({}) do |hash, param|
89:               key, value = param.split("=")
90:               hash[key] = value
91:               hash
92:             end
93: 
94:             [response['SECURETOKEN'], response['SECURETOKENID']] if response['RESPMSG'] && response['RESPMSG'].downcase == "approved"
95:           end
request_secure_token() click to toggle source
    # File lib/active_merchant/billing/integrations/payflow_link/helper.rb, line 76
76:           def request_secure_token
77:             @fields["securetokenid"] = secure_token_id
78:             @fields["createsecuretoken"] = "Y"
79: 
80:             fields = @fields.collect {|key, value| "#{key}[#{value.length}]=#{value}" }.join("&")
81: 
82:             response = ssl_post(secure_token_url, fields)
83: 
84:             parse_response(response)
85:           end
secure_token_id() click to toggle source
    # File lib/active_merchant/billing/integrations/payflow_link/helper.rb, line 68
68:           def secure_token_id
69:             @secure_token_id ||= Utils.generate_unique_id
70:           end
secure_token_url() click to toggle source
    # File lib/active_merchant/billing/integrations/payflow_link/helper.rb, line 72
72:           def secure_token_url
73:             test? ? "https://pilot-payflowpro.paypal.com" : "https://payflowpro.paypal.com"
74:           end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.