Class: Payola::Factories::StripePaymentToken

Inherits:
Object
  • Object
show all
Defined in:
lib/payola/factories/stripe_payment_token.rb

Class Method Summary collapse

Class Method Details

.create(card: nil) ⇒ Object



4
5
6
7
8
9
10
11
12
13
# File 'lib/payola/factories/stripe_payment_token.rb', line 4

def self.create(card: nil)
  Stripe.api_key = Payola.config.payment_gateway_api_key

  card ||= { number:     '4242424242424242',
             exp_month:  3,
             exp_year:   Time.now.strftime("%Y").to_i + 5,
             cvc:        '314' }

  Stripe::Token.create(card: card).id
end