'); }); } else if (!transType || transType == 'cc') { $('.processing-errors', theForm).append('
Error submitting card to payment processor, please check your Card Number, Expiry and CVV and try again.
'); } else { $('.processing-errors', theForm).append('
Error submitting bank information to payment processor, please check your bank account numbers and try again.
'); } } } }); } $(form).submit(async function (e) { e.preventDefault(); $('.processing-errors', form).find('.benji-error').remove(); let displayError = document.getElementById('card-errors'); displayError.className = ''; var theForm = $(form); //console.log(theForm[0].checkValidity()) // force the HTML5 browser validation messages to appear if the form is not complete. if (!theForm[0].checkValidity()) { // If the form is invalid, submit it. The form won't actually submit; // this will just cause the browser to display the native HTML5 error messages. theForm[0].reportValidity(); } else { $('.btn-submit', theForm).attr('hidden', true); $('.btn-processing', theForm).attr('hidden', false); try { //console.log('bambora tokenizing') $.ajax({ type: "POST", url: '/portal/surchargeEnabled', data: theForm.serialize(), success: async function (sData) { //console.log(data); //if enabled, display modal let processPayment = false; $("#ctype", theForm).val(sData.ctype); if (sData.surchargeEnabled && sData.surchargeAmount) { let chargeAmount = sData.subTotal; // if (await b_confirm("USD", Number.parseFloat(chargeAmount).toFixed(2), sData.surchargeAmount, sData.total, sData.processor)) { processPayment = true; } else { $('.btn', theForm).attr('disabled', false); //stop spinning //display error //$('.processing-errors').append('
Error submitting card to payment processor, please check your Card Number, Expiry and CVV and try again.
'); $('.btn-submit', theForm).attr('hidden', false); $('.btn-processing', theForm).attr('hidden', true); } // } else { processPayment = true; } if (!processPayment) { $('.btn', theForm).attr('disabled', false); //stop spinning //display error //$('.processing-errors').append('
Error submitting card to payment processor, please check your Card Number, Expiry and CVV and try again.
'); $('.btn-submit', theForm).attr('hidden', false); $('.btn-processing', theForm).attr('hidden', true); } else { const form = theForm[0]; const data = new FormData(form); const transType = data.get('trans_type'); if (!transType || transType == 'cc') { if (customCheckout) { customCheckout.createToken(function (result) { if (result.error) { console.log(result.error.message); //display error } else { //console.log(result.token); // process token using our Payments API $('#tempToken', theForm).val(result.token); //console.log(result); //log('bambora', 'card_request_hosted_tokenization'); submitForm(theForm); } }); } else { // Just in case customCheckout was left undefined console.log('Error: customCheckout is not initialized'); $('.processing-errors', theForm).append(`
${bp.getResource("portal.errorB902")}
`); $('.btn-submit', theForm).attr('hidden', false); $('.btn-processing', theForm).attr('hidden', true); } } else { submitForm(theForm); } } }, error: function (sData) { // console.log(sData); $('.processing-errors', theForm).append(`
${bp.getResource("portal.errorB901")}
`); $('.btn-submit', theForm).attr('hidden', false); $('.btn-processing', theForm).attr('hidden', true); } }); } catch (err) { console.log(err); displayError.className = 'bp-alert bp-alert-danger'; $('.btn', theForm).attr('disabled', false); $('.btn-submit', theForm).attr('hidden', false); $('.btn-processing', theForm).attr('hidden', true); } } }); }); // bpready })();
'); }); } else if (!transType || transType == 'cc') { $('.processing-errors', theForm).append('
Error submitting card to payment processor, please check your Card Number, Expiry and CVV and try again.
'); } else { $('.processing-errors', theForm).append('
Error submitting bank information to payment processor, please check your bank account numbers and try again.
'); } } } }); } $(form).submit(async function (e) { e.preventDefault(); $('.processing-errors', form).find('.benji-error').remove(); let displayError = document.getElementById('card-errors'); displayError.className = ''; var theForm = $(form); //console.log(theForm[0].checkValidity()) // force the HTML5 browser validation messages to appear if the form is not complete. if (!theForm[0].checkValidity()) { // If the form is invalid, submit it. The form won't actually submit; // this will just cause the browser to display the native HTML5 error messages. theForm[0].reportValidity(); } else { $('.btn-submit', theForm).attr('hidden', true); $('.btn-processing', theForm).attr('hidden', false); try { //console.log('bambora tokenizing') $.ajax({ type: "POST", url: '/portal/surchargeEnabled', data: theForm.serialize(), success: async function (sData) { //console.log(data); //if enabled, display modal let processPayment = false; $("#ctype", theForm).val(sData.ctype); if (sData.surchargeEnabled && sData.surchargeAmount) { let chargeAmount = sData.subTotal; // if (await b_confirm("USD", Number.parseFloat(chargeAmount).toFixed(2), sData.surchargeAmount, sData.total, sData.processor)) { processPayment = true; } else { $('.btn', theForm).attr('disabled', false); //stop spinning //display error //$('.processing-errors').append('
Error submitting card to payment processor, please check your Card Number, Expiry and CVV and try again.
'); $('.btn-submit', theForm).attr('hidden', false); $('.btn-processing', theForm).attr('hidden', true); } // } else { processPayment = true; } if (!processPayment) { $('.btn', theForm).attr('disabled', false); //stop spinning //display error //$('.processing-errors').append('
Error submitting card to payment processor, please check your Card Number, Expiry and CVV and try again.
'); $('.btn-submit', theForm).attr('hidden', false); $('.btn-processing', theForm).attr('hidden', true); } else { const form = theForm[0]; const data = new FormData(form); const transType = data.get('trans_type'); if (!transType || transType == 'cc') { if (customCheckout) { customCheckout.createToken(function (result) { if (result.error) { console.log(result.error.message); //display error } else { //console.log(result.token); // process token using our Payments API $('#tempToken', theForm).val(result.token); //console.log(result); //log('bambora', 'card_request_hosted_tokenization'); submitForm(theForm); } }); } else { // Just in case customCheckout was left undefined console.log('Error: customCheckout is not initialized'); $('.processing-errors', theForm).append(`
${bp.getResource("portal.errorB902")}
`); $('.btn-submit', theForm).attr('hidden', false); $('.btn-processing', theForm).attr('hidden', true); } } else { submitForm(theForm); } } }, error: function (sData) { // console.log(sData); $('.processing-errors', theForm).append(`
${bp.getResource("portal.errorB901")}
`); $('.btn-submit', theForm).attr('hidden', false); $('.btn-processing', theForm).attr('hidden', true); } }); } catch (err) { console.log(err); displayError.className = 'bp-alert bp-alert-danger'; $('.btn', theForm).attr('disabled', false); $('.btn-submit', theForm).attr('hidden', false); $('.btn-processing', theForm).attr('hidden', true); } } }); }); // bpready })();
By using this service, you consent to be bound by Benji Pay’s Terms of Service and Privacy Policy.
Do not refresh this page, click the back button or leave the page while your transaction is processing or you may be charged more than once.