SHARE
TWEET

Untitled

a guest Aug 20th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. protected function sendLead(array $order)
  2.     {
  3.         $this->logAction('Sending', $order);
  4.        
  5.         $trackId = $this->getTrackingLink($order);
  6.  
  7.         $data = array_merge(
  8.             ['track_id' => $trackId],
  9.             $this->orderToLeadRockStructure($order)
  10.         );
  11.  
  12.         $answer = $this->client->post(
  13.             $this->configs['baseUrl'] . '/lead/save',
  14.             ['form_params' => $this->sign($data)]
  15.         );
  16.        
  17.         if ($answer->getStatusCode() != 200) {
  18.             $data['result_message'] = 'Status code ' . $answer->getStatusCode();
  19.         } else {
  20.             $data['raw_response'] = substr($answer->getStatusCode() . ' - ' . $answer->getBody()->getContents(), 0, 255);
  21.         }
  22.    
  23.         if (!isset($data['message'])) {
  24.             $data['result_message'] = 'Sent';
  25.         }
  26.        
  27.         $order['sended_data'] = $data;
  28.        
  29.         return $order;
  30.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top