Skip to content

Commit

Permalink
Merge pull request #374 from 202ecommerce/bugfix/48993-admin-page-mes…
Browse files Browse the repository at this point in the history
…saging

refs #48993 displaying messaging configuration section
  • Loading branch information
bogdan202 authored Dec 2, 2024
2 parents 916c125 + a1c7a1e commit d972761
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions controllers/admin/AdminPaypalConfigurationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -394,17 +394,20 @@ public function ajaxProcessGetMessagingConfig()
exit;
}

$confing = json_decode(Configuration::get(ConfigurationMap::MESSENGING_CONFIG), true);

if (!is_array($confing)) {
$confing = [];
}

$messagingConfig = [
'placements' => ['product', 'homepage', 'cart', 'checkout', 'category'],
'merchantIdentifier' => $this->method->getClientId(),
'partnerClientId' => ($this->method->isSandbox() ? PayPal::PAYPAL_PARTNER_CLIENT_ID_SANDBOX : PayPal::PAYPAL_PARTNER_CLIENT_ID_LIVE),
'partnerName' => ($this->method->isSandbox() ? PayPal::PAYPAL_PARTNER_ID_SANDBOX : PayPal::PAYPAL_PARTNER_ID_LIVE),
'bnCode' => $this->method->getPaypalPartnerId(),
'locale' => str_replace('-', '_', Context::getContext()->language->locale),
'config' => json_decode(
Configuration::get(ConfigurationMap::MESSENGING_CONFIG, null, null, null, '{}'),
true
),
'config' => $confing,
];

$jsonResponse->setData(['success' => true, 'config' => $messagingConfig])->send();
Expand Down

0 comments on commit d972761

Please sign in to comment.