Module: Dugway::Filters::InstantCheckoutFilter

Defined in:
lib/dugway/liquid/filters/instant_checkout_filter.rb

Constant Summary collapse

DIV_STYLES =
[
  "border-radius: 4px",
  "font-size: 20px",
  "font-weight: bold"
].freeze
[
  "border-radius: 4px",
  "height: 100%",
  "display: flex",
  "padding: 10px",
  "align-items: center",
  "justify-content: center"
].freeze

Instance Method Summary collapse

Instance Method Details

#instant_checkout_button(account, a = nil, b = nil) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/dugway/liquid/filters/instant_checkout_filter.rb', line 19

def instant_checkout_button(, a=nil, b=nil)
   = @context.registers[:account]
  theme, height = sanitize_options(a, b)

  return nil unless .instant_checkout?

  div_styles = generate_div_styles(theme, height)
  link_styles = generate_link_styles(theme)

  %(<div id="instant-checkout-button" style="#{ div_styles }"><a href="https://www.bigcartel.com/resources/help/article/apple-pay" style="#{ link_styles }">Instant Checkout</a></div>)
end