VRFS-4052 - more connectstripe form defaults

This commit is contained in:
Seth Call 2016-05-17 20:52:25 -05:00
parent 0c0e22df8c
commit fb0c96e6b4
3 changed files with 28 additions and 3 deletions

View File

@ -121,6 +121,11 @@ profileUtils = context.JK.ProfileUtils
resetErrors: () ->
@setState({ccError: null, cvvError: null, expiryError: null, billingInUSError: null, zipCodeError: null, nameError: null})
onBack: (e) ->
e.preventDefault()
window.history.go(-1);
checkboxChanged: (e) ->
checked = $(e.target).is(':checked')
@ -515,7 +520,7 @@ profileUtils = context.JK.ProfileUtils
<a className="btn-next-pager" href="/api/sales?page=1">Next</a>
<div className="end-of-payments-list end-of-list">No more payment history</div>
<div className="input-aligner">
<a className="back button-grey">BACK</a>
<a className="back button-grey" onClick={this.onBack}>BACK</a>
</div>
<br className="clearall" />
</div>`

View File

@ -52,6 +52,7 @@ UserStore = context.UserStore
$node.lessonSessionActions(lesson).on(context.JK.EVENTS.LESSON_SESSION_ACTION, @lessonSessionActionSelected)
))
context.JK.popExternalLinks(@root)
lessonSessionActionSelected: (e, data) ->
lessonId = data.options.id
@ -332,7 +333,7 @@ UserStore = context.UserStore
<p>JamClass instructors are each individually screened to ensure that they are highly qualified music
teachers,
equipped to teach effectively online, and background checked.
and are equipped with the right gear to teach effectively online.
</p>
<div className="actions">

View File

@ -29,6 +29,25 @@ rest = new context.JK.Rest()
email = encodeURIComponent(user.email)
firstName = encodeURIComponent(user.first_name)
lastName = encodeURIComponent(user.last_name)
window.location.href = "/auth/stripe_connect?redirect_uri=#{redirectUri}&scope=read_write&stripe_user[url]=#{teacherProfileUri}&stripe_user[email]=#{email}&stripe_user[first_name]=#{firstName}&stripe_user[last_name]=#{lastName}"
url = "/auth/stripe_connect?redirect_uri=#{redirectUri}&scope=read_write&stripe_user[url]=#{teacherProfileUri}&stripe_user[email]=#{email}&stripe_user[first_name]=#{firstName}&stripe_user[last_name]=#{lastName}"
# product description
productDescription = "Online music lessons billed either per lesson or per month"
url += "&stripe_user[product_description]=#{productDescription}"
# business type
url += "&stripe_user[business_type]=sole_prop"
# business name
businessName = "#{user.name} Lessons"
url += "&stripe_user[business_name]=#{businessName}"
# country
if user.country?
url += "&stripe_user[country]=#{encodeURIComponent(user.country)}"
window.location.href = url
}
)