Sha256: a8347fe5d56788890ba5fb4df0343fac3ab1b3aa7bcd78a9f2aa8aa78b0970db

Contents?: true

Size: 1 KB

Versions: 7

Compression:

Stored size: 1 KB

Contents

namespace :stripe do
  desc 'verify your stripe.com authentication configuration'
  task 'verify' => :environment do
    begin
      Stripe::Plan.list
      puts "[OK] - connection to stripe.com is functioning properly"
    rescue Stripe::AuthenticationError => e
      puts "[FAIL] - authentication failed"
    end
  end

  task 'products:prepare' => 'environment' do
    if CurrentApiVersion.after_switch_to_products_in_plans?
      Stripe::Products.put!
    else
      puts '[SKIPPED] Current API version does not support Products'
    end
  end

  task 'plans:prepare' => 'environment' do
    Stripe::Plans.put!
  end

  task 'coupons:prepare' => 'environment' do
    Stripe::Coupons.put!
  end

  desc 'delete and redefine all coupons defined in config/stripe/coupons.rb'
  task 'coupons:reset!' => 'environment' do
    Stripe::Coupons.reset!
  end

  desc "create all plans and coupons defined in config/stripe/{products|plans|coupons}.rb"
  task 'prepare' => ['products:prepare', 'plans:prepare', 'coupons:prepare']
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
stripe-rails-2.1.0 lib/stripe/rails/tasks.rake
stripe-rails-2.0.0 lib/stripe/rails/tasks.rake
stripe-rails-1.10.2 lib/stripe/rails/tasks.rake
stripe-rails-2.0.0.pre lib/stripe/rails/tasks.rake
stripe-rails-1.10.1 lib/stripe/rails/tasks.rake
stripe-rails-1.10.0 lib/stripe/rails/tasks.rake
stripe-rails-1.9.1 lib/stripe/rails/tasks.rake