#m2.0

1 messages ยท Page 1 of 1 (latest)

steep valveBOT
warm light
#

Hello ๐Ÿ‘‹
My PHP skills aren't great but let me take a look!

#

payment_method on a PaymentIntent is an expandable property

#

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

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! ๐Ÿ™‚

warm light
#

When you say "without", what exactly does that mean? ๐Ÿ˜…
Not sure if I understood it correctly.

keen dove
#

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

warm light
#

Ah gotcha. You can retrieve the PaymentIntent instead (right after creating it).

#

If that works for your usecase.

keen dove
#

Yes I know, but as lazy as I am, I just wanted to avoid doing another fetch request :p

Thanks to you ๐Ÿ™‚

warm light
#

NP! ๐Ÿ™‚ Happy to help