#linqisnice_docs
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/1220449220327112808
đ 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.
- linqisnice_docs, 1 hour ago, 8 messages
public async Task<IReadOnlyList<Product>> CreateProducts(Dictionary<string, decimal> products, CurrencyCode currency)
{
var createdProducts = new List<Product>();
var service = new ProductService();
foreach (var product in products)
{
createdProducts.Add(await service.CreateAsync(new ProductCreateOptions
{
Name = product.Key,
DefaultPriceData = new ProductDefaultPriceDataOptions
{
Currency = currency.ToString(),
UnitAmountDecimal = product.Value
}
}));
}
return createdProducts;
}
public async Task<string> CreatePaymentLink(Dictionary<string, decimal> products, CurrencyCode currency, string connectedAccountId)
{
var createdProducts = await CreateProducts(products, currency);
var options = new PaymentLinkCreateOptions
{
LineItems = createdProducts.Select(x => new PaymentLinkLineItemOptions
{
Price = x.DefaultPriceId
}).ToList()
};
var requestOptions = new RequestOptions
{
StripeAccount = connectedAccountId
};
var service = new PaymentLinkService();
var paymentLink = await service.CreateAsync(options, requestOptions);
return paymentLink.Url;
}
this is the code.
it rejects the id saying ```cs
"message": "No such price: 'price_1Owqx2GPWwmX339cuGvjyelz'",
Can you share the erroring request ID? req_123 for example
The request where you get that error
You can look for erroring requests in your dashboard logs: https://dashboard.stripe.com/test/logs/
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
My guess is that you might be mixing up IDs across different accounts
the request id isnt available in the response here in the .net sdk
That price exists, but I don't see a failing request matching the exampel you shared in that account's logs
is it because the product is not being created for that connect probably?
do i need to specify for whom the product is created?
all im doing is creating a product and immediately using that products priceid to create a link
for a specified connect customer
In the result of your method call, can you inspect StripeResponse? It should have the request id
Ok, yep, this is a conenct context mix up
so how do i create products for the dconnect account? so i can allow the connect account to issue a payment link
thats what im trying to achieve
we have connected merchants -> we want them to be able to send a payment link with minimal effort
The product/price exists on your platform, created here: https://dashboard.stripe.com/test/logs/req_mQCH4JRfU7zWrE
You're trying to create a payment link on a connected account
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
You need to have that product/price also created on the that connected account (using the stripe-account header/option), or create the payment link on your platform
In that case it sounds like you want to create the product/price on the conencted account too
yes, but how? with the .net sdk i cant see that there is a stripeaccount field for ProductDefaultPriceDataOptions
Its at the request level overall
meaning?
var options = new RequestOptions
{
StripeAccount = "acct_123"
};
The same way you're doing it for the payment link
you would do when creating the price/product
NP
now im getting a different issue, Stripe.StripeException: 'Missing required param: line_items[0][
Can you share the request ID again?
That's a different error than you mentioned:
code: "amount_too_small",
doc_url: "https://stripe.com/docs/error-codes/amount-too-small",
message: "The Checkout Session's total amount due must add up to at least 3.00 kr sek",
https://dashboard.stripe.com/test/logs/req_Zypidir6QbIv9m
ahhh!