#bilalameen - retrieve payment

1 messages · Page 1 of 1 (latest)

elder isle
final hawk
#

but this is for payment retrieve, I want to just confirm by the id

#

I can see the payment in the dashboard > payments

elder isle
#

"I want to find payment using the payment id"

#

I thought that meant retrieve

#

To confirm

final hawk
#

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

elder isle
#

At what point do you want to save the ID?

#

Only on successful payment?

final hawk
#

Yes

elder isle
#

Listen for events on your Stripe account so your integration can automatically trigger reactions.

final hawk
#

Okay, I will study this

#

Can you please also check the code, is this the correct way to achieve this?

#

Thanks Alot

grizzled zenith
#

First off, both screenshots had your test mode secret key in it so I've deleted them- I'd recommend rolling that key immediately

final hawk
#

Complete

#

Okay, Thanks you for that

#

Please wait for a moment

grizzled zenith
#

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

final hawk
#

You There?

grizzled zenith
#

Yes, but you didn't answer my question yet

final hawk
#

Yes exactly but I want to know for that moment the code is correct

#

Regarding Customer and payment

grizzled zenith
#

Is there a particular reason you're creating payment methods directly on your server and not creating them client-side?

final hawk
#

Because of the apple app store payment restriction

grizzled zenith
#

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

final hawk
#

We upload the app to the Apple App Store they reject it and said we can not use the third party payment intregration

grizzled zenith
#

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?

final hawk
grizzled zenith
#

S do you have everything implemented on your end to be able to be PCI compliant?

final hawk
#

I am working on it

#

almost

#

You there?

grizzled zenith
#

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?

final hawk
#

Yes I checked

#

Could you please share what you regards

#

It shows the payment in the dashboard

grizzled zenith
#

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

final hawk
#

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

grizzled zenith
#

Change mastercard to be card

final hawk
#

Thanks

#

And for card brand?

#

How to add it?