#dieselwurks_webhooks

1 messages ¡ Page 1 of 1 (latest)

sharp yachtBOT
#

👋 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/1432804962571780198

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

haughty relic
true vortex
haughty relic
#

Argh. Can't stripe please enhance this by adding a filter? Would be so nice to get a list of sessions with PIs or sessions with prices or sessions with products rather than having to iterate over all of them.

#

Wait, that's what you said! hahaha.

#

Works for PIs but not for products or prices.

#

I'll try that!

true vortex
#

Correct

haughty relic
#

Still, sessions with prices or sessions with products is something I have to do all of the time by iterating.

true vortex
haughty relic
#

No I mean "given a price, give me all of the sessions that bought it"

true vortex
#

Ah I see. Unfortunately, that's not something we support today.

Generally, users store relevant Product/Price <> Checkout Session IDs in their own database

#

when they create Checkout Sessions using the API

#

I see you're using Payment Links so that won't work unfortunately

haughty relic
#

Yes, because I can offload work onto people who click. I code.

#

Can you help with PHP? This doesn't work 57 $cs = \Stripe\Checkout\Session::retrieve([ 58 'payment_intent' => $pi, 59 ]);

#

391950 28/Oct 13:03 php Error Stripe\Exception\UnexpectedValueException: Could not determine which URL to request: Stripe\Checkout\Session instance has invalid ID: in Stripe\ApiResource::resourceUrl() (line 107 of /var/lib/drupal/vendor/stripe/stripe-php/lib/ApiResource.php).

true vortex
#

You're using the wrong endpoint I think

haughty relic
#

Yes, I see that from the documentation but it says that I can provide payment_intent as a parameter but that doesn't work. Hang on...

true vortex
#

It might look a bit different for the syntax you're using (without Stripe Client)

haughty relic
#

The syntax I gave didn't work but this got me the session. I can't figure out how to get the custom_fields.

true vortex
#

It should be an array.. What do you see under custom_fields parameter?

haughty relic
#

Yes, I have them now. I needed to do $cf = $cs['data'][0]->custom_fields; to get them

true vortex
#

Great!

haughty relic
#

kthx muchly!