/**
  * Post a product to BC
  */
 public function postProductAction(Request $request, Application $app)
 {
     $request_data = $this->initRequestData($request, $app);
     $client = $this->legacyAPIClient($request_data['legacy_api_info']);
     $wombat_data = $request->request->get('product');
     $bcModel = new Product($wombat_data, 'wombat', $client, $request_data);
     $bc_data = $bcModel->getBigCommerceObject('create');
     // $bcModel->pushAttachedResources();
     // return print_r("HI".PHP_EOL,true);
     $options = array('headers' => array('Content-Type' => 'application/json'), 'body' => (string) json_encode($bc_data));
     try {
         $response = $client->post('products', $options);
     } catch (\Exception $e) {
         throw new \Exception($request_data['request_id'] . ":::::Error received from BigCommerce:::::" . $e->getResponse()->getBody(), 500);
     }
     $bcModel->pushAttachedResources();
     // if($wombat_request = $this->initWombatData($request,$app)) {
     // 	$wombatClient = $this->wombatClient($wombat_request);
     // 	//$bcModel->addWombatClient();
     // 	$bcModel->pushBigCommerceIDs($wombatClient,$request_data);
     // }
     // @todo: the Guzzle client will intervene with its own error response before we get to our error below,
     // make it not do that or catch an exception rather than checking code
     if ($response->getStatusCode() != 201) {
         throw new Exception($request_data['request_id'] . ":::::Error received from BigCommerce:::::" . $response->getBody(), 500);
     } else {
         $wombat = $bcModel->getWombatResponse();
         //return our success code & data
         $response = array('request_id' => $request_data['request_id'], 'summary' => "The product {$bc_data->name} was created in BigCommerce", 'products' => array($wombat));
         return $app->json($response, 200);
     }
 }