#bilalameen - retrieve payment
1 messages · Page 1 of 1 (latest)
If you're using PaymentIntents: https://stripe.com/docs/api/payment_intents/retrieve
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
but this is for payment retrieve, I want to just confirm by the id
I can see the payment in the dashboard > payments
"I want to find payment using the payment id"
I thought that meant retrieve
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
To confirm
No, I want to save the payment id in the database for the record
I checked the API documentation, but I could not find out the solution
Yes
https://stripe.com/docs/webhooks is recommended. you can listen for this event: https://stripe.com/docs/api/events/types#event_types-payment_intent.succeeded
Okay, I will study this
Can you please also check the code, is this the correct way to achieve this?
Thanks Alot
First off, both screenshots had your test mode secret key in it so I've deleted them- I'd recommend rolling that key immediately
What is that code supposed to be doing? You were speaking about webhook events earlier, and this doesn't look like code that processes webhooks at all
Yes, but you didn't answer my question yet
Yes exactly but I want to know for that moment the code is correct
Regarding Customer and payment
Is there a particular reason you're creating payment methods directly on your server and not creating them client-side?
Because of the apple app store payment restriction
What do you mean by that? For context, we really don't recommend working with raw card numbers server-side unless you're prepared to take on PCI compliance and understand what you're getting into
We upload the app to the Apple App Store they reject it and said we can not use the third party payment intregration
I know apple has in-app purchase restrictions, but you shouldn't use raw card numbers just to get around that - how much do you know about PCI compliance?
I have studied about it on https://stripe.com/guides/pci-compliance
S do you have everything implemented on your end to be able to be PCI compliant?
yup i'm here
In general, I really wouldn't recommend you do this if it's just to get around Apple's purchase restrictions
but moving past that for now, there's other things wrong with your code that I'm seeing - have you tried running it end to end?
Yes I checked
Could you please share what you regards
It shows the payment in the dashboard
Do you mind sharing that payment ID with me here? I'm surprised it works because you're passing in mastercard as a payment method type (which is wrong) and you're also incorrectly passing in the card brand instead of the payment method ID when you confirm the payment
Sure
can you please share the solution
ID: pm_1LNHKgLh2Sj6DMWL8UjQU5Hq
"you're also incorrectly passing in the card brand instead of the payment method ID when you confirm the payment" This is what I was checking.
How can I solve it? Thanks
Change mastercard to be card