Sha256: ac653fcfc035412e26650df12837988c5fbc966b28a92b2f58ae874cba827281

Contents?: true

Size: 668 Bytes

Versions: 1

Compression:

Stored size: 668 Bytes

Contents

module Workarea
  class Payment
    module CreditCardData
      def transaction_args
        {
          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

1 entries across 1 versions & 1 rubygems

Version Path
workarea-payeezy-1.0.0 app/models/workarea/payment/credit_card_data.rb