#asim_1
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
The card details aren't on the actual Setup Intent, but instead the Payment Method (pm_xxx) generated by the Setup Intent
In Android, if I retrieve the setup intent, the payment method is empty (null)
That would imply that it is in a non-success state (i.e. requires confirmation). What's the seti_xxx ID?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
seti_1OZVDCC0wiqTfzk5GnlVU0O0_secret_POHmFMxXblDtMgzCtQup3KP3DbH3gTI
Yep, see status: 'requires_payment_method'. You're missing this step: https://stripe.com/docs/payments/save-and-reuse?platform=android&ui=payment-sheet#collect-payment-details
You mean I'm not displaying a payment sheet?
Because I am. And I select a card on it.
That seti_xxx would suggest otherwise. What code are you calling specifically to present the Payment Sheet?
Hey! Taking over for my colleague. Let me catch up.
Alright.
I'm not seeing any completion request on the SetupIntent
No retrieve is for getting the SetupIntent details
You mean create a charge using the setup intent?
Charging part works fine, tested it. But when I create the intent, it should show me what card the user chose right?
After you present the payment sheet presentPaymentSheet
and complete putting the card details and submit
do your success callback being called? onPaymentSheetResult ?
This steps seems to display the result of the card yes
Even paymentMethodId is coming properly. Just the payment method object itself is null.
its supposed to yes.
What is the content of paymentSheetResult ?
Can you debug your integration and share with me the values ?
OK thanks this is your code,
now let's debug it and inspect the value of paymentSheetResult at runtime
You need to debug the content of paymentSheetResult
seti_1OZVe3C0wiqTfzk55WayN8T5_secret_POIEOonZpQuXfDV6zYysdP6nvnxDvSt
Coll now this SetupIntent is succeeded
And now you have a PaymentMethod attached to it pm_1OZI0DC0wiqTfzk5YYBfKFbw
Now if you fetch the payment_method's card object, you'll see all the field you are looking for
You are missing an expand probably in that case
Or you are fetching the wrong payment_method id
can you share the API request you are doing ?
its a private API. You want to see its response?
What you mean by private API ?
How are you retrieving the payment method details ?
What Stripe API call you are making ?
Within my android app, in the onSuccess method.
Its part of the stripe android library
OK you aer using the public key in that case to retrieve the the payment methd details
You should have just the id of the payment method I think using that method
when debugging paymentMethod what is it's content ?
paymentMethod is null.
paymentMethidId has a value.
Yes that's explain it so.
You need to make a call from you backend
You'll get all the details
and then return it to your Mobile App
won't this return ALL payment methods?
so I need to search for the payment method ID from the setup intent and compare it to the list returned by the above API?
No, it will return only the PaymentMethod Id
That method doesn't make a Stripe API call
Let me clarify.
However I think there is an option by expanding the payment_method
when retrieving the setp_intent
My setup intent has an attached paymentMethodId (the one the user chose). I want the last4 for that payment method.
So my backend should retrieve all the payment methods for the user and then compare the paymentMethodId from my setup intent to the list of PMs from the customer to find the relevant payment method?
So my backend should retrieve all the payment methods for the user and then compare the paymentMethodId from my setup intent to the list of PMs from the customer to find the relevant payment method?
No, you have the PaymentMethod ID after completing the SetupIntent (when you saidpaymentMethidId has a value.), you make a single API call from your backend in order to fetch the details of that payment method and return it to your mobile app
Here is the API call, it retrieve the payment method details by Id:
https://stripe.com/docs/api/payment_methods/retrieve