Skip to content

Commit

Permalink
access store id from order when available
Browse files Browse the repository at this point in the history
  • Loading branch information
taehyunlim committed Oct 26, 2021
1 parent 195ce99 commit 7c61472
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Gateway/Http/TransferFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ class TransferFactory extends AbstractTransferFactory
public function create(array $request)
{
$method = isset($request['method']) ? $request['method'] : ClientService::POST;
$storeId = $this->getStoreId();
// Admin actions will include store id in the request
$storeId = isset($request['storeId']) ? $request['storeId'] : $this->getStoreId();
return $this->transferBuilder
->setMethod($method)
->setHeaders(['Content-Type' => 'application/json'])
Expand Down
4 changes: 1 addition & 3 deletions Gateway/Request/CaptureRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ public function build(array $buildSubject)
$transactionId = $payment->getAdditionalInformation(self::TRANSACTION_ID) ?:
$payment->getAdditionalInformation(self::CHARGE_ID);
$order = $payment->getOrder();
if($order) {
$storeId = $this->_storeManager->getStore()->getId();
}
$storeId = isset($order) ? $order->getStoreId() : $this->_storeManager->getStore()->getId();
if (!$storeId) {
$storeId = null;
}
Expand Down

0 comments on commit 7c61472

Please sign in to comment.