Class: Stripe::PaymentMethodService::CreateParams::Card

Inherits:
RequestParams
  • Object
show all
Defined in:
lib/stripe/services/payment_method_service.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.



183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
# File 'lib/stripe/services/payment_method_service.rb', line 183

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.



171
172
173
# File 'lib/stripe/services/payment_method_service.rb', line 171

def cvc
  @cvc
end

#exp_monthObject

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



173
174
175
# File 'lib/stripe/services/payment_method_service.rb', line 173

def exp_month
  @exp_month
end

#exp_yearObject

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



175
176
177
# File 'lib/stripe/services/payment_method_service.rb', line 175

def exp_year
  @exp_year
end

#networksObject

Contains information about card networks used to process the payment.



177
178
179
# File 'lib/stripe/services/payment_method_service.rb', line 177

def networks
  @networks
end

#numberObject

The card number, as a string without any separators.



179
180
181
# File 'lib/stripe/services/payment_method_service.rb', line 179

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



181
182
183
# File 'lib/stripe/services/payment_method_service.rb', line 181

def token
  @token
end