diff --git a/app/views/play/modal/SubscribeModal.coffee b/app/views/play/modal/SubscribeModal.coffee index 8b5381f42..157e49dda 100644 --- a/app/views/play/modal/SubscribeModal.coffee +++ b/app/views/play/modal/SubscribeModal.coffee @@ -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' diff --git a/server/payments/subscription_handler.coffee b/server/payments/subscription_handler.coffee index 2ab45ed48..63170bb33 100644 --- a/server/payments/subscription_handler.coffee +++ b/server/payments/subscription_handler.coffee @@ -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