mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-06 03:50:04 +02:00
Add error handling for missing user ID or amount in webhook analysis
This commit is contained in:
parent
823d599253
commit
383fc29cca
1 changed files with 7 additions and 0 deletions
|
@ -58,6 +58,13 @@ if (!$analysis['plans_id'] && !empty($txnInfo['plans_id'])) {
|
||||||
}
|
}
|
||||||
_error_log('[Authorize.Net webhook] Analysis: ' . json_encode($analysis));
|
_error_log('[Authorize.Net webhook] Analysis: ' . json_encode($analysis));
|
||||||
|
|
||||||
|
if(empty($analysis['users_id']) || empty($analysis['amount'])) {
|
||||||
|
_error_log('[Authorize.Net webhook] Missing user ID or amount in analysis');
|
||||||
|
http_response_code(400);
|
||||||
|
echo 'missing user ID or amount';
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
$result = AuthorizeNet::processSinglePayment(
|
$result = AuthorizeNet::processSinglePayment(
|
||||||
$analysis['users_id'],
|
$analysis['users_id'],
|
||||||
(float)$analysis['amount'],
|
(float)$analysis['amount'],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue