承接 danielmagacf/steam-trade 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

danielmagacf/steam-trade

Composer 安装命令:

composer require danielmagacf/steam-trade

包简介

README 文档

README

#this package is just a wrapper

To install

composer require danielmagacf/steam-trade

To use

Danielmagacf\SteamTrade\SteamTrader::get($sessionId, $cookiesArray);

php-steam-tradeoffers

Steam Trade Offers library for PHP (based on node.js library by Alex7Kom)

All the same functions as in Alex7Kom library

Note: By using this library you automatically agree to Steam API Terms of Use

Installation

require_once 'classes/steam.class.php'

Usage

Instantiate a steam object...

$steam = new SteamTrade();

...then setup session:

$steam->setup('sessionID', 'cookies');

This setup will automatically register and retrieve Steam API key for you.

Methods

The first param for all methods (except setup) is an associative array of options.

setup(sessionId, cookies)

As noted above, this method is used to setup a web session. It also tries to retrieve Web API key.

Options:

  • sessionID is a valid web session ID.
  • webCookie is an array of cookies.

If failed to retrieve Web API key due to limited account, setup will throw the error.

loadMyInventory(options)

Loads your inventory for the given app and context. For example, use 440 and 2 for TF2 and 570 and 2 for Dota 2.

Options:

  • appId is the Steam AppID
  • contextId is the inventory context Id
  • language (optional) is the language for item descriptions
  • tradableOnly (optional) is a boolean flag that defaults to true to return tradable items only

loadPartnerInventory(options)

Loads your partner inventory for the given app and context.

Options:

  • partnerSteamId is the SteamID of the trade partner
  • appId is the Steam AppID
  • contextId is the inventory context Id
  • tradeOfferId (optional) is needed to load private inventory of the trade partner for received trade offer
  • language (optional) is the language for item descriptions

makeOffer(options)

Makes a trade offer to the partner.

Options:

  • partnerAccountId or partnerSteamId, you need only one of those.
  • accessToken (optional) is a token from the public Trade URL of the partner.
  • itemsFromMe are the items you will lose in the trade.
  • itemsFromThem are the items you will receive in the trade.
  • counteredTradeOffer (optional) is the ID to a trade offer you are countering.
  • message (optional) is a message to include in the offer.

itemsFromMe and itemsFromThem both are arrays of item objects that look like this:

array(
    "appid" => 440,
    "contextid" => 2,
    "amount" => 1,
    "assetid" => "1627590398"
)

If success it will return an object with tradeofferid of the newly created trade offer.

getOffers(options)

getOffer(options)

The first method loads a list of trade offers, and the second loads just a single offer.

Options:

In return you will get an object that Steam Web API returns. The only thing to note is that the wrapper adds a property steamid_other with the SteamID of the trade partner to each CEcon_TradeOffer object in received trades.

declineOffer(options)

acceptOffer(options)

cancelOffer(options)

declineOffer or acceptOffer that was sent to you. cancelOffer that you sent.

Options:

  • tradeOfferId is a trade offer Id

In return you will get an object with response from Steam, but don't expect anything meaningful in it.

getOfferToken()

In return you will get the offer token of the bot, extracted from its trade offer URL.

getItems(options)

Options:

  • tradeId is the ID of the completed trade you want to get items for, available as a tradeid property on offers from getOffers or getOffer

In return you will get an array of items acquired in a completed trade.

danielmagacf/steam-trade 适用场景与选型建议

danielmagacf/steam-trade 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 521 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 12 月 27 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 danielmagacf/steam-trade 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 danielmagacf/steam-trade 我们能提供哪些服务?
定制开发 / 二次开发

基于 danielmagacf/steam-trade 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2022-12-27