Module: OffsitePayments::Integrations::Pay2go

Defined in:
lib/offsite_payments/integrations/pay2go.rb

Defined Under Namespace

Classes: Helper, Notification

Constant Summary collapse

VERSION =
'1.2'
RESPOND_TYPE =
'String'
CHECK_VALUE_FIELDS =
%w(Amt MerchantID MerchantOrderNo TimeStamp Version)
CHECK_CODE_FIELDS =
%w(Amt MerchantID MerchantOrderNo TradeNo)
CONFIG =
%w(
  MerchantID LangType TradeLimit ExpireDate NotifyURL EmailModify LoginType
)

Class Method Summary collapse

Class Method Details

.notification(post) ⇒ Object



40
41
42
# File 'lib/offsite_payments/integrations/pay2go.rb', line 40

def self.notification(post)
  Notification.new(post)
end

.service_urlObject



26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/offsite_payments/integrations/pay2go.rb', line 26

def self.service_url
  mode = ActiveMerchant::Billing::Base.mode
  case mode
    when :production
      'https://api.pay2go.com/MPG/mpg_gateway'
    when :development
      'https://capi.pay2go.com/MPG/mpg_gateway'
    when :test
      'https://capi.pay2go.com/MPG/mpg_gateway'
    else
      raise StandardError, "Integration mode set to an invalid value: #{mode}"
  end
end

.setup {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



44
45
46
# File 'lib/offsite_payments/integrations/pay2go.rb', line 44

def self.setup
  yield(self)
end