Created
August 25, 2017 13:37
-
-
Save buoyant/506725fb1f25627d4c0487374faa8166 to your computer and use it in GitHub Desktop.
StripeNewCheckoutPlugin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#-- 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