Sha256: a61e306cbb5f9e9a74081dd9361ad9fee873120a0bf2255081db349c5bf3e35e

Contents?: true

Size: 1.18 KB

Versions: 1

Compression:

Stored size: 1.18 KB

Contents

module Spree
  class Gateway::BraintreeVzeroHostedFields < Spree::Gateway::BraintreeVzeroBase
    preference :checkout_form_id, :string, default: 'checkout_form_payment'
    preference :error_messages_container_id, :string, default: 'content'
    preference :number_selector, :string, default: '#hosted-fields-number'
    preference :number_placeholder, :string, default: 'Card Number'
    preference :cvv_selector, :string, default: '#hosted-fields-cvv'
    preference :cvv_placeholder, :string, default: 'Cvv code'
    preference :expiration_date_selector, :string, default: '#hosted-fields-expiration-date'
    preference :expiration_date_placeholder, :string, default: 'Card Expiration Date'
    preference :store_payments_in_vault, :select, default: -> { { values: [:do_not_store, :store_only_on_success, :store_all] } }
    preference :'3dsecure', :boolean_select, default: false

    after_save :disable_dropin_gateways, if: proc {
      active? && (saved_changes.keys & %w[active id]).any?
    }

    def method_type
      'braintree_vzero_hosted_fields'
    end

    private

    def disable_dropin_gateways
      Spree::Gateway::BraintreeVzeroDropInUi.update_all(active: false)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
spree_braintree_vzero-3.5.1 app/models/spree/gateway/braintree_vzero_hosted_fields.rb