定制 sadovojav/bitcart-sdk-php 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

sadovojav/bitcart-sdk-php

Composer 安装命令:

composer require sadovojav/bitcart-sdk-php

包简介

Bitcart API PHP client library.

README 文档

README

This library makes it easier to integrate Bitcart in your PHP application.

- Package is under development. The main code can completely change

Approach

This library takes an opinionated approach to API with the aim of making your developer life as easy and convenient as possible. For this reason, we have decided to structure arguments a bit differently, but still allow full and advanced use cases.

The general reasoning behind the arguments an API client takes are in this order:

  • First the required parameters => method arguments with NULL not allowed
  • Recommended parameters => method arguments with NULL as default
  • Optional parameters => arguments with NULL as default
  • Lastly the advanced parameters => Inside an extra class

How to use

composer require sadovojav/bitcart-sdk-php
// Require the autoload file.
require __DIR__ . '/../src/autoload.php';

// Example to create user.
$baseUrl = ''; // e.g. https://your.bitract-server.tld

try {
    // POST /users
    $user = (new \Bitcart\Client\User($baseUrl))->createUser(\Bitcart\DTO\UserDto::fromArray([
       'email' => 'user@example.com',
       'password' => 'some_password',
       'settings' => (new \Bitcart\DTO\SettingsDto()),
    ]));
    var_dump($user);
} catch (\Throwable $e) {
    echo "Error: " . $e->getMessage();
}

Checklist

Open

USERS

  • GET /users/stats
  • GET /users/me
  • POST /users/me/settings
  • GET /users/count
  • GET /users/{model_id}
  • DELETE /users/{model_id}
  • PATCH /users/{model_id}
  • GET /users
  • POST /users
  • POST /users/batch

WALLETS

  • GET /wallets/history/all
  • GET /wallets/history/{model_id}
  • GET /wallets/balance
  • GET /wallets/{model_id}/balance
  • GET /wallets/{model_id}/checkin
  • GET /wallets/{model_id}/channels
  • POST /wallets/{model_id}/channels/open
  • POST /wallets/{model_id}/channels/close
  • POST /wallets/{model_id}/inpay
  • GET /wallets/count
  • GET /wallets/{model_id}
  • DELETE /wallets/{model_id}
  • PATCH /wallets/{model_id}
  • GET /wallets
  • POST /wallets POST /wallets/batch

STORES

  • GET /stores/{model_id}/ping
  • PATCH /stores/{model_id}/checkout_settings
  • PATCH /stores/{model_id}/theme_settings
  • PATCH /stores/{model_id}/plugin_settings
  • GET /stores/count
  • GET /stores/{model_id}
  • DELETE /stores/{model_id}
  • PATCH /stores/{model_id}
  • GET /stores
  • POST /stores
  • POST /stores/batch
  • GET /stores/{store_id}/integrations/shopify/{order_id}

INVOICES

  • GET /invoices/order_id/{order_id}
  • GET /invoices/export
  • PATCH /invoices/{model_id}/customer
  • PATCH /invoices/{model_id}/details
  • GET /invoices/count
  • GET /invoices/{model_id}
  • DELETE /invoices/{model_id}
  • PATCH /invoices/{model_id}
  • GET /invoices
  • POST /invoices
  • POST /invoices/batch

PRODUCTS

  • GET /products/maxprice
  • GET /products/categories
  • GET /products/count
  • GET /products/{model_id}
  • DELETE /products/{model_id}
  • PATCH /products/{model_id}
  • GET /products
  • POST /products
  • POST /products/batch

PAYOUTS

  • GET /payouts/count
  • GET /payouts/{model_id}
  • DELETE /payouts/{model_id}
  • PATCH /payouts/{model_id}
  • GET /payouts
  • POST /payouts
  • POST /payouts/batch

TOKEN

  • GET /token
  • POST /token
  • GET /token/current
  • GET /token/count
  • DELETE /token/{model_id}
  • PATCH /token/{model_id}

CRYPTOS

  • GET /cryptos
  • GET /cryptos/supported
  • GET /cryptos/rate
  • GET /cryptos/fiatlist
  • GET /cryptos/tokens/{currency}
  • GET /cryptos/tokens/{currency}/abi
  • GET /cryptos/explorer/{currency}
  • GET /cryptos/rpc/{currency}

Best practices

  • Always use an API key with as little permissions as possible.

Contribute

We run static analyzer Psalm and PHP-CS-fixer for codestyle when you open a pull-request. Please check if there are any errors and fix them accordingly.

Codestyle

We use PSR-12 code style to ensure proper formatting and spacing. You can test and format your code using composer commands. Before doing a PR you can run composer cs-check and composer cs-fix which will run php-cs-fixer.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-11-30