1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 01:39:24 +02:00

Add error handling for missing user ID or amount in webhook analysis

This commit is contained in:
Daniel Neto 2025-07-23 13:19:24 -03:00
parent 823d599253
commit 383fc29cca

View file

@ -58,6 +58,13 @@ if (!$analysis['plans_id'] && !empty($txnInfo['plans_id'])) {
}
_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(
$analysis['users_id'],
(float)$analysis['amount'],