pushpak1300/laravel-phpkiteconnect
Composer 安装命令:
composer require pushpak1300/laravel-phpkiteconnect
包简介
Laravel wrapper for zerodha/phpkiteconnect
README 文档
README
The UnOfficial Laravel client for communicating with the Kite Connect API.
Kite Connect is a set of REST-like APIs that expose many capabilities required to build a complete investment and trading platform. Execute orders in real time, manage user portfolio and more, with the simple HTTP API collection.
Documentation
Installing
Requirements
You can install the package via composer:
composer require pushpak/laravel-phpkiteconnect
Usage
<?php // Assuming you have obtained the `request_token` // after the auth flow redirect by redirecting the // user to KiteConnect::login_url() try { $user = KiteConnect::generateSession("request_token_obtained", "your_api_secret"); echo "Authentication successful. \n"; print_r($user); KiteConnect::setAccessToken($user->access_token); } catch(Exception $e) { echo "Authentication failed: ".$e->getMessage(); throw $e; } echo $user->user_id." has logged in"; // Get the list of positions. echo "Positions: \n"; dump(KiteConnect::getPositions()); // Place order. $order = KiteConnect::placeOrder("regular", [ "tradingsymbol" => "INFY", "exchange" => "NSE", "quantity" => 1, "transaction_type" => "BUY", "order_type" => "MARKET", "product" => "NRML" ]); echo "Order id is ".$order->order_id; ?>
Examples
This package provide laravel facade to make work with KiteConnect Refer to the PHP client documentation for the complete list of supported methods.
Changelog
统计信息
- 总下载量: 9
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-04-17