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.



1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
# File 'lib/stripe/resources/payment_method.rb', line 1032

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.



1015
1016
1017
# File 'lib/stripe/resources/payment_method.rb', line 1015

def cvc
  @cvc
end

#exp_monthObject

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



1018
1019
1020
# File 'lib/stripe/resources/payment_method.rb', line 1018

def exp_month
  @exp_month
end

#exp_yearObject

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



1021
1022
1023
# File 'lib/stripe/resources/payment_method.rb', line 1021

def exp_year
  @exp_year
end

#networksObject

Contains information about card networks used to process the payment.



1024
1025
1026
# File 'lib/stripe/resources/payment_method.rb', line 1024

def networks
  @networks
end

#numberObject

The card number, as a string without any separators.



1027
1028
1029
# File 'lib/stripe/resources/payment_method.rb', line 1027

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”.



1030
1031
1032
# File 'lib/stripe/resources/payment_method.rb', line 1030

def token
  @token
end