#paulocentr-subscriptions

1 messages · Page 1 of 1 (latest)

light kindle
#

Hello!

#

What does your code to make a subscription look like right now?

foggy kestrel
#

its creatin this arra like this

#

array*

#
     "customer" => "cus_LkqRPyn0CNbCIF",
     "default_payment_method" => "pm_1L3NLcJfhgQ5vfDAvSizvpFf",
     "items" => [
       "price" => "price_1L3KjjJfhgQ5vfDAtxpaHcm8",
     ],
     "cancel_at" => 1661447779,
   ]```
light kindle
#

Is that not working?

foggy kestrel
#

no its returning invalid array

#

Stripe\Exception\InvalidRequestException with message 'Invalid array'

#

any clues?

light kindle
#

Ah, I think the issue is with what you have in items - you need to be doing this instead:

[
"customer" => "cus_LkqRPyn0CNbCIF",
"default_payment_method" => "pm_1L3NLcJfhgQ5vfDAvSizvpFf",
"items" => [
["price" => "price_1L3KjjJfhgQ5vfDAtxpaHcm8",]
],
"cancel_at" => 1661447779,
]

#

(note the extra set of brackets around price)

light kindle
#

@foggy kestrel Did that solve your issue?