channelengine/merchant-api-client-php

ChannelEngine API 适用于商家

2.13.0 2022-09-09 09:46 UTC

README

No Maintenance Intended

商户API客户端库的弃用

此库不再由ChannelEngine支持。要使用您选择的编程语言通过OpenAPI Generator构建自己的库,请参阅我们帮助中心的商户API:API客户端文章。

ChannelEngine的API遵循OpenAPI/Swagger规范,您可以在我们的API参考中找到。

开发者额外信息

有关ChannelEngine API的详细信息,请访问我们帮助中心的REST APIs分类

安装与使用

Composer

要通过Composer安装绑定,请将以下内容添加到composer.json

{
  "require": {
    "channelengine/merchant-api-client-php": "*"
  }
}

然后运行composer install

入门指南

请按照安装程序进行操作,然后运行以下命令

<?php
require_once(__DIR__ . '/vendor/autoload.php');

use ChannelEngine\Merchant\ApiClient\Configuration;
use ChannelEngine\Merchant\ApiClient\ApiException;
use ChannelEngine\Merchant\ApiClient\Api\OrderApi;

$apiConfig = Configuration::getDefaultConfiguration();
$apiConfig->setHost('https://demo.channelengine.net/api');
$apiConfig->setApiKey('apikey', 'xxxxxxxxxxxx');

$orderApi = new OrderApi(null, $apiConfig);

try {
	$response = $orderApi->orderGetNew();
	dd($response);
} catch (ApiException $e) {
	// In case of a non-2xx status an exception will be trown.
	// However, we can check getResponseBody() to get the deserialized response.
	echo($e->getMessage());
	dd($e->getResponseBody());
}

function dd($var) {
	echo("<pre>");
	print_r($var);
	echo("</pre>");
}