#jackey_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/1486600804268769351
π 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.
- jackey_api, 21 hours ago, 7 messages
- jackey_api, 5 days ago, 5 messages
hello How can I query the detailed payment information through Stripe when I use Link for payment? For example, what product was purchased?
Could I check if the payment for the product was made through invoice?
Do you have a Payment Intent that i can reference? (pi_xxx)
Response Body:
{
"id": "pi_3TF4i3IOF8YBxcsf06gYXzme",
"object": "payment_intent",
"amount": 2990,
"amount_capturable": 0,
"amount_details": {
"tip": {}
},
"amount_received": 2990,
"application": null,
"application_fee_amount": null,
"automatic_payment_methods": null,
"canceled_at": null,
"cancellation_reason": null,
"capture_method": "automatic_async",
"client_secret": null,
"confirmation_method": "automatic",
"created": 1774496151,
"currency": "hkd",
"customer": null,
"customer_account": null,
"description": null,
"excluded_payment_method_types": null,
"invoice": null,
"last_payment_error": null,
"latest_charge": "py_3TF4i3IOF8YBxcsf0juw5IiZ",
"livemode": false,
"metadata": {},
"next_action": null,
"on_behalf_of": null,
"payment_method": "pm_1TF4i2IOF8YBxcsfbCWpmHFF",
"payment_method_configuration_details": null,
"payment_method_options": {
"link": {
"persistent_token": null
}
},
"payment_method_types": [
"link"
],
"processing": null,
"receipt_email": null,
"review": null,
"setup_future_usage": null,
"shipping": null,
"source": null,
"statement_descriptor": null,
"statement_descriptor_suffix": null,
"status": "succeeded",
"transfer_data": null,
"transfer_group": null
}
It was not completed through the invoice.
Hello @onyx mason, we have sent you a direct message, please check it at https://discord.com/channels/@me/1479386423399288966
- π The message has instructions on how to grant read and write access to your Stripe Dashboard for our Developer Support team, in order to help you more effectively.
Could I also get access to your Dashboard?
Thanks for the wait!
Different interfaces would have different ways of getting the product details. If you are using Payment Links, you would be able to get the Price/Product data by Retrieving the line items via the Retrieve a payment link's line items API call : https://docs.stripe.com/api/payment-link/retrieve-line-items
So once the payment has been successfully processed, the webhook event checkout.session.completedwill be emitted with the payment link ID as one of the fields > After which you can use the payment-link/retrieve-line-items API to fetch the line items which consist of the product ID
Can the link ID be obtained only through webhook? Can it be obtained from the response parameters of the paymen_intent object or the Charge object?
If you wish to map the Payment Link from the payment_intent, you would have to go through a couple of API calls:
- Get the Checkout Session from the Payment intent (field: payment_details.order_reference)
- Call Get Checkout Session API with the CS ID from step 1 (field: payment_link)
- Then fetch the line items using Retrieve a payment link's line items API with the plink ID from step 2
If through the webhook event:
- Get the plink ID from
checkout.session.completedevent - Then fetch the line items using Retrieve a payment link's line items API with the plink ID from step 1
Response Body:
{
"id": "pi_3TF4i3IOF8YBxcsf06gYXzme",
"object": "payment_intent",
"amount": 2990,
"amount_capturable": 0,
"amount_details": {
"tip": {}
},
"amount_received": 2990,
"application": null,
"application_fee_amount": null,
"automatic_payment_methods": null,
"canceled_at": null,
"cancellation_reason": null,
"capture_method": "automatic_async",
"client_secret": null,
"confirmation_method": "automatic",
"created": 1774496151,
"currency": "hkd",
"customer": null,
"customer_account": null,
"description": null,
"excluded_payment_method_types": null,
"invoice": null,
"last_payment_error": null,
"latest_charge": "py_3TF4i3IOF8YBxcsf0juw5IiZ",
"livemode": false,
"metadata": {},
"next_action": null,
"on_behalf_of": null,
"payment_method": "pm_1TF4i2IOF8YBxcsfbCWpmHFF",
"payment_method_configuration_details": null,
"payment_method_options": {
"link": {
"persistent_token": null
}
},
"payment_method_types": [
"link"
],
"processing": null,
"receipt_email": null,
"review": null,
"setup_future_usage": null,
"shipping": null,
"source": null,
"statement_descriptor": null,
"statement_descriptor_suffix": null,
"status": "succeeded",
"transfer_data": null,
"transfer_group": null
}
But why is the 'payment_details.order_reference' field that you mentioned not present in my 'payment_intent' object?
Could you try expanding the payment_details field? expand: ['payment_details']
Just to be clear, I wouldnt recommend the mapping the method mentioned here.
The reccommended way would be this, in which case, your payment pi_3TF4i3IOF8YBxcsf06gYXzme led to the creation of the event evt_1TF4i6IOF8YBxcsfpuFKfJWH
As mentioned by our docs here: https://docs.stripe.com/payment-links/url-parameters#track-payments-with-the-api
What's the problem? Why is there no such field? I've noticed that it seems to happen sometimes.
Apologies, that was not a good recommendation at all, it is true that it does not show up all the time or that it might take some time to do so.
If you wish not to do it via the webhooks way, then you could also try to include the Product ID as metadata when creating the payment link, but this would mean creating the payment link via the API
{
"id": "pi_3TEKv8IN4sEY4YJa01NyayaY",
"object": "payment_intent",
"amount": 2000,
"amount_capturable": 0,
"amount_details": {
"shipping": {
"amount": 0,
"from_postal_code": null,
"to_postal_code": null
},
"tax": {
"total_tax_amount": 0
},
"tip": {}
},
"amount_received": 2000,
"application": null,
"application_fee_amount": null,
"automatic_payment_methods": null,
"canceled_at": null,
"cancellation_reason": null,
"capture_method": "automatic_async",
"client_secret": "pi_3TEKv8IN4sEY4YJa01NyayaY_secret_v9xRpkagGJFsNzGHcQCIFSZ34",
"confirmation_method": "automatic",
"created": 1774320138,
"currency": "hkd",
"customer": null,
"customer_account": null,
"description": null,
"excluded_payment_method_types": null,
"invoice": null,
"last_payment_error": null,
"latest_charge": "py_3TEKv8IN4sEY4YJa09b5ugY2",
"livemode": false,
"metadata": {},
"next_action": null,
"on_behalf_of": null,
"payment_details": {
"customer_reference": null,
"order_reference": "cs_test_a1592cbuZePy8PjuCohikUacJyQzDb8KZKDfgQVHOyUs1lepE4JzofDmfi"
},
"payment_method": "pm_1TEKv7IN4sEY4YJaR7wYWIac",
"payment_method_configuration_details": null,
"payment_method_options": {
"link": {
"persistent_token": null
}
},
"payment_method_types": [
"link"
],
"processing": null,
"receipt_email": null,
"review": null,
"setup_future_usage": null,
"shipping": null,
"source": null,
"statement_descriptor": null,
"statement_descriptor_suffix": null,
"status": "succeeded",
"transfer_data": null,
"transfer_group": null
}
This is the test environment that can display
Is it the case that the sandbox environment cannot display?
hmm, i would need more time to dig into this. If you would like, we can carry on over email to figure out the exact reason why it shows for the last PI you sent compared to the first PI
If not, what i would suggest is the webhook approach as it is the recommended way listed in our docs, a fallback approach would be to try using the metadata in the Payment Link as seen here
You can communicate via email.
ok!
Hello @onyx mason, we have sent you a direct message, please check it at https://discord.com/channels/@me/1479386423399288966
- πThe message has instructions on how to open a direct support case with our Developer Support team, in order to help you more effectively.
I have sent you a DM to communicate over mail, we can take it from there