Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ A PHP client library for the PAY.JP v2 API. This SDK provides a convenient way t
This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: `2.0.0`
- Package version: `1.0.10`
- Package version: `1.1.0`
- Generator version: `7.14.0`
- Build package: `org.openapitools.codegen.languages.PhpClientCodegen`

Expand Down Expand Up @@ -234,11 +234,13 @@ Class | Method | HTTP request | Description
- [PaymentTransactionResponse](docs/Model/PaymentTransactionResponse.md)
- [PaymentTransactionType](docs/Model/PaymentTransactionType.md)
- [PriceCreateRequest](docs/Model/PriceCreateRequest.md)
- [PriceDataRequest](docs/Model/PriceDataRequest.md)
- [PriceDetailsResponse](docs/Model/PriceDetailsResponse.md)
- [PriceListResponse](docs/Model/PriceListResponse.md)
- [PriceType](docs/Model/PriceType.md)
- [PriceUpdateRequest](docs/Model/PriceUpdateRequest.md)
- [ProductCreateRequest](docs/Model/ProductCreateRequest.md)
- [ProductDataRequest](docs/Model/ProductDataRequest.md)
- [ProductDeletedResponse](docs/Model/ProductDeletedResponse.md)
- [ProductDetailsResponse](docs/Model/ProductDetailsResponse.md)
- [ProductListResponse](docs/Model/ProductListResponse.md)
Expand Down Expand Up @@ -306,6 +308,6 @@ vendor/bin/phpunit
This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: `2.0.0`
- Package version: `1.0.10`
- Package version: `1.1.0`
- Generator version: `7.14.0`
- Build package: `org.openapitools.codegen.languages.PhpClientCodegen`
2 changes: 1 addition & 1 deletion docs/Model/CustomerUpdateRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**defaultPaymentMethodId** | **string** | | [optional]
**defaultPaymentMethodId** | **string** | 支払いにデフォルトで使用される支払い方法 ID | [optional]
**email** | **string** | 顧客のメールアドレス。メールアドレスの形式が正しいかどうかは検証されます。 | [optional]
**description** | **string** | 顧客オブジェクトに付加できる任意の文字列です。管理画面で顧客と一緒に表示されます。 | [optional]
**metadata** | **array<string,mixed>** | キーバリューの任意のデータを格納できます。20件まで登録可能で、空文字列を指定するとそのキーを削除できます。&lt;a href&#x3D;\&quot;https://docs.pay.jp/v2/guide/developers/metadata\&quot;&gt;詳細はメタデータのドキュメントを参照してください。&lt;/a&gt; | [optional]
Expand Down
3 changes: 2 additions & 1 deletion docs/Model/LineItemRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**priceId** | **string** | 料金 ID |
**priceId** | **string** | | [optional]
**priceData** | [**\PAYJPV2\Model\PriceDataRequest**](PriceDataRequest.md) | | [optional]
**quantity** | **int** | 購入する商品の数量 |
**taxRates** | **string[]** | 税率 ID | [optional]

Expand Down
12 changes: 12 additions & 0 deletions docs/Model/PriceDataRequest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# # PriceDataRequest

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**currency** | [**\PAYJPV2\Model\Currency**](Currency.md) | 通貨。現在は &#x60;jpy&#x60; のみサポートしています。 |
**unitAmount** | **int** | 単価(0以上の整数) |
**productId** | **string** | | [optional]
**productData** | [**\PAYJPV2\Model\ProductDataRequest**](ProductDataRequest.md) | | [optional]

