Payment

var form = document.getElementById(‘payment-form’);
var ownerInfo = {
owner: {
name: ‘Jenny Rosen’,
address: {
line1: ‘Nollendorfstraße 27’,
city: ‘Berlin’,
postal_code: ‘10777’,
country: ‘DE’,
},
email: ‘jenny.rosen@example.com’
},
};
form.addEventListener(‘submit’, function(event) {
event.preventDefault();

stripe.createSource(card, ownerInfo).then(function(result) {
if (result.error) {
// Inform the user if there was an error
var errorElement = document.getElementById(‘card-errors’);
errorElement.textContent = result.error.message;
} else {
// Send the source to your server
stripeSourceHandler(result.source);
}
});
});