Module: OffsitePayments::Integrations::Paydollar

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

Defined Under Namespace

Classes: Helper, Notification, Return

Constant Summary collapse

CURRENCY_MAP =
{
    'AED' => '784',
    'AUD' => '036',
    'BND' => '096',
    'CAD' => '124',
    'CNY' => '156',
    'EUR' => '978',
    'GBP' => '826',
    'HKD' => '344',
    'IDR' => '360',
    'JPY' => '392',
    'KRW' => '410',
    'MOP' => '446',
    'MYR' => '458',
    'NZD' => '554',
    'PHP' => '608',
    'SAR' => '682',
    'SGD' => '702',
    'THB' => '764',
    'TWD' => '901',
    'USD' => '840',
}

Class Method Summary collapse

Class Method Details

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


38
39
40
# File 'lib/offsite_payments/integrations/paydollar.rb', line 38

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

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


42
43
44
# File 'lib/offsite_payments/integrations/paydollar.rb', line 42

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

.service_urlObject


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

def self.service_url
  case OffsitePayments.mode
  when :production
    'https://www.paydollar.com/b2c2/eng/payment/payForm.jsp'
  when :test
    'https://test.paydollar.com/b2cDemo/eng/payment/payForm.jsp'
  else
    raise StandardError, "Integration mode set to an invalid value: #{mode}"
  end
end

.sign(fields, secret) ⇒ Object


46
47
48
# File 'lib/offsite_payments/integrations/paydollar.rb', line 46

def self.sign(fields, secret)
  Digest::SHA1.hexdigest(fields.push(secret).join('|'))
end