fix base url
This commit is contained in:
		
							parent
							
								
									9b0043949a
								
							
						
					
					
						commit
						9943a83507
					
				|  | @ -24,9 +24,9 @@ final class Index | ||||||
| 
 | 
 | ||||||
|     protected function _client() |     protected function _client() | ||||||
|     { |     { | ||||||
|  | 
 | ||||||
|         $client = new Client([ |         $client = new Client([ | ||||||
|             'headers' => $this->_headers(), |             'headers' => $this->_headers() | ||||||
|             'base_url' => $this->_config['url'], |  | ||||||
|         ]); |         ]); | ||||||
| 
 | 
 | ||||||
|         return $client; |         return $client; | ||||||
|  | @ -51,6 +51,12 @@ final class Index | ||||||
|                 $payload['details'][] = (new Detail($item))->jsonSerialize(); |                 $payload['details'][] = (new Detail($item))->jsonSerialize(); | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|  |             $this->_client()->post($this->_config['url'], [ | ||||||
|  |                 'body' => [ | ||||||
|  |                     "magento_2_" . time() => $payload | ||||||
|  |                 ] | ||||||
|  |             ]); | ||||||
|  | 
 | ||||||
|             return json_encode($payload); |             return json_encode($payload); | ||||||
|         } else { |         } else { | ||||||
|             throw new \ErrorException('$order is not instance \Magento\Sales\Model\Order\Interceptor'); |             throw new \ErrorException('$order is not instance \Magento\Sales\Model\Order\Interceptor'); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue