#yoni_best-practices

1 messages ยท Page 1 of 1 (latest)

formal monolithBOT
#

๐Ÿ‘‹ 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.

slate mulch
#

the thing is that payment links need a price object to be created, which we don't have

stable jungle
#

๐Ÿ‘‹ happy to help

slate mulch
#

yes, I know that one

#

but from what I understand, it creates a dummy product/price behind the screens

stable jungle
#

correct

#

but you can easily ignore that

slate mulch
#

we are creating a stripe URL via an internal API that is called via our end-user billing platform

#

(thus in a connect account)

stable jungle
#

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

slate mulch
#

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

stable jungle
slate mulch
#

OK but we'd still need a price ID then or not?

stable jungle
#

yes correct

slate mulch
#

hmm

#

how would I handle this best then, for each stripe connect account set up a dummy price ?

stable jungle
#

what type of charges are you processing? Direct or Destination Charges?

slate mulch
#

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

stable jungle
#

ok so this is a Direct Charge

#

because you're passing the StripeAccount in the RequestOptions

slate mulch
#

yeah idd

stable jungle
#

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

slate mulch
#

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

stable jungle
slate mulch
#

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!

stable jungle
#

sure let me know if you need any more help