#normanlove-php

1 messages ยท Page 1 of 1 (latest)

willow hound
#

normanlove-php

#

Hey Norman! Can you provide a bit more specific details? We've never had a stripe-php version 1.101.X

#

The most recent version is 7.111.0 which is for the major version 7.X for our library. That version is compatible with PHP 7.4 and PHP 8.0

wicked scaffold
#

I meant 7.110 is the latest I have, that should be fine as well right?

#

lots of late night hours and , well...

willow hound
wicked scaffold
#

thanks. all webhooks were working fine on local testing and using the stripe cli, but moving to production and direct webhook, is proving to be a challange. I keep getting these errors, and webhook code is not being run.

#

[Thu Jan 20 14:02:32.486928 2022] [fcgid:warn] [pid 100490:tid 121565801395968] [client 54.187.174.169:52619] mod_fcgid: stderr: stripe exception area
[Thu Jan 20 14:02:47.253281 2022] [fcgid:warn] [pid 100459:tid 121565647714048] [client 54.187.205.235:60920] mod_fcgid: stderr: stripe exception area

#

its not from server or hosting, its error odes coming from the stripe-php library code. but you guys say you have never seen it. So I downgraded to avoid it being a new unseen bug.

willow hound
#

those are totally cryptic and unrelated to Stripe code

#

you need to start adding logs to your code to understand where it's failing exactly

wicked scaffold
#

ok

#

I was getting a lot of these at first mod_fcgid: stderr: PHP Deprecated: Return type of Stripe\Util\CaseInsensitiveArray::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/dh_mcjpre/simpleincometracker.com/stripe-php/lib/Util/CaseInsensitiveArray.php on line 57, referer: https://simpleincometracker.com/delete-user.php

#

and you guys said it was because I needed to upgrade my stripe library, and I did na they went away, but notice they strat with mod_fcgid: stderr

#

so why is these 2 lines with the exact same suffix NOT related to library? I dont get it.

#

[fcgid:warn] [pid 100459:tid 121565647714048] [client 54.187.205.235:60920] mod_fcgid: stderr: stripe exception area

#

is it because its just a standard error that is being reported by PHP itself? that would make sense

willow hound
#

I'm sorry I don't really understand what you are saying and what mod_fcgid even means. I think you need real errors to be able to narrow this down

wicked scaffold
#

ok

wicked scaffold
#

ok, so you guys/gals, were right, as usual. that error was NOT from the library, but my the code from the code I used in my webhook to log when there was an exception error. so code is not firing because there is the exception for SignatureVerificationException, meaning stripe doesnt like my endpoint secret key right. so I made sure and use the correct key from the webhook dashboard and still seeing the error. Im gonna paste my entire webhook fie. do you see why its not firing code in production and it does so locally. has to be the key right?

rotund thorn
#

Webhook signature verifications can also fail if the body of the request is not used in it's raw form. Many frameworks do some "helpful" parsing of the body content but even a truncated empty space will result in signature verification failure in this case.

wicked scaffold
rotund thorn
#

No I can see it.

wicked scaffold
#

worked on local testing using stripe cli

rotund thorn
#

First things first, it appears that the text copied for your webhook signing secret has an extra "w" character added to the beginning.

wicked scaffold
#

using different secrey key of course

#

OMG! good catch, pushing and testing now

rotund thorn
#

I wouldn't spot those so easy if I hadn't made that mistake myself plenty of times! ๐Ÿ˜…

wicked scaffold
#

I had just reset test code and so my reusable plan ID is gone and code is hiccupping. so im recreating a product in hopes of seeing a plan id, and lo and behold, no plan id, just a price

#

here is how I create subscription

#

$subscription = \Stripe\Subscription::create(array(
"customer" => $customer->id,
"items" => array(
array(
"plan" => $planid_144,
),
),
));

#

can I just replace plan with price and use price id?

rotund thorn
#

I thinks so, given this is the code snippet from our API for creating a new subscription:

$stripe->subscriptions->create([
  'customer' => 'cus_KbLnaja1Lu9o9e',
  'items' => [
    ['price' => 'price_1KJj31IlCeH6bP8RjVerAqcy'],
  ],
]);
wicked scaffold
#

I just also saw that , thanks ๐Ÿ˜Š

#

will the products I create now in test mode, hold over in the dashboard when I go live?

rotund thorn
#

In fact, I just found the logs in my test account where I did just that.

rotund thorn
#

Looking into it

#

Okay, so there is a "Copy to Live Mode" button for each Product. However, we generally recommend users script their migrations to Live mode for more than a few products/prices.

wicked scaffold
#

what do you mean by script...I mean how, use PHP and the API to just create the products, after I go live?

#

I only have the 2 products so its manual dashbord for this guy ๐Ÿค—

rotund thorn
#

Glad that works for you. All prices associated with each product will get copied over

wicked scaffold
#

BTW, my tests were successfull and webhooks are now firing 100% in the green. Thank you so much for all your help. I love stripe support more that fried food. ๐Ÿ™

rotund thorn
#

Always happy to help out developers ๐Ÿ‘

#

Coders are who we made this stuff for.

wicked scaffold
#

ciao!