#jack-in-hurst_api
1 messages ยท Page 1 of 1 (latest)
๐ 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/1504624771206352978
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
๐ Do uyou have more details? The request id you shared is a call to the Create PaymentMethod API and is unrelated to the Checkout Session request or the data you are trying to extract so I don't really follow what you mean
Sorry. I am a first time visitor to this site and it is confusing as to how I must do stuff.
No worries, I'm happy to help but I need more specific details about your code
I was told by the AI chat that I could get custom fields added to the Transaction download files if I add metadata to my code:
$checkout_session = $stripe->checkout->sessions->create([
'ui_mode' => 'embedded',
'payment_method_types' => ['card'],
'line_items' =>
[[
'price' => $price->id,
'quantity' => 1,
]],
'metadata' =>['pay_site' => 'Public Company Store',
'invoice_num' => '".$invoice."', ],
'mode' => 'payment',
'return_url' => 'https://www.burlingtonroute.org/company_store_stripe/store/page4_return.php?session_ID={CHECKOUT_SESSION_ID}',
]);
But the "pay_site' and the invoice_number do not show up in the download file.
I have been doing web sites using PHP procedural style for many years, but not OOP php
But the "pay_site' and the invoice_number do not show up in the download file.
what does that mean? what download file? How are you generating it?
Your code is correct but it's adding metadata specifically to the Checkout Session object. This won't go on the PaymentIntent or related Charge. Each object has its own metadata and you have to understand that part so that when you do a report (in the Dashboard or an API) you know where to pull the metadata from.
Does that make sense?
On the Stripe dashboard -> transactions -> download (over on the right side of the screen) is a CSV file that list transactions made for a selected period.
yeah sorry I'm a developer too so I never touch reports or the Dashboard. I don't really know what that report does or what information it pulls
There's a UI I think to ask it for a lot more columns including all metadata
But my gut is still what I said above: you added the metadata in the wrong place so it never shows.
Try to change the code to ```
$checkout_session = $stripe->checkout->sessions->create([
'ui_mode' => 'embedded',
'payment_method_types' => ['card'],
'line_items' => [
[
'price' => $price->id,
'quantity' => 1,
],
],
'payment_intent_data' => [
'metadata' =>[
'pay_site' => 'Public Company Store',
'invoice_num' => '".$invoice."',
],
],
'mode' => 'payment',
'return_url' => 'https://www.burlingtonroute.org/company_store_stripe/store/page4_return.php?session_ID={CHECKOUT_SESSION_ID}',
]);
Okay, I will give that a try. Thanks! Bye.
sure thing!