20
20
use Psr \Log \LoggerInterface ;
21
21
use Rvvup \Payments \Exception \PaymentValidationException ;
22
22
use Rvvup \Payments \Gateway \Method ;
23
+ use Rvvup \Payments \Model \Config \RvvupConfigurationInterface ;
23
24
use Rvvup \Payments \Model \ConfigInterface ;
24
25
use Rvvup \Payments \Model \ProcessRefund \ProcessorPool as RefundPool ;
25
26
use Rvvup \Payments \Model \Webhook \WebhookEventType ;
@@ -35,7 +36,7 @@ class Index implements HttpPostActionInterface, CsrfAwareActionInterface
35
36
/** @var RequestInterface */
36
37
private $ request ;
37
38
38
- /** @var ConfigInterface */
39
+ /** @var RvvupConfigurationInterface */
39
40
private $ config ;
40
41
41
42
/** @var ResultFactory */
@@ -73,7 +74,7 @@ class Index implements HttpPostActionInterface, CsrfAwareActionInterface
73
74
* @param RequestInterface $request
74
75
* @param StoreRepositoryInterface $storeRepository
75
76
* @param Http $http
76
- * @param ConfigInterface $config
77
+ * @param RvvupConfigurationInterface $config
77
78
* @param ResultFactory $resultFactory
78
79
* @param LoggerInterface $logger
79
80
* @param WebhookRepository $webhookRepository
@@ -86,7 +87,7 @@ public function __construct(
86
87
RequestInterface $ request ,
87
88
StoreRepositoryInterface $ storeRepository ,
88
89
Http $ http ,
89
- ConfigInterface $ config ,
90
+ RvvupConfigurationInterface $ config ,
90
91
ResultFactory $ resultFactory ,
91
92
LoggerInterface $ logger ,
92
93
WebhookRepository $ webhookRepository ,
@@ -131,12 +132,12 @@ public function execute(): ResultInterface
131
132
$ storeId = $ this ->getStoreId ($ quote , $ order );
132
133
133
134
// Merchant ID does not match, no need to process
134
- if ($ merchantId !== $ this ->config ->getMerchantId ()) {
135
+ if ($ merchantId !== $ this ->config ->getMerchantId ($ storeId )) {
135
136
return $ this ->returnSkipResponse (
136
137
'Invalid merchant id ' ,
137
138
[
138
139
'merchant_id ' => $ merchantId ,
139
- 'config_merchant_id ' => $ this ->config ->getMerchantId (),
140
+ 'config_merchant_id ' => $ this ->config ->getMerchantId ($ storeId ),
140
141
'rvvup_id ' => $ rvvupOrderId
141
142
]
142
143
);
@@ -279,19 +280,19 @@ private function returnExceptionResponse(): ResultInterface
279
280
/**
280
281
* @param Quote|null $quote
281
282
* @param OrderInterface|null $order
282
- * @return int
283
+ * @return string
283
284
* @throws NoSuchEntityException
284
285
*/
285
- private function getStoreId (?Quote $ quote , ?OrderInterface $ order ): int
286
+ private function getStoreId (?Quote $ quote , ?OrderInterface $ order ): string
286
287
{
287
288
if (isset ($ quote )) {
288
- return $ quote ->getStoreId ();
289
+ return ( string ) $ quote ->getStoreId ();
289
290
}
290
291
if (isset ($ order ) && $ order ->getId ()) {
291
- return $ order ->getStoreId ();
292
+ return ( string ) $ order ->getStoreId ();
292
293
}
293
294
294
- return (int ) $ this ->storeManager ->getStore ()->getId ();
295
+ return (string ) $ this ->storeManager ->getStore ()->getId ();
295
296
}
296
297
297
298
private function orderOrQuoteResolver ($ rvvupOrderId , $ paymentLinkId , $ checkoutId ): array
0 commit comments