close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Stripe Integration with eCart

Thread began 1/15/2019 1:22 pm by eric284736 | Last modified 2/06/2019 11:12 am by eric284736 | 1250 views | 11 replies

eric284736

Here is the whole section of code


<script type="text/javascript">
// this identifies your website in the createToken call below
Stripe.setPublishableKey('pk_live_***********************************');
function stripeResponseHandler(status, response) {
if (response.error) {
// re-enable the submit button
$('#Payment_submit').removeAttr("disabled");
// show the errors on the form
$(".payment-errors").html(response.error.message);
} else {
var form$ = $("#Payment_NewFromBlank_Default");
// token contains id, last4, and card type
var token = response['id'];
// insert the token into the form so it gets submitted to the server

form$.append("<input type='hidden' name='stripeToken' value='" + token + "' />");
// and submit
form$.get(0).submit();
}
}
$(document).ready(function() {
$("#Payment_NewFromBlank_Default").submit(function(event) {
document.MM_returnValue = false;
// disable the submit button to prevent repeated clicks
$('#Payment_submit').attr("disabled", "disabled");
// createToken returns immediately - the supplied callback submits the form if there are no errors
Stripe.createToken({
number: $('#Card_Number').val(),
cvc: $('#Card_CVV').val(),
exp_month: $('#Card_Exp_Month').val(),
exp_year: $('#Card_Exp_Year').val(),
address_line1: $('#Address_1').val(),
address_city: $('#City').val(),
address_state: $('#State').val(),
address_zip: $('#Country').val(),
address_country: $('#Postal_Code').val(),
name: $('#Last_Name, #First_Name').val() + " - reunion-donation"
}, stripeResponseHandler);
return false; // submit from callback
});
});
</script>

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...