mehr-it / otto-receipts-api-client
Swagger 生成的 Otto 收款 API 的 PHP 客户端
2.0.1
2020-12-14 10:38 UTC
Requires
- php: >=5.5
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^6.2|^7.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ~1.12
- phpunit/phpunit: ^4.8
- squizlabs/php_codesniffer: ~2.6
This package is auto-updated.
Last update: 2024-09-14 19:31:33 UTC
README
合作伙伴获取收据信息的接口
此 PHP 包由 Swagger Codegen 项目自动生成
- API 版本:2.0.0
- 构建包:io.swagger.codegen.v3.generators.php.PhpClientCodegen
要求
PHP 5.5 及以上版本
安装和用法
Composer
要通过 Composer 安装绑定,请将以下内容添加到 composer.json
{
"repositories": [
{
"type": "git",
"url": "https://github.com/mehr-it/otto-receipts-api-client.git"
}
],
"require": {
"mehr-it/otto-receipts-api-client": "*@dev"
}
}
然后运行 composer install
手动安装
下载文件并包含 autoload.php
require_once('/path/to/./vendor/autoload.php');
测试
要运行单元测试
composer install
./vendor/bin/phpunit
入门指南
请按照 安装过程 进行操作,然后运行以下命令
<?php require_once(__DIR__ . '/vendor/autoload.php'); $apiInstance = new MehrIt\OttoReceiptsApiClient\Api\ReceiptsApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); $receipt_number = "receipt_number_example"; // string | ReceiptNumber try { $apiInstance->getReceiptPdfUsingGET3($receipt_number); } catch (Exception $e) { echo 'Exception when calling ReceiptsApi->getReceiptPdfUsingGET3: ', $e->getMessage(), PHP_EOL; } $apiInstance = new MehrIt\OttoReceiptsApiClient\Api\ReceiptsApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); $receipt_number = "receipt_number_example"; // string | ReceiptNumber try { $result = $apiInstance->getReceiptUsingGET5($receipt_number); print_r($result); } catch (Exception $e) { echo 'Exception when calling ReceiptsApi->getReceiptUsingGET5: ', $e->getMessage(), PHP_EOL; } $apiInstance = new MehrIt\OttoReceiptsApiClient\Api\ReceiptsApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); $limit = 128; // int | Page size to limit the number of receipts returned in the response $page = 1; // int | Page number to fetch. This parameter is required to fetch data for specific page number $type = "type_example"; // string | Search for receipts filtered by receipt type $sales_order_id = "sales_order_id_example"; // string | Search for receipts filtered by sales order Id try { $result = $apiInstance->getReceiptsUsingGET5($limit, $page, $type, $sales_order_id); print_r($result); } catch (Exception $e) { echo 'Exception when calling ReceiptsApi->getReceiptsUsingGET5: ', $e->getMessage(), PHP_EOL; } ?>
API 端点文档
所有 URI 都是相对于 https://live.api.otto.market/
模型文档
- AllOfLineItemTotal
- AllOfLineItemUnitPrice
- AllOfPartialRefundPartialRefundAmount
- AllOfShippingFeePrice
- AllOfTotalAmountDue
- AllOfTotalGross
- AllOfTotalNet
- Customer
- DeliveryAddress
- LineItem
- Link
- PartialRefund
- Partner
- Receipt
- ReceiptsList
- ShippingCost
- ShippingFee
- Total
授权文档
JWT
- 类型:API密钥
- API密钥参数名:Authorization
- 位置:HTTP头