2014-11-17 18:15:02 -05:00
|
|
|
publishableKey = if application.isProduction() then 'pk_live_27jQZozjDGN1HSUTnSuM578g' else 'pk_test_zG5UwVu6Ww8YhtE9ZYh0JO6a'
|
2015-03-18 20:17:30 -04:00
|
|
|
|
2014-11-17 18:15:02 -05:00
|
|
|
module.exports = handler = StripeCheckout.configure({
|
|
|
|
key: publishableKey
|
|
|
|
name: 'CodeCombat'
|
|
|
|
email: me.get('email')
|
2015-03-23 18:26:44 -04:00
|
|
|
image: "https://codecombat.com/images/pages/base/logo_square_250.png"
|
2014-11-17 18:15:02 -05:00
|
|
|
token: (token) ->
|
2015-11-05 18:31:25 -05:00
|
|
|
console.log 'trigger?', handler.trigger
|
|
|
|
handler.trigger 'received-token', { token: token }
|
2014-11-17 18:15:02 -05:00
|
|
|
Backbone.Mediator.publish 'stripe:received-token', { token: token }
|
2015-03-18 20:17:30 -04:00
|
|
|
locale: 'auto'
|
|
|
|
})
|
2015-11-05 18:31:25 -05:00
|
|
|
|
|
|
|
_.extend(handler, Backbone.Events)
|