2020use Psr \Log \LoggerInterface ;
2121use Rvvup \Payments \Exception \PaymentValidationException ;
2222use Rvvup \Payments \Gateway \Method ;
23+ use Rvvup \Payments \Model \Config \RvvupConfigurationInterface ;
2324use Rvvup \Payments \Model \ConfigInterface ;
2425use Rvvup \Payments \Model \ProcessRefund \ProcessorPool as RefundPool ;
2526use Rvvup \Payments \Model \Webhook \WebhookEventType ;
@@ -35,7 +36,7 @@ class Index implements HttpPostActionInterface, CsrfAwareActionInterface
3536 /** @var RequestInterface */
3637 private $ request ;
3738
38- /** @var ConfigInterface */
39+ /** @var RvvupConfigurationInterface */
3940 private $ config ;
4041
4142 /** @var ResultFactory */
@@ -73,7 +74,7 @@ class Index implements HttpPostActionInterface, CsrfAwareActionInterface
7374 * @param RequestInterface $request
7475 * @param StoreRepositoryInterface $storeRepository
7576 * @param Http $http
76- * @param ConfigInterface $config
77+ * @param RvvupConfigurationInterface $config
7778 * @param ResultFactory $resultFactory
7879 * @param LoggerInterface $logger
7980 * @param WebhookRepository $webhookRepository
@@ -86,7 +87,7 @@ public function __construct(
8687 RequestInterface $ request ,
8788 StoreRepositoryInterface $ storeRepository ,
8889 Http $ http ,
89- ConfigInterface $ config ,
90+ RvvupConfigurationInterface $ config ,
9091 ResultFactory $ resultFactory ,
9192 LoggerInterface $ logger ,
9293 WebhookRepository $ webhookRepository ,
@@ -131,12 +132,12 @@ public function execute(): ResultInterface
131132 $ storeId = $ this ->getStoreId ($ quote , $ order );
132133
133134 // Merchant ID does not match, no need to process
134- if ($ merchantId !== $ this ->config ->getMerchantId ()) {
135+ if ($ merchantId !== $ this ->config ->getMerchantId ($ storeId )) {
135136 return $ this ->returnSkipResponse (
136137 'Invalid merchant id ' ,
137138 [
138139 'merchant_id ' => $ merchantId ,
139- 'config_merchant_id ' => $ this ->config ->getMerchantId (),
140+ 'config_merchant_id ' => $ this ->config ->getMerchantId ($ storeId ),
140141 'rvvup_id ' => $ rvvupOrderId
141142 ]
142143 );
@@ -279,19 +280,19 @@ private function returnExceptionResponse(): ResultInterface
279280 /**
280281 * @param Quote|null $quote
281282 * @param OrderInterface|null $order
282- * @return int
283+ * @return string
283284 * @throws NoSuchEntityException
284285 */
285- private function getStoreId (?Quote $ quote , ?OrderInterface $ order ): int
286+ private function getStoreId (?Quote $ quote , ?OrderInterface $ order ): string
286287 {
287288 if (isset ($ quote )) {
288- return $ quote ->getStoreId ();
289+ return ( string ) $ quote ->getStoreId ();
289290 }
290291 if (isset ($ order ) && $ order ->getId ()) {
291- return $ order ->getStoreId ();
292+ return ( string ) $ order ->getStoreId ();
292293 }
293294
294- return (int ) $ this ->storeManager ->getStore ()->getId ();
295+ return (string ) $ this ->storeManager ->getStore ()->getId ();
295296 }
296297
297298 private function orderOrQuoteResolver ($ rvvupOrderId , $ paymentLinkId , $ checkoutId ): array
0 commit comments