#alliance-paymentintent-react
1 messages ยท Page 1 of 1 (latest)
Hi ๐ it seems like the Payment Intent you're working with is not in a state where it requires action that would be handled by handleCardAction.
Can you confirm whether the Payment Intent you're trying to use has a status of requires_action?
https://stripe.com/docs/api/payment_intents/object#payment_intent_object-status
Yes
Icreated the susbcription in BackEnd then I sent it to the frontEnd, then when when status = "requires_action" I call the previous request with the client_secret that I found in my payment_intent
Can you share the ID of a Payment Intent that you were using for testing?
id
:
"in_1MTnVlGfA2lQACd1SZ9pfhaK"
Sorry, got my threads mixed up, ignore the above (I'm deleting it as well).
Yeah, the Payment Intent there seems to be in a requires_action state. Have you logged the client_secret that your frontend is receiving to ensure it matches the client_secret of this intent?
How can I log the client_secret please?
Because After the front receiving it I make this call
this.props.stripe .handleCardAction('{PAYMENT_INTENT_CLIENT_SECRET}').then(function(result) {
console.log(result);
});
So now im not sure if it is a ReactJs issue or a Stripe issue
It looks like you have a log line that you can use a reference: console.log(result);
I would suggest adding a similar line before this.props.stripe.handleCardAction, and log out whatever variable you're using to hold the client secret of your payment intent.
Yes I alrady did it and the value is correct. It show me this:
pi_3MTnVlGfA2lQACd10HiM42j7_secret_DldCfXzO9Iox4e4iqVx2Rsxqb
here is the error message when I call handleCardAction
IntegrationError: handleCardAction: The PaymentIntent supplied does not require manual server-side confirmation. Please use confirmCardPayment instead to complete the payment.
Hm, does using confirmCardPayment as the error suggests resolve the behavior you're encountering?
it works!!
you re verry smart!
I have status = "succeeded"
so what is the next step please?
is my subscription valid now?
What do you mean by valid? Are you referring to whether the Subscription moved to an active status?
https://stripe.com/docs/api/subscriptions/object#subscription_object-status
What do you see when you retrieve the associated Subscription now?
When you ask what the next steps are, what are you referring to or what is next in your process that you're trying to accomplish?
I mean the status of my paymentIntent
is succeeded.
Im working with 3DS payment in suscription. I would like to know if there is another step to validate my subscription or its ok.
Here is my last subscription:
"sub_1MTokOGfA2lQACd1H45eOwYn"
Hello ๐
Give me a moment to take a look
Hello ๐
The subscription ID you've shared seems to be active
so you're all set
Cool.
Now I have another case, its when the subscription required a free trial and the user subscribe with 3DS card
The backend send me the seti_1Eu...
I have to create a setupIntent in my front End?
You can use the pending_setup_intent from Subscription object to render elements client-side and collect the payment method
I see!
But what is the function please?
function for what?
im in frontEnd and I have the pending_setup_intent .
I need the JS function that I have to use to render elements client-side and collect the payment method
Ah, I see. Let me check if we have any examples for this in React
It should be identical to how you handle PaymentIntent really.
We have a guide here that walks you through how you can handle SetupIntents <> Elements in React
https://stripe.com/docs/payments/save-and-reuse?platform=web#web-collect-payment-details
The only noticeable change would be that you would use confirmSetup function instead of confirmPayment
does that make sense? @pallid cove