#jairo094215_api

1 messages ยท Page 1 of 1 (latest)

south badgerBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1440375727319945256

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

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.

digital bridge
#

hi there, can you show me how you're calling the API, along with how you're formatting the expand parameter?

slender matrix
#

I'm using the PHP SDK and my code looks like this:

Stripe\PaymentIntent::retrieve( "[payment_intent_id]", ['expand' => ['latest_charge.balance_transaction']] )

#

And here you have an example requestID: req_nF0by4PKmjO7jP

digital bridge
#

ok, and what does the response look like? unfortunately I can't see responses to GET requests on my side

slender matrix
#

As you can see, the latest_charge prop is a string instead of an object

digital bridge
#

interesting. if you change the expand to just be ['expand' => ['latest_charge']], does that work?

slender matrix
#

I just tried it and it doesn't work either

digital bridge
#

does it work if you use the curl equivalent? like:

curl https://api.stripe.com/v1/payment_intents/pi_3SUrNfDyCiiQ0txV1hMqV4qM \
-u "sk_test_1234:" \
-H "Stripe-Version: 2020-08-27" \
-d "expand[]"=latest_charge.balance_transaction
slender matrix
#

Yes, it does work with curl!

#

maybe the SDK is the problem?

digital bridge
south badgerBOT
slender matrix
#

Fixed

#

The right way is:

Stripe\PaymentIntent::retrieve([
'id' => $paymentIntentId,
expand' => ['latest_charge.balance_transaction'],
])

#

passing all params inside an array

#

instead of (string $id, array $opts)