lox/localbtc-php 问题修复 & 功能扩展

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

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

lox/localbtc-php

Composer 安装命令:

composer require lox/localbtc-php

包简介

PHP client for Localbitcoins.com

README 文档

README

This is a (work-in-progress) client for the LocalBitcoins.com API:

https://localbitcoins.com/api-docs/

TODO

API methods:

  • Authentication
  • AccountInfo
  • Myself
  • Escrows
  • EscrowRelease
  • Ads
  • AdUpdate

Other stuff:

  • Custom errors
  • AccountInfo

Installing

Install with composer:

git clone https://github.com/lox/localbtc-php.git
composer install

Authenticating

The API uses OAuth2, so it's somewhat annoying to authenticate to for console apps. First you need to register an application and generate a client ID and client secret in the API console:

https://localbitcoins.com/accounts/api/

Then use these commands to generate a access_token:

export LOCALBITCOINS_CLIENT_ID=1234567
export LOCALBITCOINS_CLIENT_SECRET=123456

php oauth.php --authorize

Click the link generated, grant the application access in your localbitcoins.com account.

Copy the access_token from the output for the below example.

Usage

<?php

$client = \LocalBtc\Client::factory(array(
    'client_identifier' => '1234567',
    'access_token' => 'generated access token goes here',
));

// get data about yourself
$myself = $client->myself()->get('data');

// get data about someone
$someone = $client->accountInfo(array('username'=>'someone'))->get('data');

// get your escrows
$escrows = $client->escrows()->get('data');

// release an escrow
$client->releaseEscrow(array('escrow_id'=>123456));

统计信息

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

GitHub 信息

  • Stars: 12
  • Watchers: 7
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2013-10-20