Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class RegisterForm
- constructor: ->
- @initEvents()
- @discountForm = new DiscountCodeForm()
- @initForm()
- @isFree = window.isFree;
- initForm: ->
- $('#frmEnrollment').powerForm
- submitButton: "#enroll-paypal-btn"
- submitButtonLabel: 'Processing...'
- ajaxSubmit: no
- submitHandler: (form) =>
- console.log "submitHander firing"
- cb.utils.trackAction("/catalog/#{courseURL}/click/pay-now/")
- if not @isFree and not $("#free-container").is(":visible")
- console.log "Non-Free, going through stripe."
- stripe_data =
- number: $('#id_cc').val()
- exp_month: $('#id_expiry_month').val()
- exp_year: $('#id_expiry_year').val()
- Stripe.createToken stripe_data, amount, (response) =>
- console.log 'Stripe response'
- console.log response
- #form.submit()
- else
- console.log "Free, skipping stripe."
- $.blockUI message: "Processing..."
- form.submit()
- onError: ->
- $.unblockUI()
- onResponse: @processEnrollment
- initEvents: ->
Add Comment
Please, Sign In to add comment