mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-27 17:45:40 -05:00
Cleaned up a couple SubscribeModal things
This commit is contained in:
parent
63d643ac13
commit
7aff24b3a6
2 changed files with 3 additions and 4 deletions
|
@ -7,7 +7,6 @@ if StripeCheckout?
|
|||
email: me.get('email')
|
||||
image: "https://codecombat.com/images/pages/base/logo_square_250.png"
|
||||
token: (token) ->
|
||||
console.log 'trigger?', handler.trigger
|
||||
handler.trigger 'received-token', { token: token }
|
||||
Backbone.Mediator.publish 'stripe:received-token', { token: token }
|
||||
locale: 'auto'
|
||||
|
|
|
@ -201,13 +201,13 @@ module.exports = class SubscribeModal extends ModalView
|
|||
@state = 'unknown_error'
|
||||
@stateMessage = "Uknown problem occurred while processing Stripe request"
|
||||
|
||||
onSubscriptionSuccess: =>
|
||||
onSubscriptionSuccess: ->
|
||||
application.tracker?.trackEvent 'Finished subscription purchase', value: @purchasedAmount
|
||||
Backbone.Mediator.publish 'subscribe-modal:subscribed', {}
|
||||
@playSound 'victory'
|
||||
@hide()
|
||||
|
||||
onSubscriptionError: (user, response, options) =>
|
||||
onSubscriptionError: (user, response, options) ->
|
||||
console.error 'We got an error subscribing with Stripe from our server:', response
|
||||
application.tracker?.trackEvent 'Failed to finish subscription purchase', status: options.xhr?.status, value: @purchasedAmount
|
||||
stripe = me.get('stripe') ? {}
|
||||
|
|
Loading…
Reference in a new issue