#dverleg_error
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/1306160615798083634
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Additional information:
The Subscription is created through this function, which seems to work all good. I've used the iDeal payment method in this case during the checkout session for that Subscription:
public function createCheckoutSession(Request $request) {
$user = $request->user();
if (!$user->stripe_id) {
$user->createAsStripeCustomer();
}
$session = $user->newSubscription('default', *partner_price_id*)
->checkout([
'customer' => $user->stripe_id,
'success_url' => route('partner.checkout-complete'),
'cancel_url' => route('clients'),
]);
return redirect($session->url);
}
The use case here is that the "Partner" user adds multiple Clients in our dashboard. For each client I need to add a specific package (Stripe Price) to the Partners' Stripe Subscription.
So we don't know what Laravel Cashier does under the hood (you should reach out to its maintainer), but can you find the request id req_xxx from your Stripe Dashboard? 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.
Hi there, thanks for the quick reply. I think this is the request id where it throws the error: req_M1PP5rh1e6ARgL
I'm happy to use the Stripe API directly if that would make things easier. I was thinking Laravel Cashier would have this sorted properly but I totally understand you can't give feedback on that
Okie, speaking from a pure Stripe API perspective, I think this request could work if you pass off_session: true
Can you look around Laravel Cashier document to see if you can pass that parameter?
thanks, will check if I can figure that out and add it
That seems to be sent when creating the Subscription, but I'll check if I can also add it when adding the Price
I mean the request req_M1PP5rh1e6ARgL is a ConfirmPaymentIntent API, and that has off_session parameter here https://docs.stripe.com/api/payment_intents/confirm#confirm_payment_intent-off_session
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Yeah thanks for that, found that one as well. Unfortunately the Cashier integration does not support sending that off_session somehow.. This is the addPrice under the hood
public function addPrice($price, $quantity = 1, array $options = [])
{
$this->guardAgainstIncomplete();
if ($this->items->contains('stripe_price', $price)) {
throw SubscriptionUpdateFailure::duplicatePrice($this, $price);
}
$stripeSubscriptionItem = $this->owner->stripe()->subscriptionItems
->create(array_filter(array_merge([
'subscription' => $this->stripe_id,
'price' => $price,
'quantity' => $quantity,
'tax_rates' => $this->getPriceTaxRatesForPayload($price),
'payment_behavior' => $this->paymentBehavior(),
'proration_behavior' => $this->prorateBehavior(),
], $options)));
$this->items()->create([
'stripe_id' => $stripeSubscriptionItem->id,
'stripe_product' => $stripeSubscriptionItem->price->product,
'stripe_price' => $stripeSubscriptionItem->price->id,
'quantity' => $stripeSubscriptionItem->quantity ?? null,
]);
$this->unsetRelation('items');
$stripeSubscription = $this->asStripeSubscription();
if ($this->hasSinglePrice()) {
$this->fill([
'stripe_price' => null,
'quantity' => null,
]);
}
$this->fill([
'stripe_status' => $stripeSubscription->status,
])->save();
$this->handlePaymentFailure($this);
return $this;
}
When adding a off_session => true I get: Received unknown parameter: off_session
I can imagine you can't help me out there, but maybe I could try to instead use the Stripe API directly for adding a price to the subscription?