#naveedfaraz_57185
1 messages · Page 1 of 1 (latest)
Hi, let me help you with this.
No, invoice_settings.default_payment_method is not used for PaymentIntents.
You need to set payment_method parameter manually.
then how do i create a payment without sending in payment method, as i would not know the saved cards in the stripe
You can create the PaymentIntent and then use the client_secret to collect the payment method details on the frontend. I don't know how NetSuite works, but otherwise this is the canonical flow: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements
But again, I don't know if NetSuite follows the same flow
could you please let me know how to use this through postman.
nothing is happening on the frontend, its all backend, so first i am trying through postman
You can click on curl tab to see the raw request examples.
getting this error when i am trying to confirm the payment intent
eventhough i have set this "automatic_payment_methods[enabled]"=true
Ok, let's take a step back. What are you trying to achieve?
sure, we are using stripe only for card payments, right now i am in test stripe account. we are going to integration our NetSuite application to connect to Stripe to create payments for customers. In order to do this i am trying the connect first in Postman. Customers are already there and cards are saved on there stripe accounts. Now i am trying to create a paymentintent with the default card through postman
this is creating a paymentintent but getting the reponse as "requires_payment_method"
but we would not know the payment method and would like to use the default card.
You need to set the payment_method property. Are you providing the Customer object to the PaymentIntent?
yes i am sending the customer id
If you see the above screenshot, there is already a card saved on this customer
Could you please paste here the customer object ID?
cus_Oin4QY8QVWHqgF
You can list the Customer's Payment Methods first and use the pm_xxx in the PaymentIntent: https://stripe.com/docs/api/payment_methods/customer_list
i tried this but this is not giving me the default card details if there are multiple cards.
i am getting all of the card details in the response, but how do we identify which one is default one.
I see for this Customer there's a invoice_settings.default_payment_method property set, that's the default Payment Method: https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method
So you don't even need to list the Payment Methods.
Just fetch the Customer object: https://stripe.com/docs/api/customers/retrieve
Ok, i tried fetching the customer object for few its giving me default source as the correct card but for this customer "cus_Oin4QY8QVWHqgF" i am getting both default source and default payment.
But on the stripe record there is only one card as default
and one extra card
Sources is a legacy concept. Please use the default_payment_method
Ok then for many i am not getting the default payment method, for example see this customer "cus_OnHrye0aGDfYXh"
there is a default card for this one.
For those you can use the default_source. But if default_payment_method is present it will be marked as Default in the Dashboard.
What's the issue/question?
if you read the latest msg in the thread, i am trying to get the default payment method of a customer using postman by connecting to the API
there is no front end, i am trying to first set it through postman
Then as my colleague explained, you'd use the GET /v1/customers/:id endpoint and look at the invoice_settings[default_payment_method] field
If that is null, then there is no default payment method
how do we create a paymentintent and confirm without specifiying a payment method ?