Sha256: 0cdec3a4a7b809d3e1a2f5f0d446855d24cea293ee5f35a9e9462764842515e0

Contents?: true

Size: 509 Bytes

Versions: 11

Compression:

Stored size: 509 Bytes

Contents

# frozen_string_literal: true

module SolidusNexio
  class ApmSource < SolidusSupport.payment_source_parent_class
    self.table_name = 'solidus_nexio_apm_sources'

    belongs_to :user, class_name: Spree::UserClassHandle.new, foreign_key: 'user_id', optional: true

    enum kind: {
      braintree_pay_pal: 0,
      pay_pal: 1,
      apple_pay_cyber_source: 2
    }

    def reusable?
      gateway_payment_profile_id.present?
    end

    def name
      I18n.t("nexio.apms.#{kind}.name")
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
solidus_nexio-1.0.0 app/models/solidus_nexio/apm_source.rb
solidus_nexio-0.7.12 app/models/solidus_nexio/apm_source.rb
solidus_nexio-0.7.11 app/models/solidus_nexio/apm_source.rb
solidus_nexio-0.7.10 app/models/solidus_nexio/apm_source.rb
solidus_nexio-0.7.9 app/models/solidus_nexio/apm_source.rb
solidus_nexio-0.7.8 app/models/solidus_nexio/apm_source.rb
solidus_nexio-0.7.7 app/models/solidus_nexio/apm_source.rb
solidus_nexio-0.7.6 app/models/solidus_nexio/apm_source.rb
solidus_nexio-0.7.5 app/models/solidus_nexio/apm_source.rb
solidus_nexio-0.7.4 app/models/solidus_nexio/apm_source.rb
solidus_nexio-0.7.3 app/models/solidus_nexio/apm_source.rb