Module: ActiveMerchant::Billing::Integrations::TwoCheckout

Defined in:
lib/active_merchant/billing/integrations/two_checkout.rb,
lib/active_merchant/billing/integrations/two_checkout/helper.rb,
lib/active_merchant/billing/integrations/two_checkout/return.rb,
lib/active_merchant/billing/integrations/two_checkout/notification.rb

Defined Under Namespace

Classes: Helper, Notification, Return

Class Method Summary collapse

Class Method Details

.notification(post, options = {}) ⇒ Object



34
35
36
# File 'lib/active_merchant/billing/integrations/two_checkout.rb', line 34

def self.notification(post, options = {})
  Notification.new(post)
end

.return(query_string, options = {}) ⇒ Object



38
39
40
# File 'lib/active_merchant/billing/integrations/two_checkout.rb', line 38

def self.return(query_string, options = {})
  Return.new(query_string)
end

.service_urlObject



12
13
14
15
16
17
18
19
20
21
# File 'lib/active_merchant/billing/integrations/two_checkout.rb', line 12

def self.service_url
  case self.payment_routine
  when :multi_page
    'https://www.2checkout.com/checkout/purchase'  
  when :single_page
    'https://www.2checkout.com/checkout/spurchase'
  else
    raise StandardError, "Integration payment routine set to an invalid value: #{self.payment_routine}"
  end
end

.service_url=(service_url) ⇒ Object



23
24
25
26
27
28
29
30
31
# File 'lib/active_merchant/billing/integrations/two_checkout.rb', line 23

def self.service_url=(service_url)
  # Note: do not use this method, it is here for backward compatibility
  # Use the payment_routine method to change service_url
  if service_url =~ /spurchase/
    self.payment_routine = :single_page
  else
    self.payment_routine = :multi_page
  end
end