#alboradait-dev_checkout-prorations

1 messages · Page 1 of 1 (latest)

pallid flumeBOT
#

👋 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/1219684748520198314

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

wise tapir
#

public function checkout(){
return Checkout::guest()
->allowPromotionCodes()
->create([
'price_******30u' => 2, //recurring price
'price_******Uq' => 2, //recurring price
'price_**5u' => 2 //one-time price
], [
'mode' => 'subscription',
'subscription_data' => [
'billing_cycle_anchor' => $this->getBillingCycleAnchor('next nth day of month:1'),
//'trial_end' => $this->getBillingCycleAnchor('next nth day of month:1'),
'proration_behavior' => 'none',
'on_behalf_of' => 'acct_
'
],
'success_url' => 'https://local.university/success?session_id={CHECKOUT_SESSION_ID}',
'cancel_url' => 'https://local.university/cancel?session_id={CHECKOUT_SESSION_ID}',
]);
}

#

This is a simplified version of the code, in case it helps. As I said, I am getting a pretty straightforward message: You cannot set proration_behavior to none in a Checkout Session with one-time prices, and what I really would like to know, more than workarounds (I think that, most probably, I would remove the one time price and charge it separatedly), is wether I can count with this feature being added in the future. Since this is a long project, and needs to be very scalable, I can wait to implement this feature if it saves me some added complexities.

sage arrowBOT
solid oasis
#

Hi 👋

Sorry for the delay.

wise tapir
#

Hi, no problem at all, thank you 🙂

solid oasis
#

I'm not sure I follow. Is the issue that you do not want a prorated amount between the time the Subscription is generated and the billing cycle anchor?

wise tapir
#

exactly

#

I can achieve it by removing the one time payment from the cart, and setting proration_behavior to none

#

but if I send the request as it is I get this error:

#

As I said, i can think of some workarounds. The problem is that this solution needs a lot of scalability in the future (our clients may define a fairly high set of rules about payments), and throwing extra logic there (like, for example, programming a single charge to the recently created account) would be a pain. Hence, I am asking if there is a possibility that, in a future version, the API will have this feature.

sage arrowBOT
solid oasis
#

Sorry for the dealy

#

Again 🤦

#

Hmmm... yes I think this is a current limitation of the Checkout Session itself when you mix one-time and recurring charges

wise tapir
#

So, I guess, not something that is in the roadmap right now, I assume, right?

ruby hamlet
#

👋 hopping in here since snufkin had to head out - yeah right now it's not something on the roadmap as far as I know

pallid flumeBOT
#

alboradait-dev_checkout-prorations

wise tapir
#

Hi karbi. Ok, that´s fine, there are decent workarounds I can use when it´s time, thanks for letting me know.