Issues with Stripe : Mock and solutions

undefined method `api_key=’ for StripeMock:Module

Looks like we dont need to pass API_KEYs if everything we are going to mock everything.

Stripe::InvalidRequestError: No such plan: thepact_monthly

Create a mock plan like

plan_params = {:id => 'thepact_monthly',
               :name => 'StripeMock Default Plan ID',
               :amount => 1900,
               :currency => 'usd',
               :interval => 'month'}
stripe_helper.create_plan(plan_params)

Stripe::InvalidRequestError: You must supply a valid card xoxo

You need to pass ‘source’ attribute as well

subscription = customer.subscriptions.create(
    {
        plan: 'thepact_monthly',
        source: stripe_helper.generate_card_token({name: 'Shiva'})
    })

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s