Sha256: 2acc4f488a26df148e6a46e434c2df8822275f2bf5500f5744df628bff4d1a79

Contents?: true

Size: 1.61 KB

Versions: 7

Compression:

Stored size: 1.61 KB

Contents

require File.dirname(__FILE__) + '/paydollar/helper.rb'
require File.dirname(__FILE__) + '/paydollar/notification.rb'
require File.dirname(__FILE__) + '/paydollar/return.rb'

module ActiveMerchant #:nodoc:
  module Billing #:nodoc:
    module Integrations #:nodoc:
      module Paydollar

        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',
        }

        def self.service_url
          case ActiveMerchant::Billing::Base.integration_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

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

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

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

      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
activemerchant-1.43.3 lib/active_merchant/billing/integrations/paydollar.rb
activemerchant-1.43.1 lib/active_merchant/billing/integrations/paydollar.rb
activemerchant-1.43.0 lib/active_merchant/billing/integrations/paydollar.rb
activemerchant-1.42.9 lib/active_merchant/billing/integrations/paydollar.rb
activemerchant-1.42.8 lib/active_merchant/billing/integrations/paydollar.rb
activemerchant-1.42.7 lib/active_merchant/billing/integrations/paydollar.rb
activemerchant-1.42.6 lib/active_merchant/billing/integrations/paydollar.rb