Module: OffsitePayments::Integrations::Paydollar

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

Defined Under Namespace

Classes: Helper, Notification, Return

Constant Summary collapse

CURRENCY_MAP =
{
    'HKD' => '344',
    'USD' => '840',
    'SGD' => '702',
    'CNY' => '156',
    'JPY' => '392',
    'TWD' => '901',
    'AUD' => '036',
    'EUR' => '978',
    'GBP' => '826',
    'CAD' => '124',
    'MOP' => '446',
    'PHP' => '608',
    'THB' => '764',
    'MYR' => '458',
    'IDR' => '360',
    'KRW' => '410',
    'BND' => '096',
    'NZD' => '554',
    'SAR' => '682',
    'AED' => '784',
    'BRL' => '986',
    'INR' => '356',
    'TRY' => '949',
    'ZAR' => '710',
    'VND' => '704',
    'DKK' => '208',
    'ILS' => '376',
    'NOK' => '578',
    'RUB' => '643',
    'SEK' => '752',
    'CHF' => '756',
    'ARS' => '032',
    'CLP' => '152',
    'COP' => '170',
    'CZK' => '203',
    'EGP' => '818',
    'HUF' => '348',
    'KZT' => '398',
    'LBP' => '422',
    'MXN' => '484',
    'NGN' => '566',
    'PKR' => '586',
    'PEN' => '604',
    'PLN' => '985',
    'QAR' => '634',
    'RON' => '946',
    'UAH' => '980',
    'VEF' => '937',
    'LKR' => '144',
    'KWD' => '414',
}

Class Method Summary collapse

Class Method Details

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



68
69
70
# File 'lib/offsite_payments/integrations/paydollar.rb', line 68

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

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



72
73
74
# File 'lib/offsite_payments/integrations/paydollar.rb', line 72

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

.service_urlObject

change url



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

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

.sign(fields, secret) ⇒ Object



76
77
78
# File 'lib/offsite_payments/integrations/paydollar.rb', line 76

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