vismutx / klarna-order-management-api-php
用于PHP的Klarna订单管理API,由swagger生成
1.06
2022-04-23 17:35 UTC
Requires
- php: >=5.5
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^6.2||^7.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ~2.12
- phpunit/phpunit: ^4.8
- squizlabs/php_codesniffer: ~2.6
README
处理订单生命周期的API
此PHP包由Swagger Codegen项目自动生成
- API版本:1.0
- 构建包:io.swagger.codegen.languages.PhpClientCodegen
要求
PHP 5.5及以上
安装与使用
Composer
要通过Composer安装绑定,请运行composer require vismutx/klarna-order-management-api-php
手动安装
下载文件并包含autoload.php
require_once('/path/to/vendor/autoload.php');
测试
要运行单元测试
composer install
./vendor/bin/phpunit
入门
请按照安装过程进行操作,然后运行以下命令
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure HTTP basic authorization: basicAuth $config = Vismutx\KlarnaOrderManagementApiPhp\Configuration::getDefaultConfiguration() ->setUsername('YOUR_USERNAME') ->setPassword('YOUR_PASSWORD'); $apiInstance = new Vismutx\KlarnaOrderManagementApiPhp\Api\CapturesApi( // 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(), $config ); $order_id = "order_id_example"; // string | Order id $capture_id = "capture_id_example"; // string | Capture id $body = new \Vismutx\KlarnaOrderManagementApiPhp\Model\UpdateShippingInfo(); // \Vismutx\KlarnaOrderManagementApiPhp\Model\UpdateShippingInfo | $klarna_idempotency_key = "klarna_idempotency_key_example"; // string | This header will guarantee the idempotency of the operation. The key should be unique and is recommended to be a UUID version 4. Retries of requests are safe to be applied in case of errors such as network errors, socket errors and timeouts. try { $apiInstance->appendShippingInfo($order_id, $capture_id, $body, $klarna_idempotency_key); } catch (Exception $e) { echo 'Exception when calling CapturesApi->appendShippingInfo: ', $e->getMessage(), PHP_EOL; } ?>
API端点的文档
所有URI都是相对于https://api.klarna.com
模型的文档
- 附加组件
- 地址
- 取消不允许错误消息
- 捕获
- 捕获不允许错误消息
- 捕获对象
- 承运人产品
- 客户
- 错误消息Dto
- 延期到期选项
- 延期到期请求
- 初始支付方式Dto
- 位置
- 无此类捕获错误消息
- 无此类订单错误消息
- 不允许错误消息
- 未找到错误消息
- 选项Dto
- 订单
- 订单行
- 产品标识符
- 退款
- 退款不允许错误消息
- 退款对象
- 选择配送选项Dto
- 配送信息
- 时间段
- 更新授权
- 更新消费者
- 更新商家参考
- 更新配送信息
授权文档
基本认证
- 类型:HTTP基本认证