Error programmaticaly adding image to node using file_copy
You can try this code:

//$filepath = drupal_realpath('misc/image.jpeg');
 [**UPDATED ANSWER**:]
 $filepath =  $_SERVER['DOCUMENT_ROOT'].base_path() .drupal_get_path('module','payment_details').'/MDSO_20.jpg';


$file = (object) array(
       'uid' =&gt; 1,
       'uri' =&gt; $filepath,
       'filemime' =&gt; file_get_mimetype($filepath),
       'status' =&gt; 1,
  );
  $file = file_copy($file, 'public://');
  $node-&gt;field_image[LANGUAGE_NONE][0] = (array)$file;
  node_save($node);


Hope this works for you :)

For me it created a node as you below :)