#likhith_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/1276386904375300117
đ 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.
- likhith_code, 14 hours ago, 59 messages
Hmm, looks like you want to use Checkout Sessions API, but why you call PaymentIntents API in your code?
sorry it should be checkout
And where do you want to set the metadata to? the paymentIntet object or subscription object that the checkout session creates? or on the checkout session object itself?
paymentIntet object that checkout creates so that i can capture them for further process in webhook
Ok, you can set it through https://docs.stripe.com/api/checkout/sessions/create?lang=curl#create_checkout_session-payment_intent_data-metadata
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
is this code correct
session = stripe.checkout.Session.create(
payment_method_types=['card'],
client_reference_id=transaction_id,
line_items=[{
'price_data': {
'currency': currency,
'product_data': {
'name': 'Student Package',
'metadata': {
'package_name': student_packages.package.name,
'transaction_id': transaction_id
},
},
'unit_amount': actual_amount,
},
'quantity': 1,
}],
mode='payment',
success_url=STUDENT_PACKAGE_CALLBACK_URL,
cancel_url=STUDENT_PACKAGE_CALLBACK_URL,
)
No, the metadata should be set in payment_intent_data hash
is this the right way
session = stripe.checkout.Session.create(
payment_method_types=['card'],
client_reference_id=transaction_id,
line_items=[{
'price_data': {
'currency': currency,
'product_data': {
'name': 'Student Package',
},
'unit_amount': actual_amount,
},
'quantity': 1,
}],
payment_intent_data={
'metadata': {
'package_name': student_packages.package.name,
'transaction_id': transaction_id
}
},
mode='payment',
success_url=STUDENT_PACKAGE_CALLBACK_URL,
cancel_url=STUDENT_PACKAGE_CALLBACK_URL,
)
Yes you are right
see i called this webhook https://webhook.cool/at/narrow-autumn-19/nLebxd4OvA2J6R_MamHFSQvdEI71NBDA
here i am not getting any info related to payment
What's the event ID?
cs_test_a1xU2UzrYqHmaL87uOtUoF8WID5ph7VQx1qxystFQAUmNLCmkMZewt7uW7
I mean the payment_intent.succeeded event that you are listening to.
https://dashboard.stripe.com/test/events/evt_3PqpLbA1npjrCKK11umTDYyl Anyway I found the event, and I saw the metadata
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
So instead of cli can't i hear the webhook through sites which offer webhook
I don't understand your question. An event can be listened as long as your Webhook endpoint subscribes to the event type. For example, listening to payment_intent.succeeded event for the metadata on the Payment Intent
like the above site link i have provided https://webhook.cool/at/narrow-autumn-19/nLebxd4OvA2J6R_MamHFSQvdEI71NBDA i am using external webhook link to listen to the payment object which it passes after completion of payment in the web
I don't see this endpoint being registered in https://dashboard.stripe.com/test/webhooks
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Only when the endpoint is registered with Stripe, then Stripe will send the events
so does this end point need to be registered in dashboard, that if i am listening to an event in local webhook url i need to specify same local url in the dashboard too