.

 
.
 
A pending order can't be "closed", it has to be deleted. Check the documentation for OrderDelete().