Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/62 webhook settings #63

Merged
merged 3 commits into from
Nov 27, 2024
Merged

Bugfix/62 webhook settings #63

merged 3 commits into from
Nov 27, 2024

Conversation

i-just
Copy link
Contributor

@i-just i-just commented Nov 26, 2024

Description

Don’t parse the webhook signing secret and ID when displaying them on the webhooks page.

Related issues

#62

@i-just i-just merged commit 721f928 into 1.x Nov 27, 2024
5 checks passed
@i-just i-just deleted the bugfix/62-webhook-settings branch November 27, 2024 08:28
@jamiepittock
Copy link

jamiepittock commented Nov 27, 2024

I don't think this fix is going to work.

You've fixed the form values, but now you're potentially sending an unparsed environment variable to the Stripe API to get the webhook info.

Something like this is needed...

if (!empty($webhookId)) {
    $parsedWebhookId = App::parseEnv($webhookId);
    try {
        $response = $this->getWebhookInfo($plugin, $parsedWebhookId);
        $webhookInfo = $response->toArray();
    } catch (\Exception $e) {
        Craft::error("Couldn't retrieve webhook with ID $parsedWebhookId: " . $e->getMessage());
        $hasWebhook = false;
    }
...

@i-just i-just mentioned this pull request Nov 27, 2024
@i-just
Copy link
Contributor Author

i-just commented Nov 27, 2024

Doh... we parse other values, and even that one (when deleting a webhook by id), but I missed this instance. Additional PR raised. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants