Tilføj et betalingskort

stripe.createPaymentMethod('card', card, { billing_details: { name: fullName, phone: phone, email: email, address: { country: country, city: city, line1: address, } } }).then(function (result) { // Handle result.error or result.paymentMethod if (typeof result.paymentMethod !== "undefined") { var successElement = document.getElementById("success-block"); successElement.innerHTML += 'Success! Payment method ID: ' + result.paymentMethod.id; } if (typeof result.error !== "undefined") { var errorElement = document.getElementById("error-block"); errorElement.innerHTML += 'Success! Payment method id:' + result.error.message; } });
Scroll til toppen