Skip to content

Commit

Permalink
Upgrading Stripe API support to 2017-08-15.
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewculver committed Sep 30, 2017
1 parent c53a933 commit cdfd072
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions app/concerns/koudoku/subscription.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def processing!

# store the customer id.
self.stripe_id = customer.id
self.last_four = customer.cards.retrieve(customer.default_card).last4
self.last_four = customer.sources.retrieve(customer.default_source).last4

finalize_new_subscription!
finalize_upgrade!
Expand All @@ -123,11 +123,11 @@ def processing!

# fetch the customer.
customer = Stripe::Customer.retrieve(self.stripe_id)
customer.card = self.credit_card_token
customer.source = self.credit_card_token
customer.save

# update the last four based on this new card.
self.last_four = customer.cards.retrieve(customer.default_card).last4
self.last_four = customer.sources.retrieve(customer.default_source).last4
finalize_card_update!

end
Expand Down
12 changes: 6 additions & 6 deletions lib/generators/koudoku/templates/config/initializers/koudoku.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
config.subscriptions_owned_by = :<%= subscription_owner_model %>
config.stripe_publishable_key = ENV['STRIPE_PUBLISHABLE_KEY']
config.stripe_secret_key = ENV['STRIPE_SECRET_KEY']
Stripe.api_version = '2015-01-11' #Making sure the API version used is compatible.

Stripe.api_version = '2017-08-15' # Making sure the API version used is compatible.
# config.prorate = false # Default is true, set to false to disable prorating subscriptions
# config.free_trial_length = 30

# Specify layout you want to use for the subscription pages, default is application
config.layout = 'application'

# you can subscribe to additional webhooks here
# we use stripe_event under the hood and you can subscribe using the
# stripe_event syntax on the config object:
# we use stripe_event under the hood and you can subscribe using the
# stripe_event syntax on the config object:
# config.subscribe 'charge.failed', Koudoku::ChargeFailed

end

0 comments on commit cdfd072

Please sign in to comment.