Class: Stripe::PaymentMethod::CreateParams::Card

Inherits:
RequestParams show all
Defined in:
lib/stripe/resources/payment_method.rb

Defined Under Namespace

Classes: Networks

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from RequestParams

#to_h

Constructor Details

#initialize(cvc: nil, exp_month: nil, exp_year: nil, networks: nil, number: nil, token: nil) ⇒ Card

Returns a new instance of Card.



1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
# File 'lib/stripe/resources/payment_method.rb', line 1643

def initialize(
  cvc: nil,
  exp_month: nil,
  exp_year: nil,
  networks: nil,
  number: nil,
  token: nil
)
  @cvc = cvc
  @exp_month = exp_month
  @exp_year = exp_year
  @networks = networks
  @number = number
  @token = token
end

Instance Attribute Details

#cvcObject

The card’s CVC. It is highly recommended to always include this value.



1631
1632
1633
# File 'lib/stripe/resources/payment_method.rb', line 1631

def cvc
  @cvc
end

#exp_monthObject

Two-digit number representing the card’s expiration month.



1633
1634
1635
# File 'lib/stripe/resources/payment_method.rb', line 1633

def exp_month
  @exp_month
end

#exp_yearObject

Four-digit number representing the card’s expiration year.



1635
1636
1637
# File 'lib/stripe/resources/payment_method.rb', line 1635

def exp_year
  @exp_year
end

#networksObject

Contains information about card networks used to process the payment.



1637
1638
1639
# File 'lib/stripe/resources/payment_method.rb', line 1637

def networks
  @networks
end

#numberObject

The card number, as a string without any separators.



1639
1640
1641
# File 'lib/stripe/resources/payment_method.rb', line 1639

def number
  @number
end

#tokenObject

For backwards compatibility, you can alternatively provide a Stripe token (e.g., for Apple Pay, Amex Express Checkout, or legacy Checkout) into the card hash with format card: “tok_visa”.



1641
1642
1643
# File 'lib/stripe/resources/payment_method.rb', line 1641

def token
  @token
end