Sha256: 8b74dd474263c22a2d2505d79518fc97d47f0db0333e79248fd9581daedb943d

Contents?: true

Size: 1.49 KB

Versions: 1

Compression:

Stored size: 1.49 KB

Contents

module ActiveMerchant #:nodoc:
  module Billing #:nodoc:
    module Integrations #:nodoc:
      module BitPay
        class Helper < ActiveMerchant::Billing::Integrations::Helper
          def initialize(order_id, account, options)
            super
            add_field('account', account)
            add_field('orderID', order_id)
            add_field('posData', options[:authcode])
            add_field('currency', options[:currency])
            add_field('fullNotifications', 'true')
            add_field('transactionSpeed', options[:transactionSpeed] || "high")
            add_field('address1', options[:address1])
          end

          # Replace with the real mapping
          mapping :account, 'key'
          mapping :amount, 'price'

          mapping :order, 'orderID'        
          mapping :currency, 'currency'

          mapping :customer, :first_name => 'buyerName',
                             :email      => 'buyerEmail',
                             :phone      => 'buyerPhone'

          mapping :billing_address, :city     => 'buyerCity',
                                    :address1 => 'buyerAddress1',
                                    :address2 => 'buyerAddress2',
                                    :state    => 'buyerState',
                                    :zip      => 'buyerZip',
                                    :country  => 'buyerCountry'

          mapping :notify_url, 'notificationURL'
          mapping :return_url, 'returnURL'
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
activemerchant-1.39.0 lib/active_merchant/billing/integrations/bit_pay/helper.rb