Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
jhoskins98
Stripe
Commits
3d22e522
Commit
3d22e522
authored
Mar 20, 2019
by
mattwire
Browse files
Add a system check for invalid API key
parent
cf9e7619
Changes
1
Hide whitespace changes
Inline
Side-by-side
CRM/Stripe/Utils/Check/Webhook.php
View file @
3d22e522
...
...
@@ -25,7 +25,23 @@ class CRM_Stripe_Utils_Check_Webhook {
$webhook_path
=
str_replace
(
'NN'
,
$pp
[
'id'
],
$webhook_path
);
\
Stripe\Stripe
::
setApiKey
(
$sk
);
$webhooks
=
\
Stripe\WebhookEndpoint
::
all
([
"limit"
=>
100
]);
try
{
$webhooks
=
\
Stripe\WebhookEndpoint
::
all
([
"limit"
=>
100
]);
}
catch
(
\
Stripe\Error\Authentication
$e
)
{
$messages
[]
=
new
CRM_Utils_Check_Message
(
'stripe_webhook'
,
E
::
ts
(
'The %1 (%2) Payment Processor has an invalid API key'
,
[
1
=>
$pp
[
'name'
],
2
=>
$pp
[
'id'
],
]),
E
::
ts
(
'Stripe - API Key'
),
\
Psr\Log\LogLevel
::
ERROR
,
'fa-money'
);
continue
;
}
if
(
empty
(
$webhooks
->
data
))
{
$messages
[]
=
new
CRM_Utils_Check_Message
(
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment