#ravelens
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. 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.
- ravelens-subs-changes, 3 minutes ago, 34 messages
- ravelens-setupinetnt-defaultpm, 2 hours ago, 9 messages
Can you elaborate?
Hi, i did hanzo told me to do to create the subscriptonschedules
This is my part of code
$subscrption = SubscriptionSchedule::create([
'customer' => $authUser->stripe_id,
'start_date' => 'now',
'end_behavior' => 'release',
'phases' => [
[
'items' => [
'price' => $first_plan->plan_id,
'quantity' => 1,
],
'end_date' => Carbon::now()->addMonths(6)->timestamp,
],
[
'items' => [
'price' => $second_plan->plan_id,
'quantity' => 1,
],
'iteration' => 1,
]
]
]);
But it returned Invalid array from Stripe side
Can you provide the exact error mesage you receive?
"message": "Invalid array",
"exception": "Stripe\Exception\InvalidRequestException",
"file": "D:\Github_Repo\onehaircut-api-server\vendor\stripe\stripe-php\lib\Exception\ApiErrorException.php",
"line": 38,
"trace": [
It looks like you have an invalid array in your php
Try creating the items and phases in their own variables to make sure you have the syntax correct
items is an array of array in PHP so you have 'items' => [ 'price' => $first_plan->plan_id, 'quantity' => 1, ], but you want 'items' => [ [ 'price' => $first_plan->plan_id, 'quantity' => 1, ], ],
Ahh i see
yes, i just reallized it
It is solved now, thank you
Anyway
If i want to canceled the subscriptionSchedule
I can just call cancel method and it won't be charged from customer right ?
correct, you can test all of this in Test mode too
Okay, thank you sir