#kitem - PHP
1 messages ยท Page 1 of 1 (latest)
Hello, looking in to this. What version of the library did you upgrade to?
kitem - PHP
I had like the version 7 before, now I'm on the latest
the 10+
older syntax was like
\Stripe\Plan::create()
Gotcha, that syntax looks very similar to the one in our docs. Trying to think of what is different here https://stripe.com/docs/api/connected_accounts?lang=php
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
maybe the product ID should be passed as first argument outside the array? Let me try
Looks like it is part of the first array from the API ref https://stripe.com/docs/api/prices/create?lang=php
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
And quickly checking another Connect related doc I do see that stripe_account goes in that second array https://stripe.com/docs/connect/direct-charges#create-a-charge
the second one is like it was before, but now does not works
into the first one I can't find the stripe_account param
and the product is correctly passed on the first array
๐ค
always get 'Received unknown parameter: stripe_account'
it could be that now we need to pass it inside the headers?
Yeah StripeAccount is a header here. So set it as one if you can
mhm ok, so do you confirm it cannot be passed anymore into the function of SDK?
because here it is still passed as I am doing
is maybe that the 'prices' does not have that?
It should be able to be passed per function call
Can you make this request again using the syntax you originally send and send me the request ID of a request that gets that error?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
here
req_Cvid8BkV25GNOO
Thank you!
Oh when you make that get call, do you have an empty array as the first parameter?
'prod_NTcoeavv8CQM4y',
[],
['stripe_account' => 'acct_1DLndLBcGHUzst3w']
);]```
I got
object(Stripe\Product)#22 (19) { ["id"]=> string(19) "prod_NTcoeavv8CQM4y" ["object"]=> string(7) "product" ["active"]=> bool(true) ["attributes"]=> array(0) { } ["created"]=> int(1678114951) ["default_price"]=> NULL ["description"]=> NULL ["images"]=> array(0) { } ["livemode"]=> bool(false) ["metadata"]=> object(Stripe\StripeObject)#27 (0) { } ["name"]=> string(25) "test pagamento 23434 #637" ["package_dimensions"]=> NULL ["shippable"]=> NULL ["statement_descriptor"]=> NULL ["tax_code"]=> NULL ["type"]=> string(7) "service" ["unit_label"]=> NULL ["updated"]=> int(1678114951) ["url"]=> NULL }
actually the product exist, but can't set the prices
and the product is create with the additional array
['stripe_account' => $fetch_company->stripe_id] passed into the function of SDK, and it works
Interesting. So that code works but $plan = $stripe->prices->create( [ 'currency' => $currency, 'recurring[interval]' => $interval, 'product' => $product->id, 'nickname' => "Subscription for " . $plan_name, 'recurring[interval_count]' => $intervalCount, 'unit_amount' => $priceSubscription, 'metadata' => $metadata, ], ['stripe_account' => $stripeId] );
Still gets an error and you can't create prices with it?
exactly
and I got only the error on that stripe_account parameter, only when creating prices
Can you try again and send a request ID for that?
Not sure if that will help but I can check what we are seeing on our side
sure
req_G3hekVfgLmHFyR
that could be that I have the last SDK on my code
but maybe need to upgrade the API in use on Stripe?
because I've seen that on the request page there is 2018-07-27 api version. And about this, I've seen I can't change the api version into test mode, but only into live mode. I can't change live APIs, because I'm testing new integration and the live mode is in production, so if this is the issue...how can I test it? thank you
You actually can change the API version that you make requests with https://stripe.com/docs/api/versioning
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Our PHP library lets you do it per application or per request so you have some flexibility there
Unfortunately not sure about the syntax of your create price call though. If you create a new PHP script that just sets up the Stripe library and then makes that call, does it work properly there?
actually it worked
so I suppose there is some issue into my PHP code
thank you, I'm checkin git
*checking it
found issue, was not on prices, but on some piece of code before
$stripe->products->retrieve($product->id, ['stripe_account' => $stripe_id]);
should be
$stripe->products->retrieve($product->id, [],['stripe_account' => $stripe_id]);
Ah there we go, good catch! Glad you could find that