vismutx/klarna-order-management-api-php

用于PHP的Klarna订单管理API,由swagger生成

1.06 2022-04-23 17:35 UTC

This package is auto-updated.

Last update: 2024-09-23 22:36:31 UTC


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

模型的文档

授权文档

基本认证

  • 类型:HTTP基本认证

作者