Sha256: 75e1aa678bdad250d32217694de5c2874f05e8b894660121dd60b30d177eb7ba

Contents?: true

Size: 707 Bytes

Versions: 14

Compression:

Stored size: 707 Bytes

Contents

module Workarea
  class Payment
    module CreditCardData
      def transaction_args
        {
          order_id: tender.payment.id,
          billing_address: billing_address
        }
      end

      def billing_address
        {
          name:       "#{address.first_name} #{address.last_name}",
          company:    address.company,
          address1:   address.street,
          city:       address.city,
          state:      address.region,
          country:    address.country.try(:alpha2),
          zip:        address.postal_code,
          phone:      nil
        }
      end

      def payment_source
        tender.token.presence || tender.to_active_merchant
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
workarea-usaepay-1.1.0 app/models/workarea/payment/credit_card_data.rb
workarea-usaepay-1.0.44 app/models/workarea/payment/credit_card_data.rb
workarea-usaepay-1.0.43 app/models/workarea/payment/credit_card_data.rb
workarea-usaepay-1.0.42 app/models/workarea/payment/credit_card_data.rb
workarea-usaepay-1.0.41 app/models/workarea/payment/credit_card_data.rb
workarea-usaepay-1.0.40 app/models/workarea/payment/credit_card_data.rb
workarea-usaepay-1.0.30 app/models/workarea/payment/credit_card_data.rb
workarea-usaepay-1.0.3 app/models/workarea/payment/credit_card_data.rb
workarea-usaepay-1.0.26 app/models/workarea/payment/credit_card_data.rb
workarea-usaepay-1.0.24 app/models/workarea/payment/credit_card_data.rb
workarea-usaepay-1.0.23 app/models/workarea/payment/credit_card_data.rb
workarea-usaepay-1.0.22 app/models/workarea/payment/credit_card_data.rb
workarea-usaepay-1.0.21 app/models/workarea/payment/credit_card_data.rb
workarea-usaepay-1.0.2 app/models/workarea/payment/credit_card_data.rb