承接 mywaygames/api-client 相关项目开发

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

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

mywaygames/api-client

Composer 安装命令:

composer require mywaygames/api-client

包简介

A PHP API client for Myway Games shop API

README 文档

README

A client for MywayGames shop API

MywayGames API Client is a PHP library that helps you integrate your MywayGames account into your own e-commerce system, allowing you to place orders, query balance, list products, sync prices automatically.

For more info please view MywayGames API Documentation

Installation

Using composer

composer require mywaygames/api-client

If you receive an error Could not find a version of package mywaygames/api-client please upgrade to composer 2

From github

git clone https://github.com/mywaygames/api-client.git
cd api-client
composer install

Usage

After including vendor/autoload.php you can initiate the client like this:

$apiClient = new MywayGames\ApiClient;

// Set the API base URI, if you are not sure please contact your admin
$apiClient->setBaseUri('https://test.myway-games.com/api/v1/');

To get a test account (only available on test.myway-games.com):

var_dump($apiClient->createTestAccount()->response());

To authenticate with the API using your username/password:

$apiClient->auth(["username" => "YOUR_USERANEM","password" => "YOUR_USERANEM"]);

Authenticate using a valid API token (api_key)

$apiClient->auth(["api_key" => "YOUR_API_KEY"]);

Get your account info

$apiClient->getUserData()->response()->userdata;

Get your account balance

$apiClient->getUserData()->response()->userdata->balance;

Get a list of main products

$apiClient->products()->response();

Get a list of ALL denominations

$apiClient->denominations('all')->response();

Get a list of main products

$apiClient->products()->response();

Get a list of denominations for a specific category i.e: 2

$apiClient->denominations(2)->response();

Create an order

$order_args = [];

// Unuque uuidv4 token that you need to generate to avoid placing duplicate orders.
$order_args['orderToken'] = $apiClient->generateToken();

// The denomination_id you want to buy "which you received by calling ->denominations()"
$order_args['denomination_id'] = 1;

// Optional, default is 1
$order_args['qty'] = 1;

// Required only if the product you want to order is a topup product "i.e has require_playerid = true"
$order_args['args'] = ["playerid" => "111"];

var_dump($apiClient->createOrder($order_args)->response());

Check the status of your order "Typically orders take 2 minutes to be processed"

$apiClient->orderDetails(21)->response();

Dependencies

MywayGames API Client uses guzzlehttp to connect to the remote API

Dependency README
Guzzlehttp Github

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-02-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固