#juraj.puchky

1 messages · Page 1 of 1 (latest)

near cliffBOT
marble trail
#

$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?

atomic harness
#

i did not know payment detail in time of creating customer and subscription

#

can i configure subscription to handle default method up on user?

marble trail
#

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?

atomic harness
#

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

marble trail
#

Are you following a guide?

atomic harness
#

yes

marble trail
#

Which one?

marble trail
#

Okay, so you're following that guide and you're getting stuck somewhere?

atomic harness
#

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

marble trail
#

Why aren't you setting payment_behavior to default_incomplete like the guide says?

atomic harness
#

its working thanks lot