Skip to content

Instantly share code, notes, and snippets.

@buoyant
Created August 25, 2017 13:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save buoyant/506725fb1f25627d4c0487374faa8166 to your computer and use it in GitHub Desktop.
Save buoyant/506725fb1f25627d4c0487374faa8166 to your computer and use it in GitHub Desktop.
StripeNewCheckoutPlugin
#-- encoding: UTF-8
module StripeNewCheckoutPlugin
def self.included(base)
base.class_eval do
#
end
end
# credit card commons fields
def cc_number_field
{:name => 'number', :p_class => 'full-width', :options => {:'data-stripe' => 'number'}}
end
def cvv_field
{:name => 'cvc', :options => {:'data-stripe' => 'cvc'}}
end
def expiry_month_field
{:name => 'credit_card[month]', :options => {:'data-stripe' => 'exp-month'}}
end
def expiry_year_field
{:name => 'credit_card[year]', :options => {:'data-stripe' => 'exp-year'}}
end
def accepts_cvv?
true
end
# card types support
def supports_visa?
true
end
def supports_master_card?
true
end
def supports_amex?
true
end
def supports_discover?
true
end
def supports_diners?
false
end
def card_types_selectable?
false
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment