Sha256: f98bc04e86931f60e89f05a495afbb89e66ce6dd09de36109b25f997091abe2b

Contents?: true

Size: 1.06 KB

Versions: 14

Compression:

Stored size: 1.06 KB

Contents

module Recurly
  class BillingInfo < Resource
    # @return [Account]
    belongs_to :account

    define_attribute_methods %w(
      first_name
      last_name
      company
      address1
      address2
      city
      state
      zip
      country
      phone
      vat_number
      ip_address
      ip_address_country
      card_type
      year
      month
      start_year
      start_month
      issue_number
      first_six
      last_four
      paypal_billing_agreement_id
      number
      verification_value
    )

    # @return ["credit_card", "paypal", nil] The type of billing info.
    attr_reader :type

    # @return [String]
    def inspect
      attributes = self.class.attribute_names
      case type
      when 'credit_card'
        attributes -= %w(paypal_billing_agreement_id)
      when 'paypal'
        attributes -= %w(
          card_type year month start_year start_month issue_number
          first_six last_four
        )
      end
      super attributes
    end

    # Billing info is only writeable through an {Account} instance.
    embedded!
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
recurly-2.0.14 lib/recurly/billing_info.rb
recurly-2.0.13 lib/recurly/billing_info.rb
recurly-2.0.12 lib/recurly/billing_info.rb
recurly-2.1.8 lib/recurly/billing_info.rb
recurly-2.1.7 lib/recurly/billing_info.rb
recurly-2.1.5 lib/recurly/billing_info.rb
recurly-2.1.4 lib/recurly/billing_info.rb
recurly-2.1.3 lib/recurly/billing_info.rb
recurly-2.1.2 lib/recurly/billing_info.rb
recurly-2.1.1 lib/recurly/billing_info.rb
recurly-2.1.0 lib/recurly/billing_info.rb
recurly-2.0.11 lib/recurly/billing_info.rb
recurly-2.0.10 lib/recurly/billing_info.rb
recurly-2.0.9 lib/recurly/billing_info.rb