Skip to content

Commit 37ee26a

Browse files
dependabot[bot]asbiin
authored andcommitted
build(deps-dev): bump vimeo/psalm from 2.0.10 to 2.0.11 (#1774)
* build(deps-dev): bump vimeo/psalm from 2.0.10 to 2.0.11 Bumps [vimeo/psalm](https://github.com/vimeo/psalm) from 2.0.10 to 2.0.11. - [Release notes](https://github.com/vimeo/psalm/releases) - [Changelog](https://github.com/vimeo/psalm/blob/master/CHANGELOG.md) - [Commits](vimeo/psalm@2.0.10...2.0.11) Signed-off-by: dependabot[bot] <[email protected]> * Initialize errorMessage variable
1 parent d409c95 commit 37ee26a

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

app/Http/Controllers/Settings/SubscriptionsController.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ public function processPayment(Request $request)
137137
$stripeToken = $request->input('stripeToken');
138138

139139
$plan = InstanceHelper::getPlanInformationFromConfig($request->input('plan'));
140+
$errorMessage = '';
140141

141142
try {
142143
auth()->user()->account->newSubscription($plan['name'], $plan['id'])
@@ -149,24 +150,24 @@ public function processPayment(Request $request)
149150
// Since it's a decline, \Stripe\Error\Card will be caught
150151
$body = $e->getJsonBody();
151152
$err = $body['error'];
152-
$message = trans('settings.stripe_error_card', ['message' => $err['message']]);
153+
$errorMessage = trans('settings.stripe_error_card', ['message' => $err['message']]);
153154
} catch (\Stripe\Error\RateLimit $e) {
154155
// Too many requests made to the API too quickly
155-
$message = trans('settings.stripe_error_rate_limit');
156+
$errorMessage = trans('settings.stripe_error_rate_limit');
156157
} catch (\Stripe\Error\Authentication $e) {
157158
// Authentication with Stripe's API failed
158159
// (maybe you changed API keys recently)
159-
$message = trans('settings.stripe_error_authentication');
160+
$errorMessage = trans('settings.stripe_error_authentication');
160161
} catch (\Stripe\Error\ApiConnection $e) {
161162
// Network communication with Stripe failed
162-
$message = trans('settings.stripe_error_api_connection_error');
163+
$errorMessage = trans('settings.stripe_error_api_connection_error');
163164
} catch (\Stripe\Error\Base $e) {
164-
$message = $e->getMessage();
165+
$errorMessage = $e->getMessage();
165166
}
166167

167168
return back()
168169
->withInput()
169-
->withErrors($message);
170+
->withErrors($errorMessage);
170171
}
171172

172173
/**

composer.lock

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)