mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-01 15:50:11 -04:00
Don't panic if we didn't load stripe. (Makes game run offline).
This commit is contained in:
parent
d7a66722b9
commit
4dde97153c
1 changed files with 15 additions and 12 deletions
|
@ -1,15 +1,18 @@
|
|||
publishableKey = if application.isProduction() then 'pk_live_27jQZozjDGN1HSUTnSuM578g' else 'pk_test_zG5UwVu6Ww8YhtE9ZYh0JO6a'
|
||||
|
||||
module.exports = handler = StripeCheckout.configure({
|
||||
key: publishableKey
|
||||
name: 'CodeCombat'
|
||||
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'
|
||||
})
|
||||
|
||||
if StripeCheckout?
|
||||
module.exports = handler = StripeCheckout.configure({
|
||||
key: publishableKey
|
||||
name: 'CodeCombat'
|
||||
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'
|
||||
})
|
||||
else
|
||||
module.exports = {}
|
||||
console.error "Failure loading StripeCheckout API, returning empty object."
|
||||
_.extend(handler, Backbone.Events)
|
Loading…
Add table
Reference in a new issue