#kitem - PHP

1 messages ยท Page 1 of 1 (latest)

sonic sandBOT
crimson karma
#

Hello, looking in to this. What version of the library did you upgrade to?

#

kitem - PHP

graceful lantern
#

I had like the version 7 before, now I'm on the latest

#

the 10+

#

older syntax was like
\Stripe\Plan::create()

crimson karma
graceful lantern
#

maybe the product ID should be passed as first argument outside the array? Let me try

crimson karma
graceful lantern
#

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?

crimson karma
#

Yeah StripeAccount is a header here. So set it as one if you can

graceful lantern
#

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?

crimson karma
#

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?

graceful lantern
#

here
req_Cvid8BkV25GNOO

crimson karma
#

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']
);]```
graceful lantern
#

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

crimson karma
#

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?

graceful lantern
#

exactly

#

and I got only the error on that stripe_account parameter, only when creating prices

crimson karma
#

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

graceful lantern
#

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

crimson karma
#

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?

graceful lantern
#

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]);

crimson karma
#

Ah there we go, good catch! Glad you could find that