#yoni_best-practices
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/1395737986749960212
๐ 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.
- yoni_webhooks, 2 days ago, 48 messages
the thing is that payment links need a price object to be created, which we don't have
yes, I know that one
but from what I understand, it creates a dummy product/price behind the screens
we are creating a stripe URL via an internal API that is called via our end-user billing platform
(thus in a connect account)
I'm not sure I understand what you mean
we are creating a stripe URL via an internal API that is called via our end-user billing platform
sorry, well, we have two scenarios to receive payments for the energy suppliers (our customers) customers';
- Via the invoice PDF using a QR code (this is a shortened URL which redirects to the stripe checkout sessions page, where verything is prepopulated)
- Via our enduser portal, with a button TOP-UP (which should also redirect the user to a stripe checkout page, but the user should be able to change the amount he wants to pay)
We're a SAAS platform and thus have a platform account and our users have a connect account
We are creating checkout sessions via the connect account for scenario one, we now want to implement scenario two
in that case you don't need PaymentLinks you can use Checkout Sessions that you create https://docs.stripe.com/payments/checkout/pay-what-you-want and redirect to
OK but we'd still need a price ID then or not?
yes correct
hmm
how would I handle this best then, for each stripe connect account set up a dummy price ?
what type of charges are you processing? Direct or Destination Charges?
var options = new SessionCreateOptions
{
LineItems = new List<SessionLineItemOptions>
{
new SessionLineItemOptions
{
PriceData = new SessionLineItemPriceDataOptions
{
ProductData = new SessionLineItemPriceDataProductDataOptions()
{
Name = "Manual payment", //TODO!
Description = paymentReference
},
Currency = currency.ToLower(),
UnitAmountDecimal = Math.Round(amount*100), // Stripe expects the amount to be in cents
},
Quantity = 1,
}
},
Mode = "payment",
SuccessUrl = $"{portalUrl}/pay/s?intent_id={paymentIntentId}",
CancelUrl = $"{portalUrl}/pay/c?intent_id={paymentIntentId}",
CustomerEmail = null, // Disable email collection
BillingAddressCollection = "auto", // Optional: collect billing address if needed
AllowPromotionCodes = false, // Disable promotion codes
};
var session = await sessionService.CreateAsync(options, new RequestOptions()
{
StripeAccount = account.ProviderAccountId // Use the Stripe account ID from the provider account
});
This is what I do now for invoice payments
destination I think, we are not involved in any funds transfer, everything happens between supplier and customer
ok so this is a Direct Charge
because you're passing the StripeAccount in the RequestOptions
yeah idd
so yes you would need one price by connected account in this case
you can store the IDs in your own db
if you want
hmm ๐ฆ
then I need to make sure when they go through the onboarding, the price is created automatically. Does it need to have any specifics to be created or can I just create something like default_topup_price with default 0 value
this is the price field that you need to use when you create the price https://docs.stripe.com/api/prices/create#create_price-custom_unit_amount
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
alright
I have some ideas how to handle this
I'll get it set up
thanks for the explanation, I'll adapt my checkout logic!
sure let me know if you need any more help