context = window
rest = context.JK.Rest()
logger = context.JK.logger
UserStore = context.UserStore
@StripeConnect = React.createClass({
getInitialState: () ->
{
clicked:false
}
openBrowser: () ->
context.JK.popExternalLink("https://www.jamkazam.com/client#/jamclass")
onStripeConnect: (e) ->
if this.state.clicked
return
e.preventDefault()
if window.jamClient.IsNativeClient()
buttons = []
buttons.push({name: 'CLOSE', buttonStyle: 'button-grey'})
buttons.push({
name: 'OPEN BROWSER',
buttonStyle: 'button-orange',
click: (() => (@openBrowser()))
})
context.JK.Banner.show({
title: "Browser Needed",
html: "You must connect to Stripe in a normal browser.
Please select the OPEN BROWSER button to open this page in your system browser.",
buttons: buttons
})
return
this.setState({clicked: true})
StripeActions.connect(this.props.purpose, this.props.user)
render: () ->
if this.props.purpose == 'jamclass-home'
label = ``
else
label = ``
if this.props.user?.stripe_auth?
if this.props.purpose == 'jamclass-home'
return `
Your Stripe account is properly set up and connected to enable transfer of student payments. To view lesson payment history, click the button below.
VIEW PAYMENTS