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
a5783635
Commit
a5783635
authored
Oct 20, 2021
by
Michael Iseard
Browse files
Update formatting
parent
65e59003
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/Service/LogHandlers/DatabaseHandler.php
View file @
a5783635
...
...
@@ -19,6 +19,12 @@ class DatabaseHandler extends AbstractProcessingHandler {
parent
::
__construct
(
$level
,
$bubble
);
}
/**
* Defines how the handler should write a record.
* In this case this uses wpdb to write to the database.
*
* @param array $record
*/
protected
function
write
(
array
$record
):
void
{
$wpdb
=
$this
->
wpdb
;
...
...
@@ -27,7 +33,7 @@ class DatabaseHandler extends AbstractProcessingHandler {
'level'
=>
$record
[
'level'
],
'message'
=>
$record
[
'message'
],
'context'
=>
$record
[
'context'
]
?
json_encode
(
$record
[
'context'
]
)
:
''
,
'date'
=>
$record
[
'datetime'
]
->
format
(
'Y-m-d H:i:s'
)
'date'
=>
$record
[
'datetime'
]
->
format
(
'Y-m-d H:i:s'
),
]
);
}
}
\ No newline at end of file
app/Service/PaymentService.php
View file @
a5783635
...
...
@@ -243,13 +243,13 @@ class PaymentService {
$message
);
// Return checkout url if payment successfully created in Mollie
// Return checkout url if payment successfully created in Mollie
.
if
(
$result
instanceof
Payment
)
{
do_action
(
'kudos_payment_submit_successful'
,
$values
);
wp_send_json_success
(
$result
->
getCheckoutUrl
()
);
}
// If payment not created return an error message
// If payment not created return an error message
.
wp_send_json_error
(
[
'message'
=>
__
(
'Error creating Mollie payment. Please try again later.'
,
'kudos-donations'
),
]
);
...
...
@@ -257,7 +257,7 @@ class PaymentService {
}
/**
* Cancel the specified subscription
* Cancel the specified subscription
.
*
* @param string $id subscription row ID.
*
...
...
@@ -325,9 +325,9 @@ class PaymentService {
string
$message
=
null
)
{
$order_id
=
Utils
::
generate_id
(
'kdo_'
);
$currency
=
'EUR'
;
$value
=
number_format
(
$value
,
2
,
'.'
,
''
);
$order_id
=
Utils
::
generate_id
(
'kdo_'
);
$currency
=
'EUR'
;
$
formatted_
value
=
number_format
(
$value
,
2
,
'.'
,
''
);
// Set payment frequency.
$frequency_text
=
Utils
::
get_frequency_name
(
$interval
);
...
...
@@ -337,7 +337,7 @@ class PaymentService {
$payment_array
=
[
"amount"
=>
[
'currency'
=>
$currency
,
'value'
=>
$value
,
'value'
=>
$
formatted_
value
,
],
'redirectUrl'
=>
$redirect_url
,
'webhookUrl'
=>
$this
->
vendor
->
get_webhook_url
(),
...
...
@@ -372,7 +372,7 @@ class PaymentService {
[
'order_id'
=>
$order_id
,
'customer_id'
=>
$customer_id
,
'value'
=>
$value
,
'value'
=>
$
formatted_
value
,
'currency'
=>
$currency
,
'status'
=>
$payment
->
status
,
'mode'
=>
$payment
->
mode
,
...
...
@@ -427,6 +427,7 @@ class PaymentService {
'reason'
=>
'Form completed too quickly'
,
'time_taken'
=>
$timeDiff
,
]
);
return
true
;
}
...
...
@@ -434,6 +435,7 @@ class PaymentService {
if
(
!
empty
(
$values
[
'donation'
]
)
)
{
$this
->
logger
->
info
(
'Bot detected, rejecting form.'
,
array_merge
(
[
'reason'
=>
'Honeypot field completed'
],
$values
)
);
return
true
;
}
...
...
Write
Preview
Markdown
is supported
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