Set up stubs for future subscription sales.

This commit is contained in:
Scott Erickson 2014-12-06 12:37:54 -08:00
parent 9e9c0e6fee
commit aac1aa379e
2 changed files with 17 additions and 2 deletions
app/views/play/modal
server/payments

View file

@ -53,10 +53,20 @@ module.exports = class SubscribeModal extends ModalView
return @openModalView new AuthModal() if me.get('anonymous')
application.tracker?.trackEvent 'Started subscription purchase', {}
application.tracker?.trackPageView "subscription/start-purchase", ['Google Analytics']
stripeHandler.open({
options = {
description: $.i18n.t('subscribe.stripe_description')
amount: @product.amount
})
}
# SALE LOGIC
# overwrite amount with sale price
# maybe also put in another description with details about how long it lasts, etc
# options = {
# description: 'Subscription. Half price for three months!'
# amount: 499
# }
stripeHandler.open(options)
onStripeReceivedToken: (e) ->
@state = 'purchasing'

View file

@ -68,6 +68,11 @@ class SubscriptionHandler extends Handler
checkForExistingSubscription: (req, user, customer, done) ->
couponID = user.get('stripe')?.couponID
# SALE LOGIC
# overwrite couponID with another for everyone-sales
# couponID = 'hoc_bonanza' if not couponID
if subscription = customer.subscriptions?.data?[0]
if subscription.cancel_at_period_end