But in kiteconnect.php, the function is defined as,
public function exitOrder($params) { return $this->cancelOrder($params); }
However, cancelOrder function looks like, public function cancelOrder($variety, $order_id, $params=null) {
Obviously, it is throwing an exception, [Thu Feb 22 10:45:55.856893 2018] [:error] [pid 1636] [client IP:61223] PHP Warning: Missing argument 2 for KiteConnect::cancelOrder(), called in kiteconnect.php on line 423 and defined in kiteconnect.php on line 401
Our system CO squareoff function across all algos have gone for a six, the moment we migrated to 3.0.
[Thu Feb 22 15:05:17.432210 2018] [:error] [pid 7500] [client IP:56434] PHP Warning: Missing argument 2 for KiteConnect::cancelOrder(), called in kiteconnect.php on line 423 and defined in kiteconnect.php on line 401 [Thu Feb 22 15:05:17.432270 2018] [:error] [pid 7500] [client IP:56434] PHP Notice: Undefined variable: order_id in kiteconnect.php on line 407
To save our time & effort, please actually try it out, verify that it works and then let me know.
$params = array( "variety" => "co", "order_id" => "180222000270507", "parent_order_id" => "6546" );
$order_id = $kite->exitOrder( $params );
$order_id = $kite->exitOrder("co", "180222000270507", array("parent_order_id" => "6546" ));
refer: https://github.com/zerodhatech/phpkiteconnect/blob/kite3/kiteconnect.php?utf8=✓#L413-L422
$order_id = $kite->exitOrder( "co", "180222000270507", array( "parent_order_id" => "6546") );
is throwing the following exception,
[Thu Feb 22 15:05:17.432210 2018] [:error] [pid 7500] [client IP:56434] PHP Warning: Missing argument 2 for KiteConnect::cancelOrder(), called in kiteconnect.php on line 423 and defined in kiteconnect.php on line 401
[Thu Feb 22 15:05:17.432270 2018] [:error] [pid 7500] [client IP:56434] PHP Notice: Undefined variable: order_id in kiteconnect.php on line 407
To save our time & effort, please actually try it out, verify that it works and then let me know.
Obviously You and I are using different kiteconnect.php files.
To give you more info, I am using kiteconnect.php downloaded from https://github.com/zerodhatech/phpkiteconnect/releases/tag/v3.0.0-beta1 . I have downloaded it today morning.
Please clarify.
Otherwise you could have downloaded the php file from the kite3 branch manually as mentioned here https://github.com/zerodhatech/phpkiteconnect#installing
Hope it works.
My code is,
$kite = new KiteConnect($api_key);
$kite->setAccessToken( $key );
$order_id = $kite->exitOrder( "co", "180222000270507", array( "parent_order_id" => "6546") );
This same code works with beta1 without the above error (but exitOrder() doesn't work).
Please see & let me know.
As I said, the auth is working fine with beta1 version of kiteconnect.php.
Please fix this issue properly in your next release.
Double tested it.