#m2.0
1 messages ยท Page 1 of 1 (latest)
Hello ๐
My PHP skills aren't great but let me take a look!
payment_method on a PaymentIntent is an expandable property
so you would need to expand it when you retrieve the PaymentIntent
https://stripe.com/docs/api/expanding_objects?lang=php
OR retrieve the PaymentMethod separately by calling the API
'pm_xxx',
[]
);```
When I do '$payment_intent->payment_method' , I get "pm_xxxxxxxxx"
however when I do '$payment_intent->payment_method->card->brand' I get an indication that "card" and "brand" are not objects.
You can't directly access the payment_method as an object.
You may need to change your creation code to something like
$payment_intent = \Stripe\PaymentIntent::create([
'amount' => $amount,
'currency' => 'eur',
'payment_method' => $body->pmType,
...
],['expand' => ['payment_method']);
Let me know if that makes sense @keen dove
Oh I don't know the 'expand' object I'll take a closer look and let you know
Unfortunately it is not possible to recover the mark of the card without as I wish to do.
Thanks anyway Hanzo! ๐
When you say "without", what exactly does that mean? ๐
Not sure if I understood it correctly.
sorry for my english, I just wanted to say that it is not possible to retrieve the brand of the card from the creation of the paymentIntent
Ah gotcha. You can retrieve the PaymentIntent instead (right after creating it).
If that works for your usecase.
Yes I know, but as lazy as I am, I just wanted to avoid doing another fetch request :p
Thanks to you ๐
NP! ๐ Happy to help