Fixed:Displaying a warning about a deprecated function when trying to view PayPal transaction details.

This commit is contained in:
Amit sharma
2025-12-16 17:14:40 +05:30
committed by azhar bhat
parent 812b6eb731
commit 6840fcb7e8
7 changed files with 33 additions and 33 deletions

View File

@@ -44,25 +44,25 @@ class QloPaypalCommerceCallbackModuleFrontController extends ModuleFrontControll
}
if ($json) {
$payload['webhook_event'] = Tools::jsonDecode($json, true);
$payload['webhook_event'] = json_decode($json, true);
}
if ($payload) {
WkPaypalCommerceHelper::logMsg('webhook', 'Webhook initiated...', true);
WkPaypalCommerceHelper::logMsg('webhook', 'Environment: '. Configuration::get('WK_PAYPAL_COMMERCE_PAYMENT_MODE'));
WkPaypalCommerceHelper::logMsg('webhook', 'Webhook payload data: ');
WkPaypalCommerceHelper::logMsg('webhook', Tools::jsonEncode($payload));
WkPaypalCommerceHelper::logMsg('webhook', json_encode($payload));
WkPaypalCommerceHelper::logMsg('webhook', 'Validating webhook signature...');
$validateSig = WkPaypalCommerceHelper::validateWebhookSig($payload);
WkPaypalCommerceHelper::logMsg('webhook', 'Webhook respose data: ');
WkPaypalCommerceHelper::logMsg('webhook', Tools::jsonEncode($validateSig));
WkPaypalCommerceHelper::logMsg('webhook', json_encode($validateSig));
if (isset($validateSig['verification_status'])
&& $validateSig['verification_status'] == 'SUCCESS'
) {
$eventData = Tools::jsonDecode($json, true);
$eventData = json_decode($json, true);
$objWebhook = new WkPaypalCommerceWebhook();
switch ($eventData['event_type']) {
case 'CHECKOUT.ORDER.APPROVED':