#juraj.puchky
1 messages · Page 1 of 1 (latest)
$subscription = \Stripe\Subscription::create([
'customer' => $customerId,
'items' => [
[
'price' => $eshop->getOss() ? $group->getPriceIdOss() : $group->getPriceId()
],
],
'metadata' => [
'order_number' => $order->getId(),
],
'trial_period_days' => $trial ? $group->calcTrial() : 0,
'expand' => ['latest_invoice.payment_intent'],
'payment_settings' => [
'payment_method_types' => ['card'],
'save_default_payment_method' => 'on_subscription'
],
]);
Hello! The error is correct. Can you tell me more about what specific thing you're stuck on?
i did not know payment detail in time of creating customer and subscription
can i configure subscription to handle default method up on user?
Don't know what "default method up on user" means. Can you describe what you're trying to build? Are you trying to create a Subscription with a trial period without collecting payment info or something else?
yes i would like to stripe component handle collect payment details like card
to avoid process it on our server side app
for app is ok subbscription handled by hooks
i would like to do subscription
Are you following a guide?
yes
Which one?
Okay, so you're following that guide and you're getting stuck somewhere?
// Create a customer
$customer = \Stripe\Customer::create([
'email' => $this->getUser()->getUsername(),
]);
i am creating customer but it stucks
$subscription = \Stripe\Subscription::create([
with following error
This customer has no attached payment source or default payment method. Please consider adding a default payment method. For more information, visit https://stripe.com/docs/billing/subscriptions/payment-methods-setting#payment-method-priority.
its working thanks lot