Skip to content

Commit

Permalink
Merge pull request #41 from bold-commerce/INTER-4337
Browse files Browse the repository at this point in the history
Insufficient postMessage Validation.
  • Loading branch information
NickolasMalovanets authored Jul 26, 2024
2 parents 907a269 + 64b19b3 commit 49978dc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions UI/Payment/BoldConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ public function getConfig(): array
'publicOrderId' => $publicOrderId,
'countries' => $this->getAllowedCountries(),
'alternativePaymentMethods' => $alternativePaymentMethods,
'origin' => rtrim($this->config->getApiUrl($websiteId), '/'),
],
];
}
Expand Down
2 changes: 1 addition & 1 deletion UI/Payment/FastlaneConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function getConfig(): array
$websiteId = (int)$quote->getStore()->getWebsiteId();
if (!$boldCheckoutData
|| !$this->config->isPaymentBoosterEnabled($websiteId)
|| !$this->config->isFastlaneEnabled($websiteId)) {
|| !$this->config->isFastlaneEnabled($websiteId) || $quote->getCustomer()->getId()) {
return [];
}
$publicOrderId = $boldCheckoutData['data']['public_order_id'] ?? null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,10 @@ define([
* @returns {void}
*/
subscribeToPIGI() {
window.addEventListener('message', ({data}) => {
window.addEventListener('message', ({ origin, data }) => {
if (origin !== window.checkoutConfig.bold.origin) {
return;
}
const responseType = data.responseType;
const iframeElement = document.getElementById('PIGI');
const addPaymentAction = {actionType: 'PIGI_ADD_PAYMENT'};
Expand Down

0 comments on commit 49978dc

Please sign in to comment.