Class: Stripe::PaymentMethodCreateParams::Card

Inherits:
RequestParams show all
Defined in:
lib/stripe/params/payment_method_create_params.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.



138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# File 'lib/stripe/params/payment_method_create_params.rb', line 138

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.



126
127
128
# File 'lib/stripe/params/payment_method_create_params.rb', line 126

def cvc
  @cvc
end

#exp_monthObject

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



128
129
130
# File 'lib/stripe/params/payment_method_create_params.rb', line 128

def exp_month
  @exp_month
end

#exp_yearObject

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



130
131
132
# File 'lib/stripe/params/payment_method_create_params.rb', line 130

def exp_year
  @exp_year
end

#networksObject

Contains information about card networks used to process the payment.



132
133
134
# File 'lib/stripe/params/payment_method_create_params.rb', line 132

def networks
  @networks
end

#numberObject

The card number, as a string without any separators.



134
135
136
# File 'lib/stripe/params/payment_method_create_params.rb', line 134

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



136
137
138
# File 'lib/stripe/params/payment_method_create_params.rb', line 136

def token
  @token
end