Sha256: 353596502578ca37d84100aeed80369314630a5d6799c747a1dff54aa0cbe065

Contents?: true

Size: 829 Bytes

Versions: 2

Compression:

Stored size: 829 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"),
                            &block)

      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,
        block: block
      }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
stripe-rails-2.6.0 app/helpers/stripe/javascript_helper.rb
stripe-rails-2.5.0 app/helpers/stripe/javascript_helper.rb