Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Michael Iseard
Kudos-Donations
Commits
69a58128
Commit
69a58128
authored
Oct 20, 2021
by
Michael Iseard
Browse files
Wrap createSubscription in try/catch statement
parent
a5783635
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/Service/Vendor/MollieVendor.php
View file @
69a58128
...
@@ -380,8 +380,8 @@ class MollieVendor implements VendorInterface {
...
@@ -380,8 +380,8 @@ class MollieVendor implements VendorInterface {
// Create subscription if valid mandate found
// Create subscription if valid mandate found
if
(
$valid_mandate
)
{
if
(
$valid_mandate
)
{
$subscription
=
$customer
->
createSubscription
(
$subscription_array
);
try
{
if
(
$subscription
)
{
$subscription
=
$customer
->
createSubscription
(
$subscription
_array
);
$kudos_subscription
=
new
SubscriptionEntity
(
$kudos_subscription
=
new
SubscriptionEntity
(
[
[
'transaction_id'
=>
$transaction
->
transaction_id
,
'transaction_id'
=>
$transaction
->
transaction_id
,
...
@@ -397,11 +397,16 @@ class MollieVendor implements VendorInterface {
...
@@ -397,11 +397,16 @@ class MollieVendor implements VendorInterface {
$this
->
mapper
->
save
(
$kudos_subscription
);
$this
->
mapper
->
save
(
$kudos_subscription
);
return
$subscription
;
return
$subscription
;
}
catch
(
ApiException
$e
)
{
$this
->
logger
->
error
(
$e
->
getMessage
(),
[
'transaction'
=>
$transaction
,
'mandate_id'
=>
$mandate_id
,
'interval'
=>
$interval
,
'years'
=>
$years
,
]
);
return
false
;
}
}
$this
->
logger
->
error
(
'Failed to create subscription'
,
[
$transaction
]
);
return
false
;
}
}
// No valid mandates
// No valid mandates
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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