#Aruljothi - apple pay
1 messages · Page 1 of 1 (latest)
okay
i referd this url https://stripe.com/docs/stripe-js/elements/payment-request-button - and create a applepay to the website page. i need name and emailaddress validation on my form validation before they processing to applepay
if i am click apple pay button check form fields are filled and go to payment.
paymentRequest = stripe.paymentRequest({ country: 'US', currency: 'gbp', total: { label: 'Dhyanfoundation Donation', amount: amountval, }, requestPayerName: true, requestPayerEmail: true, });
var elements = stripe.elements();
var prButton = elements.create('paymentRequestButton', { paymentRequest: paymentRequest, });
// Check the availability of the Payment Request API first.
paymentRequest.canMakePayment().then(function(result) {
if (result) {
prButton.mount('#payment-request-button');
} else {
document.getElementById('payment-request-button').style.display = 'block';
}
});
paymentRequest.on('paymentmethod', function(ev) {
// Confirm the PaymentIntent without handling potential next actions (yet).
var customer_fname = document.getElementById("firstname").value;
var customer_lname = document.getElementById("lastname").value;
var emailaddress = document.getElementById("emailaddress").value;
var customer_name = customer_fname+" "+customer_lname;
}
ia m added like above
you would need to code the validation on your own, there should be resources available online for you to refer to on how to implement this