[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
10 changes: 10 additions & 0 deletions docs/Model/ProductDataRequest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# # ProductDataRequest

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **string** | Checkout などで顧客に表示される商品名 |
**description** | **string** | | [optional]

[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
19 changes: 17 additions & 2 deletions lib/Api/PaymentRefundsApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public function getConfig()
*
* @throws \PAYJPV2\ApiException on non-2xx response or if the response body is not in the expected format
* @throws \InvalidArgumentException
* @return \PAYJPV2\Model\PaymentRefundResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse
* @return \PAYJPV2\Model\PaymentRefundResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse
*/
public function createPaymentRefund($paymentRefundCreateRequest, ?string $idempotencyKey = null)
{
Expand All @@ -163,7 +163,7 @@ public function createPaymentRefund($paymentRefundCreateRequest, ?string $idempo
*
* @throws \PAYJPV2\ApiException on non-2xx response or if the response body is not in the expected format
* @throws \InvalidArgumentException
* @return array of \PAYJPV2\Model\PaymentRefundResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings)
* @return array of \PAYJPV2\Model\PaymentRefundResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings)
*/
public function createPaymentRefundWithHttpInfo($paymentRefundCreateRequest, ?string $idempotencyKey = null)
{
Expand Down Expand Up @@ -218,6 +218,12 @@ public function createPaymentRefundWithHttpInfo($paymentRefundCreateRequest, ?st
$request,
$response,
);
case 402:
return $this->handleResponseWithDataType(
'\PAYJPV2\Model\ErrorResponse',
$request,
$response,
);
}


Expand Down Expand Up @@ -277,6 +283,15 @@ public function createPaymentRefundWithHttpInfo($paymentRefundCreateRequest, ?st
);
$e->setResponseObject($data);

throw $e;
case 402:
$data = ObjectSerializer::deserialize(
$e->getResponseBody(),
'\PAYJPV2\Model\ErrorResponse',
$e->getResponseHeaders()
);
$e->setResponseObject($data);

throw $e;
}

Expand Down
6 changes: 3 additions & 3 deletions lib/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class Configuration
*
* @var string
*/
protected $userAgent = 'payjp/payjpv2 PHPBindings/1.0.10';
protected $userAgent = 'payjp/payjpv2 PHPBindings/1.1.0';

/**
* Debug switch (default set to false)
Expand Down Expand Up @@ -339,7 +339,7 @@ public function getUserAgent(): string
public static function buildClientUserAgent(): string
{
$uaInfo = [
'bindings_version' => '1.0.10',
'bindings_version' => '1.1.0',
'lang' => 'php',
'lang_version' => PHP_VERSION,
'publisher' => 'payjp',
Expand Down Expand Up @@ -458,7 +458,7 @@ public static function toDebugReport()
$report .= ' OS: ' . php_uname() . PHP_EOL;
$report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL;
$report .= ' The version of the OpenAPI document: 2.0.0' . PHP_EOL;
$report .= ' SDK Package Version: 1.0.10' . PHP_EOL;
$report .= ' SDK Package Version: 1.1.0' . PHP_EOL;
$report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL;

return $report;
Expand Down
13 changes: 3 additions & 10 deletions lib/Model/CustomerUpdateRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class CustomerUpdateRequest implements ModelInterface, ArrayAccess, \JsonSeriali
* @var bool[]
*/
protected static array $openAPINullables = [
'defaultPaymentMethodId' => true,
'defaultPaymentMethodId' => false,
'email' => false,
'description' => false,
'metadata' => false,
Expand Down Expand Up @@ -332,21 +332,14 @@ public function getDefaultPaymentMethodId(): ?string
/**
* Sets defaultPaymentMethodId
*
* @param string|null $defaultPaymentMethodId defaultPaymentMethodId
* @param string|null $defaultPaymentMethodId 支払いにデフォルトで使用される支払い方法 ID
*
* @return self
*/
public function setDefaultPaymentMethodId(?string $defaultPaymentMethodId): self
{
if (is_null($defaultPaymentMethodId)) {
array_push($this->openAPINullablesSetToNull, 'defaultPaymentMethodId');
} else {
$nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
$index = array_search('defaultPaymentMethodId', $nullablesSetToNull);
if ($index !== false) {
unset($nullablesSetToNull[$index]);
$this->setOpenAPINullablesSetToNull($nullablesSetToNull);
}
throw new \InvalidArgumentException('non-nullable defaultPaymentMethodId cannot be null');
}
$this->container['defaultPaymentMethodId'] = $defaultPaymentMethodId;

Expand Down
67 changes: 54 additions & 13 deletions lib/Model/LineItemRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class LineItemRequest implements ModelInterface, ArrayAccess, \JsonSerializable
*/
protected static $openAPITypes = [
'priceId' => 'string',
'priceData' => '\PAYJPV2\Model\PriceDataRequest',
'quantity' => 'int',
'taxRates' => 'string[]',
];
Expand All @@ -72,6 +73,7 @@ class LineItemRequest implements ModelInterface, ArrayAccess, \JsonSerializable
*/
protected static $openAPIFormats = [
'priceId' => null,
'priceData' => null,
'quantity' => null,
'taxRates' => null,
];
Expand All @@ -82,7 +84,8 @@ class LineItemRequest implements ModelInterface, ArrayAccess, \JsonSerializable
* @var bool[]
*/
protected static array $openAPINullables = [
'priceId' => false,
'priceId' => true,
'priceData' => true,
'quantity' => false,
'taxRates' => false,
];
Expand Down Expand Up @@ -174,6 +177,7 @@ public function isNullableSetToNull(string $property): bool
*/
protected static $attributeMap = [
'priceId' => 'price_id',
'priceData' => 'price_data',
'quantity' => 'quantity',
'taxRates' => 'tax_rates',
];
Expand All @@ -185,6 +189,7 @@ public function isNullableSetToNull(string $property): bool
*/
protected static $setters = [
'priceId' => 'setPriceId',
'priceData' => 'setPriceData',
'quantity' => 'setQuantity',
'taxRates' => 'setTaxRates',
];
Expand All @@ -196,6 +201,7 @@ public function isNullableSetToNull(string $property): bool
*/
protected static $getters = [
'priceId' => 'getPriceId',
'priceData' => 'getPriceData',
'quantity' => 'getQuantity',
'taxRates' => 'getTaxRates',
];
Expand Down Expand Up @@ -258,6 +264,7 @@ public function getModelName()
public function __construct(?array $data = null)
{
$this->setIfExists('priceId', $data ?? [], null);
$this->setIfExists('priceData', $data ?? [], null);
$this->setIfExists('quantity', $data ?? [], null);
$this->setIfExists('taxRates', $data ?? [], null);
}
Expand Down Expand Up @@ -289,9 +296,6 @@ public function listInvalidProperties()
{
$invalidProperties = [];

if ($this->container['priceId'] === null) {
$invalidProperties[] = "'priceId' can't be null";
}
if ($this->container['quantity'] === null) {
$invalidProperties[] = "'quantity' can't be null";
}
Expand All @@ -314,34 +318,71 @@ public function valid()
/**
* Gets priceId
*
* @return string
* @return string|null
*/
public function getPriceId(): string
public function getPriceId(): ?string
{
if ($this->container['priceId'] === null) {
throw new \LogicException('Property "priceId" is required but has not been set.');
}

return $this->container['priceId'];
}

/**
* Sets priceId
*
* @param string $priceId 料金 ID
* @param string|null $priceId priceId
*
* @return self
*/
public function setPriceId(string $priceId): self
public function setPriceId(?string $priceId): self
{
if (is_null($priceId)) {
throw new \InvalidArgumentException('non-nullable priceId cannot be null');
array_push($this->openAPINullablesSetToNull, 'priceId');
} else {
$nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
$index = array_search('priceId', $nullablesSetToNull);
if ($index !== false) {
unset($nullablesSetToNull[$index]);
$this->setOpenAPINullablesSetToNull($nullablesSetToNull);
}
}
$this->container['priceId'] = $priceId;

return $this;
}

/**
* Gets priceData
*
* @return \PAYJPV2\Model\PriceDataRequest|null
*/
public function getPriceData(): ?\PAYJPV2\Model\PriceDataRequest
{
return $this->container['priceData'];
}

/**
* Sets priceData
*
* @param \PAYJPV2\Model\PriceDataRequest|null $priceData priceData
*
* @return self
*/
public function setPriceData(?\PAYJPV2\Model\PriceDataRequest $priceData): self
{
if (is_null($priceData)) {
array_push($this->openAPINullablesSetToNull, 'priceData');
} else {
$nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
$index = array_search('priceData', $nullablesSetToNull);
if ($index !== false) {
unset($nullablesSetToNull[$index]);
$this->setOpenAPINullablesSetToNull($nullablesSetToNull);
}
}
$this->container['priceData'] = $priceData;

return $this;
}

/**
* Gets quantity
*
Expand Down
Loading
Loading