sofwar/trade-opskins-api 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sofwar/trade-opskins-api

Composer 安装命令:

composer require sofwar/trade-opskins-api

包简介

A Trade Opskins API client for PHP.

README 文档

README

Latest Stable Version Total Downloads Latest Unstable Version License StyleCI

This is the unofficial client library for the Opskins Trade API. We provide an intuitive, stable interface to integrate Opskins Trade API into your PHP project.

Installation

Install the library using Composer. Please read the Composer Documentation if you are unfamiliar with Composer or dependency managers in general.

composer require sofwar/trade-opskins-api
require __DIR__.'/../vendor/autoload.php';

$opskins = new \SofWar\Opskins\Opskins();

Access Token

You can use both a user access token and api key

ACCESS_TOKEN = XXXXXXXABH5IABYKNAAAABlcY8Lgurj5K+LRRA3UYeg2e3OQaXWLZC3OKXXrxjxCFof5YHQ=
ACCESS_TOKEN = xxxxb65b683xxde1553892d3b1xxx

Initialization

$opskins = new Opskins();

Also you can initialize Opskins with the default access token

$opskins = new Opskins('ACCESS_TOKEN');   

OR

$opskins = new Opskins(');  
$opskins->setAccessToken('ACCESS_TOKEN'); 

Authorization

The library provides the authorization flows for user based on OAuth 2.0 protocol implementation in Opskins API. Please read the full documentation before you start.

Authorization Code Flow

For getting user access key use following command:

$client_id = 'XXXXX';
$client_secret = 'XXXXXXXXXXXX';

$oauth = new \SofWar\Opskins\OpskinsOAuth($client_id, $client_secret);

$state = 'secret_state_code';

$browser_url = $oauth->getAuthorizeUrl($state, ['identity_basic', 'items']);

After successful authorization user's browser will be redirected to the specified redirect_uri. Meanwhile the code will be sent as a GET parameter to the specified address:

https://example.com?code=CODE&state=STATE

Then use this method to get the access token:

$client_id = 'XXXXX';
$client_secret = 'XXXXXXXXXXXX';

$oauth = new \SofWar\Opskins\OpskinsOAuth($client_id, $client_secret);

$response = $oauth->getAccessToken($_GET['code']);

$access_token = $response['access_token'];

API Request

You can find the full list of Opskins Trade API methods here.

Examples

All examples can be found here

TODO

  • ICase
    • GetCaseSchema
    • GetCaseOdds
    • GetMinimumOpenVolume
    • OpenWithKeys
  • ICaseSite
    • GetKeyCount
    • GetTradeStatus
    • SendKeyRequest
    • UpdateCommissionSettings
  • IEthereum
    • GetContractAddress
  • IItem
    • GetAllItems
    • GetItemsById
    • WithdrawToOpskins
    • GetItemDefinitions
    • GetRarityStats
    • InstantSellRecentItems
  • ITest
    • Test
    • TestAuthed
    • TestBody
  • ITrade
    • AcceptOffer
    • CancelOffer
    • GetApps
    • GetOffer
    • GetOffers
    • GetTradeURL
    • GetUserInventory
    • GetUserInventoryFromSteamId
    • RegenerateTradeUrl
    • SendOffer
    • SendOfferToSteamId
  • IUser
    • CreateVCaseUser
    • GetInventory
    • GetProfile
    • UpdateProfile
    • UserReports

统计信息

  • 总下载量: 23
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-02-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固