Sha256: c69e4675924267e5af50cb31a8e3a742aba4864c81063907774f672f495ea17f

Contents?: true

Size: 771 Bytes

Versions: 25

Compression:

Stored size: 771 Bytes

Contents

module Stripe
  module JavascriptHelper
    DEFAULT_STRIPE_JS_VERSION = 'v3'

    def stripe_javascript_tag(stripe_js_version = DEFAULT_STRIPE_JS_VERSION)
      stripe_js_version = stripe_js_version.to_s.downcase

      render 'stripe/js', stripe_js_version: stripe_js_version
    end

    def stripe_elements_tag(submit_path:,
                            css_path: asset_path("stripe_elements.css"),
                            js_path: asset_path("stripe_elements.js"))

      render partial: 'stripe/elements', locals: {
        submit_path: submit_path,
        label_text: t('stripe_rails.elements.label_text'),
        submit_button_text: t('stripe_rails.elements.submit_button_text'),
        css_path: css_path,
        js_path: js_path
      }
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
stripe-rails-2.4.0 app/helpers/stripe/javascript_helper.rb
stripe-rails-2.3.5 app/helpers/stripe/javascript_helper.rb
stripe-rails-2.3.4 app/helpers/stripe/javascript_helper.rb
stripe-rails-2.3.3 app/helpers/stripe/javascript_helper.rb
stripe-rails-2.3.2 app/helpers/stripe/javascript_helper.rb
stripe-rails-2.3.1 app/helpers/stripe/javascript_helper.rb
stripe-rails-2.3.0 app/helpers/stripe/javascript_helper.rb
stripe-rails-2.2.1 app/helpers/stripe/javascript_helper.rb
stripe-rails-2.2.0 app/helpers/stripe/javascript_helper.rb
stripe-rails-2.1.0 app/helpers/stripe/javascript_helper.rb
stripe-rails-2.0.0 app/helpers/stripe/javascript_helper.rb
stripe-rails-1.10.2 app/helpers/stripe/javascript_helper.rb
stripe-rails-2.0.0.pre app/helpers/stripe/javascript_helper.rb
stripe-rails-1.10.1 app/helpers/stripe/javascript_helper.rb
stripe-rails-1.10.0 app/helpers/stripe/javascript_helper.rb
stripe-rails-1.9.1 app/helpers/stripe/javascript_helper.rb
stripe-rails-1.9.0 app/helpers/stripe/javascript_helper.rb
stripe-rails-1.8.2 app/helpers/stripe/javascript_helper.rb
stripe-rails-1.8.1 app/helpers/stripe/javascript_helper.rb
stripe-rails-1.8.0 app/helpers/stripe/javascript_helper.rb