#ravelens

1 messages · Page 1 of 1 (latest)

wooden basaltBOT
#

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.

marsh depot
#

Can you elaborate?

jaunty vigil
#

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

marsh depot
#

Can you provide the exact error mesage you receive?

jaunty vigil
#

"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": [

marsh depot
#

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

patent viper
#

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, ], ],

jaunty vigil
#

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 ?

patent viper
#

correct, you can test all of this in Test mode too

jaunty vigil
#

Okay, thank you sir