#praveendd25
1 messages · Page 1 of 1 (latest)
Hi, if you look at the PaymentMethod used you would see the card last4 https://stripe.com/docs/api/payment_methods/object#payment_method_object-card-last4
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
how do i get this in confirm of payment intent API?
You mean in client side?
yes
when i confirm payment i need to get the payment method details
earlier it was giving in charge api
What would you do with the last4 in frontend? Normally you should only need it on backend
we are calling a api to sendemail after confirmation we need for that
That should be a backend logic, no?
When you receive the payment_intent.succeeded webhook event on backend, that's the perfect timing/place to do any fulfillment logic
the payment confirm is happening in front end right
so we have written code to get the last4digits and send it back to api
is thr any other way to get last 4 digits from elements ?
am not using return url method
i am expecting success within same form
and also paymentintent.latest_charge is returning null in stripe.confrim payment
this.stripe.confirmPayment({
elements,
redirect: "if_required"
}).then(function (result) {
// Handle result.error or result.paymentIntent
if (result.error) {
$("#div_loader").hide();
}
else {we are taking here result.paymentintent.latest_charge it is null here
}