#NormanLove
1 messages Β· Page 1 of 1 (latest)
Can you share your Stripe account ID or the event ID of a recently-undelivered event?
I can understand if I had webhooks failing on production, that would make sense
One moment
will my email work?
email is steelpulsefan@gmail.com
dont know where to find any other account id
here is first part of the email: Weβre still having trouble sending requests in test mode to a webhook endpoint associated with your ProducersWork.com account. Stripe sends webhook events to your server to notify you of activity in your Stripe account, such as a completed payout or a newly-created invoice.
The URL of the failing webhook endpoint is: https://Producerswork.com/webhook.php
no, email won't help in this case. you can find your account ID by logging into the Stripe Dashboard, navigating to https://dashboard.stripe.com/settings/user, and scrolling to the bottom of the page. the ID likely starts with acct_...
acct_0KA0BB6wVCS7vFxa5xD4
Hi @viscid glade I'm taking over
Nice to met you taking over
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Based on the log, your endpoint responds with 421 and that's whey the webhook delivery is not successful.
To acknowledge a successful delivery, Stripe expects your webhook endpoint to respond with 200
im not sure why that link is showing im in test mode. I just checked it and i was not in test mode. my site is live and in production mode for months now. can a site/account be in both test and not test mode????
when I went to my account just prior it was not in test mode
maybe an account created as a trial or something just finally cancelled or something, is that what happened?
90 day test mode trial cancells and it does not see the test authorization info or something? π I dunno how to even phrase things
here is the code that would give a 421, directly from my webhook
// Include Stripe PHP library
require_once 'stripe/stripe-php/init.php';
// This is your Stripe CLI webhook secret for testing your endpoint locally.
$endpoint_secret = STRIPE_WEBHOOK_SECRET;
// $endpoint_secret = STRIPE_WEBHOOK_SECRET;
$payload = @file_get_contents('php://input');
$sig_header = $_SERVER['HTTP_STRIPE_SIGNATURE'];
$event = null;
error_log("leg 2");
try {
$event = \Stripe\Webhook::constructEvent(
$payload, $sig_header, $endpoint_secret
);
} catch(\UnexpectedValueException $e) {
// Invalid payload
http_response_code(405);
exit();
} catch(\Stripe\Exception\SignatureVerificationException $e) {
// Invalid signature
error_log(print_r('leg 3: stripe exception area SignatureVerificationException, in webhook.php', TRUE));
http_response_code(421); //422 Unprocessable Entity: The request was well-formed but was unable to be followed due to semantic errors.
exit();
}
I also noticed that you are using the same endpoint for both live and test mode.
And your live webhook endpoint is receiving the webhooks successfully.
OK. My guess is that you've configured the live mode webhook secret in your webhook endpoint, and that's why the endpoint is able to construct the event in live mode but fail in test mode.
yeah 42 deals with authentication error, which a test should give since those keys are not in production
421
The real question is why is there a test mode anything firying? Im live in production and am not doing any testing . I havent been in test mode in months
is it from bots accessing the webhook.php file?
no, now that I think of it, the webhooks initiate from Stripe so it cant be bots.
Let me check you test subscription.
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
For any test mode subscription that was created at least 90 days ago, Stripe will automatically cancel the subscription.
So you believe thats what we are seeing?
Yes you a right. This test subscription was created 90 days ago , and that's why Stripe automatically canceled it.
at least the mystery is solved π Now, is there a way to disable this so it doesnt happen in the future? Or is the answer just to delete all the test subscriptions prior to going live βΊ
π
My advise is to avoid using the same webhook endpoint for both live and test mode.
So that you can configure different webhook secret in these two webhook endpoints respectively and avoid failed delivery.
but if I delete the the test endpoint wont it give a similiar error?
that would mean leaving the test webhook live as long as site is live
I guess it doesnt hurt anything to have a test webhook live forever, its just test
Ok, another unrelated question
I have the production site set to subscribe , with no trial, but business is slow so I wanted to just add a 30 day trial to the same product. that should just be something I can adjust on the Stripe dashboard right and no need to change subscription code or anything right?
No it won't err if you delete the test endpoint.
How does your customer subscribe? Is it through Stripe checkout?
no site uses API to subscribe user to the product
it also processes payment via API
Stripe payment form I believe
OK, I see you are calling the subscriptions API directly, you can specify a trial via https://stripe.com/docs/api/subscriptions/create?lang=dotnet#create_subscription-trial_end or https://stripe.com/docs/api/subscriptions/create?lang=dotnet#create_subscription-trial_period_days
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
So its not just as simple as adding via the stripe dashboart a 30 day trial, and the same code will work?
You can also create a subscription through Dashboard where you can specify a trial.
thats what I thought. ok thats it for me. thank you and take the rest of the day off. Thats an order π