#Parth R. Jangid (Pseudo Bugs)
1 messages · Page 1 of 1 (latest)
Hi there 👋 the status_code that you're referring to, since the value is a 200, seems like it probably maps to the status code of the actual request rather than the Payment Intent object. Can you help me understand where you're pulling status from?
Looking at the contents of the call to create a Payment Intent, there does not seem to be enough information for a payment to immediately be attempted, so the Payment Intent ending up in a state of requires_payment_method seems expected.
You will need to tell us which Payment Method to use for the payment, we won't assume that.
So I am looking at the status field in the Stripe logs under the Response body and it is as follows:
"status": "succeeded"
But when I initially create a payment Intent and I am saving it in my database (right after creating the intent I am saving it), then that stored document has "status": "status
"requires_payment_method".
So I am using card payment do I need to pass it explicitly?
I'm guessing the log line you're referring to is one that belongs to a request that was made to confirm a Payment Intent.
What are you trying to accomplish, processing a payment for a previously created Payment Method?
Yes the log with "status": "succeeded" is what after I submit the payment using the handler.
I simply want to make one time payment.
In that case you likely want to allow our UIs to collect payment method details, you likely won't provide them.
Earlier when you asked:
So I am using card payment do I need to pass it explicitly?
What are you asking if you need to pass?
So I am making an iOS project and using the stripe iOS sdk. In that I am using STPPaymentCardTextField to input card details from user. So I just want to ask that when I am creating the paymentIntent do I include payment_method parameter or without that it will work? Because once I create the paymentIntent and I print it, then the log has status: required_payment_method
But when I confirm the payment using the STPPaymentHandler then in the Stripe logs the Response Body has status: succeeded.
I am just getting confused on whether the code is correct and the payment request is successful or do I have to pass the payment_method or payment_method_types?
That is the expected lifecycle for an intent. If you don't have a Payment Method set up initially, then you create the Intent without associating it to a Payment Method, so the intent ends up in a requires_payment_method state. When you confirm the Payment Intent, the payment method details are collected from the UI, a Payment Method is created, and it is used to attempt paying for the intent.
https://stripe.com/docs/payments/intents
We have a guide available here that walks through the necessary steps for an iOS application that you can reference:
https://stripe.com/docs/payments/accept-a-payment?platform=ios&ui=payment-sheet
Thanks a ton!