#ryjin_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/1393151390574055424
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Here's more info.
This is the line that throws an exception
public async Task<Dictionary<string, string>> GetPaymentIntentMetaData(string paymentIntentId, string account)
=> (await new PaymentIntentService().GetAsync(paymentIntentId, requestOptions: new RequestOptions
{
StripeAccount = account
})).Metadata;
I'm getting this:
Unrecognized request URL (GET: /v1/payment_intents/). If you are trying to list objects, remove the trailing slash. If you are trying to retrieve an object, make sure you passed a valid (non-empty) identifier in your code. Please see https://stripe.com/docs or we can help at https://support.stripe.com/.
hi there!
Hello!
Is it possible to see whether it's the account or the paymentintentid that is missing here?
which event are you listening for to retrive the PaymentInent? checkout.session.completed?
correct
and all Checkout Sessions are in mode: "payment"?
This is how I create checkout sessions:
public async Task<string> CreateCheckoutSession(IEnumerable<StripeProduct> products, CurrencyCode currency, string connectedAccountId, string orderId, SupportedLanguages customerLanguage, int? expirationTime)
{
var options = new SessionCreateOptions
{
LineItems = await CreateSessionLineItems(products, currency, connectedAccountId),
UiMode = "embedded",
Mode = "payment",
ReturnUrl = $"{_baseUriProvider.GetBaseUri(BaseUriOptions.Anigma)}/return?session_id={{CHECKOUT_SESSION_ID}}",
PaymentIntentData = new SessionPaymentIntentDataOptions
{
Metadata = new Dictionary<string, string>
{
{
StripeMetadataKeys.OrderId, orderId
},
{
StripeMetadataKeys.Source, "regular_checkout"
},
{
StripeMetadataKeys.CustomerLanguage, customerLanguage.ToString()
}
},
},
Currency = currency.ToString().ToLower(),
ExpiresAt = expirationTime is { } ? DateTime.UtcNow.AddMinutes(expirationTime.Value) : null
};
var requestOptions = new RequestOptions
{
StripeAccount = connectedAccountId
};
var session = new SessionService().Create(options, requestOptions);
return session.ClientSecret;
}
got it. then yes I see mode: "payment". and you are creating the Checkout Session directly on the connected account
There is no other code to create checkout sessions in the entire app as far as I'm aware
do you have a failed API request (req_xxx) when trying to retrieve the PaymentIntent?
sec let me show you the evnts
Don't think I'm logging more than that unfortunately
wait, the Checkout Session you shared has amount_total: 0.
if there's nothing to pay, then as expected there will be no PaymentIntent
Hmm, how can they even get to the checkout session? Stripe doesn't accept anything under a certain amount ,no?
there are three prices in that Checkout Session, all are for 0 SEK.
so on the Checkout page, the user just had to enter their email (no payment method needed).
No-cost orders are supported on newer API versions: https://docs.stripe.com/payments/checkout/no-cost-orders?payment-ui=embedded-form
cs_live_a1PGCxhnjy89vfY9XRkRdPbsJtiwm9gA5UMMiAsYiy4jM6IUBsW8aPEKZr
cs_live_b13tyOUR5e2sk1pD5onbA7H90M3gXlvJK54XTdNDTdZdTVEhhQ8dgZt34l
do these have the same problem?
If you're passing the same zero-amount Price objects, sure
That I have no idea of. I'm trying to see if this is a recurring problem in how I calculate prices
There's no payment due, so we don't create a Payment Intent:
To fulfil no-cost orders, make sure to handle the checkout.session.completed event rather than PaymentIntent events. Completed Checkout Sessions that are free won’t have an associated PaymentIntent.
https://docs.stripe.com/payments/checkout/no-cost-orders?payment-ui=embedded-form#handling-orders
if those 2 also have a total amount of 0 then I guess its business logic in my app
But yes, same issue
so let me just understand, you're saying every item in those checkout sessions were 0?
not just one?
Yep, look for yourself: https://dashboard.stripe.com/logs/req_1HKJNibCUe10UR
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 in those scenarios when the session is completed, payment_intent will always be null. You need to account for that in your code/logic
i.e. don't make the PI retrieval call if it's null
Right yeah, I think I've found the issue in my code, just not entirely sure how the hell it can come out to 0 but I'll see if I can solve it. Thanks a lot
How do I searc hfor eventids?
in the stripe dahsboard
like this one cs_live_b1QE0L5lypRr6pasxfWDMJc1KC7tiwMQEpVjZYwYe9yZGuuBbPK9gaz6XU
That's not an Event ID (evt_xxx). Did you try just putting it in search bar? It may not work as Checkout Sessions are really represented in the Dashboard
sorry session Id i assume?
Yes that's a session ID
Have you tried?
Then as I expected (typo: aren't)
What are you trying to find exactly?
Kind of surprised that doesn't work actually – the zero-amount sessions should be here: https://dashboard.stripe.com/no-cost-orders
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Works for me
no cost orders just redirects me to dashoard. is it cuz i have to be on a specific conneted account?
Well yes if it's created on a connected account like cs_test_b1rxMola5fTx4OP01wTOPUnsOgvjCk1lpXR0N07DZcBlljFcjRoQnd2b2t then you need to be on the Dashboard in the context of that account
Also, checkout.session.completed occurs almost immediately, right? there's not much delay from stripe to my webhook?
Yep, should be ~immediate
still cant get ther.e https://dashboard.stripe.com/connect/accounts/acct_1PRsUyQHwUK2JlBY/no-cost-orders
this redirects me to the dashboard
i just want to see the session id so i can check something