diff --git a/README.md b/README.md index 4614f1e..58b09fd 100644 --- a/README.md +++ b/README.md @@ -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.5` +- Package version: `1.0.6` - Generator version: `7.14.0` - Build package: `org.openapitools.codegen.languages.PhpClientCodegen` @@ -146,6 +146,7 @@ Class | Method | HTTP request | Description ## Documentation For Models +- [ApplePayConfigRequest](docs/Model/ApplePayConfigRequest.md) - [BalanceListResponse](docs/Model/BalanceListResponse.md) - [BalanceResponse](docs/Model/BalanceResponse.md) - [BalanceState](docs/Model/BalanceState.md) @@ -306,6 +307,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.5` +- Package version: `1.0.6` - Generator version: `7.14.0` - Build package: `org.openapitools.codegen.languages.PhpClientCodegen` diff --git a/docs/Model/ApplePayConfigRequest.md b/docs/Model/ApplePayConfigRequest.md new file mode 100644 index 0000000..9d3da25 --- /dev/null +++ b/docs/Model/ApplePayConfigRequest.md @@ -0,0 +1,9 @@ +# # ApplePayConfigRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**displayPreference** | [**\PAYJPV2\Model\DisplayPreferenceRequest**](DisplayPreferenceRequest.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PaymentFlowCancelRequest.md b/docs/Model/PaymentFlowCancelRequest.md index a1215af..fc26d22 100644 --- a/docs/Model/PaymentFlowCancelRequest.md +++ b/docs/Model/PaymentFlowCancelRequest.md @@ -4,6 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**cancellationReason** | **string** | この PaymentFlow のキャンセル理由 | 値 | |:---| | **duplicate**: 重複した支払いである場合。 | | **fraudulent**: 不正な利用だと考えられる場合。 | | **requested_by_customer**: 顧客がキャンセルを要求した場合。 | | **abondoned**: 顧客が支払いを完了しなかった場合。 | | [optional] +**cancellationReason** | **string** | この PaymentFlow のキャンセル理由 | 値 | |:---| | **duplicate**: 重複した支払いである場合。 | | **fraudulent**: 不正な利用だと考えられる場合。 | | **requested_by_customer**: 顧客がキャンセルを要求した場合。 | | **abandoned**: 顧客が支払いを完了しなかった場合。 | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PaymentFlowConfirmRequest.md b/docs/Model/PaymentFlowConfirmRequest.md index 929a44b..2ba5fcb 100644 --- a/docs/Model/PaymentFlowConfirmRequest.md +++ b/docs/Model/PaymentFlowConfirmRequest.md @@ -7,8 +7,8 @@ Name | Type | Description | Notes **paymentMethodId** | **string** | 支払い方法 ID。customer_id の指定が必須です。Customer が所持する PaymentMethod のみ指定できます。payment_method_id を指定せず、Customer に default_payment_method_id が設定されている場合はそちらが自動でセットされます。 | [optional] **paymentMethodOptions** | [**\PAYJPV2\Model\PaymentFlowPaymentMethodOptionsRequest**](PaymentFlowPaymentMethodOptionsRequest.md) | この PaymentFlow 固有の支払い方法の設定 | [optional] **paymentMethodTypes** | [**\PAYJPV2\Model\PaymentMethodTypes[]**](PaymentMethodTypes.md) | この PaymentFlow で使用できる支払い方法の種類のリスト。指定しない場合は、PAY.JP は支払い方法の設定から利用可能な支払い方法を動的に表示します。 | [optional] -**captureMethod** | [**\PAYJPV2\Model\CaptureMethod**](CaptureMethod.md) | 支払いの確定方法を指定します。 | 値 | |:---| | **automatic**: (デフォルト) 顧客が支払いを承認すると、自動的に確定させます。 | | **manual**: 顧客が支払いを承認すると一旦確定を保留し、後で Payment Flow の Capture API を使用して確定します。(すべての支払い方法がこれをサポートしているわけではありません)。 | | [optional] +**captureMethod** | [**\PAYJPV2\Model\CaptureMethod**](CaptureMethod.md) | | [optional] **returnUrl** | **string** | 顧客が支払いを完了後かキャンセルした後にリダイレクトされる URL。アプリにリダイレクトしたい場合は URI Scheme を指定できます。 | [optional] -**description** | **string** | オブジェクトにセットする任意の文字列。ユーザーには表示されません。 | [optional] +**description** | **string** | オブジェクトにセットする任意の文字列。 | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PaymentFlowCreateRequest.md b/docs/Model/PaymentFlowCreateRequest.md index f228dcf..5fe9f07 100644 --- a/docs/Model/PaymentFlowCreateRequest.md +++ b/docs/Model/PaymentFlowCreateRequest.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes **captureMethod** | [**\PAYJPV2\Model\CaptureMethod**](CaptureMethod.md) | 支払いの確定方法を指定します。 | 値 | |:---| | **automatic**: (デフォルト) 顧客が支払いを承認すると、自動的に確定させます。 | | **manual**: 顧客が支払いを承認すると一旦確定を保留し、後で Payment Flow の Capture API を使用して確定します。(すべての支払い方法がこれをサポートしているわけではありません)。 | | [optional] **confirm** | **bool** | 「true」に設定すると、この PaymentFlow を直ちに確定しようと試みます。 | [optional] [default to false] **returnUrl** | **string** | 顧客が支払いを完了後かキャンセルした後にリダイレクトされる URL。アプリにリダイレクトしたい場合は URI Scheme を指定できます。confirm=true の場合のみ指定できます。 | [optional] -**description** | **string** | オブジェクトにセットする任意の文字列。ユーザーには表示されません。 | [optional] +**description** | **string** | オブジェクトにセットする任意の文字列。 | [optional] **metadata** | [**array**](MetadataValue.md) | キーバリューの任意のデータを格納できます。20件まで登録可能で、空文字列を指定するとそのキーを削除できます。<a href=\"https://docs.pay.jp/v2/guide/developers/metadata\">詳細はメタデータのドキュメントを参照してください。</a> | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PaymentFlowDataRequest.md b/docs/Model/PaymentFlowDataRequest.md index 67082a8..afc7655 100644 --- a/docs/Model/PaymentFlowDataRequest.md +++ b/docs/Model/PaymentFlowDataRequest.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **captureMethod** | [**\PAYJPV2\Model\CaptureMethod**](CaptureMethod.md) | 支払いの確定方法を指定します。 | 指定できる値 | |:---| | **automatic**: 顧客が支払いを承認すると自動的に確定します。 | | **manual**: 顧客が支払いを承認すると一旦確定を保留し、後で Payment Flow の Capture API を使用して確定します。(すべての支払い方法がこれをサポートしているわけではありません)。 | | [optional] +**description** | **string** | | [optional] **metadata** | [**array**](MetadataValue.md) | キーバリューの任意のデータを格納できます。20件まで登録可能で、空文字列を指定するとそのキーを削除できます。<a href=\"https://docs.pay.jp/v2/guide/developers/metadata\">詳細はメタデータのドキュメントを参照してください。</a> | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PaymentFlowUpdateRequest.md b/docs/Model/PaymentFlowUpdateRequest.md index 4b364f2..27a4bda 100644 --- a/docs/Model/PaymentFlowUpdateRequest.md +++ b/docs/Model/PaymentFlowUpdateRequest.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **paymentMethodOptions** | [**\PAYJPV2\Model\PaymentFlowPaymentMethodOptionsRequest**](PaymentFlowPaymentMethodOptionsRequest.md) | この PaymentFlow 固有の支払い方法の設定 | [optional] **paymentMethodTypes** | [**\PAYJPV2\Model\PaymentMethodTypes[]**](PaymentMethodTypes.md) | この PaymentFlow で使用できる支払い方法の種類のリスト。指定しない場合は、PAY.JP は支払い方法の設定から利用可能な支払い方法を動的に表示します。 | [optional] **returnUrl** | **string** | 顧客が支払いを完了後かキャンセルした後にリダイレクトされる URL。アプリにリダイレクトしたい場合は URI Scheme を指定できます。 | [optional] -**description** | **string** | オブジェクトにセットする任意の文字列。ユーザーには表示されません。 | [optional] +**description** | **string** | オブジェクトにセットする任意の文字列。 | [optional] **metadata** | [**array**](MetadataValue.md) | キーバリューの任意のデータを格納できます。20件まで登録可能で、空文字列を指定するとそのキーを削除できます。<a href=\"https://docs.pay.jp/v2/guide/developers/metadata\">詳細はメタデータのドキュメントを参照してください。</a> | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PaymentMethodConfigurationDetailsResponse.md b/docs/Model/PaymentMethodConfigurationDetailsResponse.md index 92980a5..3155053 100644 --- a/docs/Model/PaymentMethodConfigurationDetailsResponse.md +++ b/docs/Model/PaymentMethodConfigurationDetailsResponse.md @@ -11,5 +11,6 @@ Name | Type | Description | Notes **name** | **string** | | **paypay** | [**\PAYJPV2\Model\PaymentMethodConfigurationSettingResponse**](PaymentMethodConfigurationSettingResponse.md) | PayPay の設定 | **card** | [**\PAYJPV2\Model\PaymentMethodConfigurationSettingResponse**](PaymentMethodConfigurationSettingResponse.md) | カードの設定 | +**applePay** | [**\PAYJPV2\Model\PaymentMethodConfigurationSettingResponse**](PaymentMethodConfigurationSettingResponse.md) | Apple Pay の設定 | [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/PaymentMethodConfigurationUpdateRequest.md b/docs/Model/PaymentMethodConfigurationUpdateRequest.md index 565c52e..d042949 100644 --- a/docs/Model/PaymentMethodConfigurationUpdateRequest.md +++ b/docs/Model/PaymentMethodConfigurationUpdateRequest.md @@ -8,5 +8,6 @@ Name | Type | Description | Notes **name** | **string** | | [optional] **card** | [**\PAYJPV2\Model\CardConfigRequest**](CardConfigRequest.md) | | [optional] **paypay** | [**\PAYJPV2\Model\PayPayConfigRequest**](PayPayConfigRequest.md) | | [optional] +**applePay** | [**\PAYJPV2\Model\ApplePayConfigRequest**](ApplePayConfigRequest.md) | | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SetupFlowCreateRequest.md b/docs/Model/SetupFlowCreateRequest.md index 547ed3d..a981a05 100644 --- a/docs/Model/SetupFlowCreateRequest.md +++ b/docs/Model/SetupFlowCreateRequest.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes **paymentMethodOptions** | [**\PAYJPV2\Model\SetupFlowPaymentMethodOptionsRequest**](SetupFlowPaymentMethodOptionsRequest.md) | この SetupFlow 固有の支払い方法の設定 | [optional] **paymentMethodTypes** | **string[]** | この SetupFlow で使用できる支払い方法の種類のリスト。 指定しない場合は、PAY.JP は支払い方法の設定から利用可能な支払い方法を動的に表示します。 | [optional] **usage** | [**\PAYJPV2\Model\Usage**](Usage.md) | 支払い方法が今後どのように使用されるかを指定します。指定されていない場合、この値はデフォルトで `off_session` になります。 | 値 | |:---| | **off_session**: 定期課金など、顧客がカートなどの決済フローにいるかどうか不明な場合は `off_session` を使用してください。 | | **on_session**: 顧客がカートなどの決済フローにいる場合にのみ支払い方法を利用する場合は `on_session` を使用してください。 | | [optional] -**description** | **string** | 説明。顧客に表示されます。 | [optional] +**description** | **string** | 説明。 | [optional] **metadata** | [**array**](MetadataValue.md) | キーバリューの任意のデータを格納できます。20件まで登録可能で、空文字列を指定するとそのキーを削除できます。<a href=\"https://docs.pay.jp/v2/guide/developers/metadata\">詳細はメタデータのドキュメントを参照してください。</a> | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SetupFlowDataRequest.md b/docs/Model/SetupFlowDataRequest.md index 0bd6696..754a89a 100644 --- a/docs/Model/SetupFlowDataRequest.md +++ b/docs/Model/SetupFlowDataRequest.md @@ -4,6 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**description** | **string** | | [optional] **metadata** | [**array**](MetadataValue.md) | キーバリューの任意のデータを格納できます。20件まで登録可能で、空文字列を指定するとそのキーを削除できます。<a href=\"https://docs.pay.jp/v2/guide/developers/metadata\">詳細はメタデータのドキュメントを参照してください。</a> | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SetupFlowUpdateRequest.md b/docs/Model/SetupFlowUpdateRequest.md index af99893..290b5d7 100644 --- a/docs/Model/SetupFlowUpdateRequest.md +++ b/docs/Model/SetupFlowUpdateRequest.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **customerId** | **string** | この SetupFlow に関連付ける顧客の ID。SetupFlow により作られた PaymentMethod はこの顧客に紐付きます。 | [optional] **paymentMethodOptions** | [**\PAYJPV2\Model\SetupFlowPaymentMethodOptionsRequest**](SetupFlowPaymentMethodOptionsRequest.md) | この SetupFlow 固有の支払い方法の設定 | [optional] **paymentMethodTypes** | **string[]** | この SetupFlow で使用できる支払い方法の種類のリスト。 指定しない場合は、PAY.JP は支払い方法の設定から利用可能な支払い方法を動的に表示します。 | [optional] -**description** | **string** | 説明。顧客に表示されます。 | [optional] +**description** | **string** | 説明。 | [optional] **metadata** | [**array**](MetadataValue.md) | キーバリューの任意のデータを格納できます。20件まで登録可能で、空文字列を指定するとそのキーを削除できます。<a href=\"https://docs.pay.jp/v2/guide/developers/metadata\">詳細はメタデータのドキュメントを参照してください。</a> | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/lib/Api/PaymentFlowsApi.php b/lib/Api/PaymentFlowsApi.php index 8fd97ce..f9961dc 100644 --- a/lib/Api/PaymentFlowsApi.php +++ b/lib/Api/PaymentFlowsApi.php @@ -502,7 +502,7 @@ public function cancelPaymentFlowRequest($paymentFlowId, $paymentFlowCancelReque * * @throws \PAYJPV2\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \PAYJPV2\Model\PaymentFlowResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse + * @return \PAYJPV2\Model\PaymentFlowResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse */ public function capturePaymentFlow($paymentFlowId, $paymentFlowCaptureRequest = null, ?string $idempotencyKey = null) { @@ -522,7 +522,7 @@ public function capturePaymentFlow($paymentFlowId, $paymentFlowCaptureRequest = * * @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\PaymentFlowResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \PAYJPV2\Model\PaymentFlowResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) */ public function capturePaymentFlowWithHttpInfo($paymentFlowId, $paymentFlowCaptureRequest = null, ?string $idempotencyKey = null) { @@ -577,6 +577,12 @@ public function capturePaymentFlowWithHttpInfo($paymentFlowId, $paymentFlowCaptu $request, $response, ); + case 402: + return $this->handleResponseWithDataType( + '\PAYJPV2\Model\ErrorResponse', + $request, + $response, + ); } @@ -636,6 +642,15 @@ public function capturePaymentFlowWithHttpInfo($paymentFlowId, $paymentFlowCaptu ); $e->setResponseObject($data); + throw $e; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PAYJPV2\Model\ErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; } @@ -847,7 +862,7 @@ public function capturePaymentFlowRequest($paymentFlowId, $paymentFlowCaptureReq * * @throws \PAYJPV2\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \PAYJPV2\Model\PaymentFlowResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse + * @return \PAYJPV2\Model\PaymentFlowResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse */ public function confirmPaymentFlow($paymentFlowId, $paymentFlowConfirmRequest = null, ?string $idempotencyKey = null) { @@ -867,7 +882,7 @@ public function confirmPaymentFlow($paymentFlowId, $paymentFlowConfirmRequest = * * @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\PaymentFlowResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \PAYJPV2\Model\PaymentFlowResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) */ public function confirmPaymentFlowWithHttpInfo($paymentFlowId, $paymentFlowConfirmRequest = null, ?string $idempotencyKey = null) { @@ -922,6 +937,12 @@ public function confirmPaymentFlowWithHttpInfo($paymentFlowId, $paymentFlowConfi $request, $response, ); + case 402: + return $this->handleResponseWithDataType( + '\PAYJPV2\Model\ErrorResponse', + $request, + $response, + ); } @@ -981,6 +1002,15 @@ public function confirmPaymentFlowWithHttpInfo($paymentFlowId, $paymentFlowConfi ); $e->setResponseObject($data); + throw $e; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PAYJPV2\Model\ErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; } @@ -1191,7 +1221,7 @@ public function confirmPaymentFlowRequest($paymentFlowId, $paymentFlowConfirmReq * * @throws \PAYJPV2\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \PAYJPV2\Model\PaymentFlowResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse + * @return \PAYJPV2\Model\PaymentFlowResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse */ public function createPaymentFlow($paymentFlowCreateRequest, ?string $idempotencyKey = null) { @@ -1210,7 +1240,7 @@ public function createPaymentFlow($paymentFlowCreateRequest, ?string $idempotenc * * @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\PaymentFlowResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \PAYJPV2\Model\PaymentFlowResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) */ public function createPaymentFlowWithHttpInfo($paymentFlowCreateRequest, ?string $idempotencyKey = null) { @@ -1265,6 +1295,12 @@ public function createPaymentFlowWithHttpInfo($paymentFlowCreateRequest, ?string $request, $response, ); + case 402: + return $this->handleResponseWithDataType( + '\PAYJPV2\Model\ErrorResponse', + $request, + $response, + ); } @@ -1324,6 +1360,15 @@ public function createPaymentFlowWithHttpInfo($paymentFlowCreateRequest, ?string ); $e->setResponseObject($data); + throw $e; + case 402: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PAYJPV2\Model\ErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; } diff --git a/lib/Api/PaymentMethodConfigurationsApi.php b/lib/Api/PaymentMethodConfigurationsApi.php index 1bb613d..68cda90 100644 --- a/lib/Api/PaymentMethodConfigurationsApi.php +++ b/lib/Api/PaymentMethodConfigurationsApi.php @@ -489,7 +489,7 @@ public function getAllPaymentMethodConfigurationsRequest($limit = 10, $startingA * * @throws \PAYJPV2\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \PAYJPV2\Model\PaymentMethodConfigurationDetailsResponse|\PAYJPV2\Model\ErrorResponse + * @return \PAYJPV2\Model\PaymentMethodConfigurationDetailsResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse */ public function getPaymentMethodConfiguration($paymentMethodConfigurationId, ?string $idempotencyKey = null) { @@ -508,7 +508,7 @@ public function getPaymentMethodConfiguration($paymentMethodConfigurationId, ?st * * @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\PaymentMethodConfigurationDetailsResponse|\PAYJPV2\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \PAYJPV2\Model\PaymentMethodConfigurationDetailsResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) */ public function getPaymentMethodConfigurationWithHttpInfo($paymentMethodConfigurationId, ?string $idempotencyKey = null) { @@ -551,6 +551,12 @@ public function getPaymentMethodConfigurationWithHttpInfo($paymentMethodConfigur $request, $response, ); + case 404: + return $this->handleResponseWithDataType( + '\PAYJPV2\Model\ErrorResponse', + $request, + $response, + ); } @@ -592,6 +598,15 @@ public function getPaymentMethodConfigurationWithHttpInfo($paymentMethodConfigur ); $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PAYJPV2\Model\ErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; } @@ -792,7 +807,7 @@ public function getPaymentMethodConfigurationRequest($paymentMethodConfiguration * * @throws \PAYJPV2\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \PAYJPV2\Model\PaymentMethodConfigurationDetailsResponse|\PAYJPV2\Model\ErrorResponse + * @return \PAYJPV2\Model\PaymentMethodConfigurationDetailsResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse */ public function updatePaymentMethodConfiguration($paymentMethodConfigurationId, $paymentMethodConfigurationUpdateRequest, ?string $idempotencyKey = null) { @@ -812,7 +827,7 @@ public function updatePaymentMethodConfiguration($paymentMethodConfigurationId, * * @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\PaymentMethodConfigurationDetailsResponse|\PAYJPV2\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \PAYJPV2\Model\PaymentMethodConfigurationDetailsResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) */ public function updatePaymentMethodConfigurationWithHttpInfo($paymentMethodConfigurationId, $paymentMethodConfigurationUpdateRequest, ?string $idempotencyKey = null) { @@ -855,6 +870,12 @@ public function updatePaymentMethodConfigurationWithHttpInfo($paymentMethodConfi $request, $response, ); + case 404: + return $this->handleResponseWithDataType( + '\PAYJPV2\Model\ErrorResponse', + $request, + $response, + ); } @@ -896,6 +917,15 @@ public function updatePaymentMethodConfigurationWithHttpInfo($paymentMethodConfi ); $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PAYJPV2\Model\ErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; } diff --git a/lib/Api/PaymentMethodsApi.php b/lib/Api/PaymentMethodsApi.php index 1690676..ead7e65 100644 --- a/lib/Api/PaymentMethodsApi.php +++ b/lib/Api/PaymentMethodsApi.php @@ -820,7 +820,7 @@ public function createPaymentMethodRequest($paymentMethodCreateRequest, ?string * * @throws \PAYJPV2\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \PAYJPV2\Model\PaymentMethodResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse + * @return \PAYJPV2\Model\PaymentMethodResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse */ public function detachPaymentMethod($paymentMethodId, ?string $idempotencyKey = null) { @@ -839,7 +839,7 @@ public function detachPaymentMethod($paymentMethodId, ?string $idempotencyKey = * * @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\PaymentMethodResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \PAYJPV2\Model\PaymentMethodResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) */ public function detachPaymentMethodWithHttpInfo($paymentMethodId, ?string $idempotencyKey = null) { @@ -888,6 +888,12 @@ public function detachPaymentMethodWithHttpInfo($paymentMethodId, ?string $idemp $request, $response, ); + case 400: + return $this->handleResponseWithDataType( + '\PAYJPV2\Model\ErrorResponse', + $request, + $response, + ); } @@ -938,6 +944,15 @@ public function detachPaymentMethodWithHttpInfo($paymentMethodId, ?string $idemp ); $e->setResponseObject($data); + throw $e; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PAYJPV2\Model\ErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; } diff --git a/lib/Api/PricesApi.php b/lib/Api/PricesApi.php index a95e13a..63e90f5 100644 --- a/lib/Api/PricesApi.php +++ b/lib/Api/PricesApi.php @@ -823,7 +823,7 @@ public function getAllPricesRequest($limit = 10, $startingAfter = null, $endingB * * @throws \PAYJPV2\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \PAYJPV2\Model\PriceDetailsResponse|\PAYJPV2\Model\ErrorResponse + * @return \PAYJPV2\Model\PriceDetailsResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse */ public function getPrice($priceId, ?string $idempotencyKey = null) { @@ -842,7 +842,7 @@ public function getPrice($priceId, ?string $idempotencyKey = null) * * @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\PriceDetailsResponse|\PAYJPV2\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \PAYJPV2\Model\PriceDetailsResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) */ public function getPriceWithHttpInfo($priceId, ?string $idempotencyKey = null) { @@ -885,6 +885,12 @@ public function getPriceWithHttpInfo($priceId, ?string $idempotencyKey = null) $request, $response, ); + case 404: + return $this->handleResponseWithDataType( + '\PAYJPV2\Model\ErrorResponse', + $request, + $response, + ); } @@ -926,6 +932,15 @@ public function getPriceWithHttpInfo($priceId, ?string $idempotencyKey = null) ); $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PAYJPV2\Model\ErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; } diff --git a/lib/Api/TaxRatesApi.php b/lib/Api/TaxRatesApi.php index c5a0fba..4024897 100644 --- a/lib/Api/TaxRatesApi.php +++ b/lib/Api/TaxRatesApi.php @@ -793,7 +793,7 @@ public function getAllTaxRatesRequest($limit = 10, $startingAfter = null, $endin * * @throws \PAYJPV2\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \PAYJPV2\Model\TaxRateDetailsResponse|\PAYJPV2\Model\ErrorResponse + * @return \PAYJPV2\Model\TaxRateDetailsResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse */ public function getTaxRate($taxRateId, ?string $idempotencyKey = null) { @@ -812,7 +812,7 @@ public function getTaxRate($taxRateId, ?string $idempotencyKey = null) * * @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\TaxRateDetailsResponse|\PAYJPV2\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \PAYJPV2\Model\TaxRateDetailsResponse|\PAYJPV2\Model\ErrorResponse|\PAYJPV2\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) */ public function getTaxRateWithHttpInfo($taxRateId, ?string $idempotencyKey = null) { @@ -855,6 +855,12 @@ public function getTaxRateWithHttpInfo($taxRateId, ?string $idempotencyKey = nul $request, $response, ); + case 404: + return $this->handleResponseWithDataType( + '\PAYJPV2\Model\ErrorResponse', + $request, + $response, + ); } @@ -896,6 +902,15 @@ public function getTaxRateWithHttpInfo($taxRateId, ?string $idempotencyKey = nul ); $e->setResponseObject($data); + throw $e; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\PAYJPV2\Model\ErrorResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; } diff --git a/lib/Configuration.php b/lib/Configuration.php index 00d2324..0ad469a 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -101,7 +101,7 @@ class Configuration * * @var string */ - protected $userAgent = 'payjp/payjpv2 PHPBindings/1.0.5'; + protected $userAgent = 'payjp/payjpv2 PHPBindings/1.0.6'; /** * Debug switch (default set to false) @@ -339,7 +339,7 @@ public function getUserAgent(): string public static function buildClientUserAgent(): string { $uaInfo = [ - 'bindings_version' => '1.0.5', + 'bindings_version' => '1.0.6', 'lang' => 'php', 'lang_version' => PHP_VERSION, 'publisher' => 'payjp', @@ -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.5' . PHP_EOL; + $report .= ' SDK Package Version: 1.0.6' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/lib/Model/ApplePayConfigRequest.php b/lib/Model/ApplePayConfigRequest.php new file mode 100644 index 0000000..eedbfb2 --- /dev/null +++ b/lib/Model/ApplePayConfigRequest.php @@ -0,0 +1,415 @@ + + */ +class ApplePayConfigRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ApplePayConfigRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'displayPreference' => '\PAYJPV2\Model\DisplayPreferenceRequest', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'displayPreference' => null, + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'displayPreference' => true, + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return bool[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param bool[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'displayPreference' => 'display_preference', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'displayPreference' => 'setDisplayPreference', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'displayPreference' => 'getDisplayPreference', + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('displayPreference', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets displayPreference + * + * @return \PAYJPV2\Model\DisplayPreferenceRequest|null + */ + public function getDisplayPreference(): ?\PAYJPV2\Model\DisplayPreferenceRequest + { + return $this->container['displayPreference']; + } + + /** + * Sets displayPreference + * + * @param \PAYJPV2\Model\DisplayPreferenceRequest|null $displayPreference displayPreference + * + * @return self + */ + public function setDisplayPreference(?\PAYJPV2\Model\DisplayPreferenceRequest $displayPreference): self + { + if (is_null($displayPreference)) { + array_push($this->openAPINullablesSetToNull, 'displayPreference'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('displayPreference', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['displayPreference'] = $displayPreference; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/lib/Model/PaymentFlowCancelRequest.php b/lib/Model/PaymentFlowCancelRequest.php index 0a4dca6..13a8ded 100644 --- a/lib/Model/PaymentFlowCancelRequest.php +++ b/lib/Model/PaymentFlowCancelRequest.php @@ -331,7 +331,7 @@ public function getCancellationReason(): ?string /** * Sets cancellationReason * - * @param string|null $cancellationReason この PaymentFlow のキャンセル理由 | 値 | |:---| | **duplicate**: 重複した支払いである場合。 | | **fraudulent**: 不正な利用だと考えられる場合。 | | **requested_by_customer**: 顧客がキャンセルを要求した場合。 | | **abondoned**: 顧客が支払いを完了しなかった場合。 | + * @param string|null $cancellationReason この PaymentFlow のキャンセル理由 | 値 | |:---| | **duplicate**: 重複した支払いである場合。 | | **fraudulent**: 不正な利用だと考えられる場合。 | | **requested_by_customer**: 顧客がキャンセルを要求した場合。 | | **abandoned**: 顧客が支払いを完了しなかった場合。 | * * @return self */ diff --git a/lib/Model/PaymentFlowConfirmRequest.php b/lib/Model/PaymentFlowConfirmRequest.php index bd872a0..89d2e56 100644 --- a/lib/Model/PaymentFlowConfirmRequest.php +++ b/lib/Model/PaymentFlowConfirmRequest.php @@ -91,7 +91,7 @@ class PaymentFlowConfirmRequest implements ModelInterface, ArrayAccess, \JsonSer 'paymentMethodId' => false, 'paymentMethodOptions' => false, 'paymentMethodTypes' => false, - 'captureMethod' => false, + 'captureMethod' => true, 'returnUrl' => false, 'description' => false, ]; @@ -419,14 +419,21 @@ public function getCaptureMethod(): ?\PAYJPV2\Model\CaptureMethod /** * Sets captureMethod * - * @param \PAYJPV2\Model\CaptureMethod|null $captureMethod 支払いの確定方法を指定します。 | 値 | |:---| | **automatic**: (デフォルト) 顧客が支払いを承認すると、自動的に確定させます。 | | **manual**: 顧客が支払いを承認すると一旦確定を保留し、後で Payment Flow の Capture API を使用して確定します。(すべての支払い方法がこれをサポートしているわけではありません)。 | + * @param \PAYJPV2\Model\CaptureMethod|null $captureMethod captureMethod * * @return self */ public function setCaptureMethod(?\PAYJPV2\Model\CaptureMethod $captureMethod): self { if (is_null($captureMethod)) { - throw new \InvalidArgumentException('non-nullable captureMethod cannot be null'); + array_push($this->openAPINullablesSetToNull, 'captureMethod'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('captureMethod', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } } $this->container['captureMethod'] = $captureMethod; @@ -473,7 +480,7 @@ public function getDescription(): ?string /** * Sets description * - * @param string|null $description オブジェクトにセットする任意の文字列。ユーザーには表示されません。 + * @param string|null $description オブジェクトにセットする任意の文字列。 * * @return self */ diff --git a/lib/Model/PaymentFlowCreateRequest.php b/lib/Model/PaymentFlowCreateRequest.php index d6db7d6..37e8d2f 100644 --- a/lib/Model/PaymentFlowCreateRequest.php +++ b/lib/Model/PaymentFlowCreateRequest.php @@ -647,7 +647,7 @@ public function getDescription(): ?string /** * Sets description * - * @param string|null $description オブジェクトにセットする任意の文字列。ユーザーには表示されません。 + * @param string|null $description オブジェクトにセットする任意の文字列。 * * @return self */ diff --git a/lib/Model/PaymentFlowDataRequest.php b/lib/Model/PaymentFlowDataRequest.php index 17ad180..a596efb 100644 --- a/lib/Model/PaymentFlowDataRequest.php +++ b/lib/Model/PaymentFlowDataRequest.php @@ -59,6 +59,7 @@ class PaymentFlowDataRequest implements ModelInterface, ArrayAccess, \JsonSerial */ protected static $openAPITypes = [ 'captureMethod' => '\PAYJPV2\Model\CaptureMethod', + 'description' => 'string', 'metadata' => 'array', ]; @@ -71,6 +72,7 @@ class PaymentFlowDataRequest implements ModelInterface, ArrayAccess, \JsonSerial */ protected static $openAPIFormats = [ 'captureMethod' => null, + 'description' => null, 'metadata' => null, ]; @@ -81,6 +83,7 @@ class PaymentFlowDataRequest implements ModelInterface, ArrayAccess, \JsonSerial */ protected static array $openAPINullables = [ 'captureMethod' => false, + 'description' => true, 'metadata' => false, ]; @@ -171,6 +174,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'captureMethod' => 'capture_method', + 'description' => 'description', 'metadata' => 'metadata', ]; @@ -181,6 +185,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'captureMethod' => 'setCaptureMethod', + 'description' => 'setDescription', 'metadata' => 'setMetadata', ]; @@ -191,6 +196,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'captureMethod' => 'getCaptureMethod', + 'description' => 'getDescription', 'metadata' => 'getMetadata', ]; @@ -252,6 +258,7 @@ public function getModelName() public function __construct(?array $data = null) { $this->setIfExists('captureMethod', $data ?? [], null); + $this->setIfExists('description', $data ?? [], null); $this->setIfExists('metadata', $data ?? [], null); } @@ -324,6 +331,40 @@ public function setCaptureMethod(?\PAYJPV2\Model\CaptureMethod $captureMethod): return $this; } + /** + * Gets description + * + * @return string|null + */ + public function getDescription(): ?string + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description description + * + * @return self + */ + public function setDescription(?string $description): self + { + if (is_null($description)) { + array_push($this->openAPINullablesSetToNull, 'description'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('description', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['description'] = $description; + + return $this; + } + /** * Gets metadata * diff --git a/lib/Model/PaymentFlowUpdateRequest.php b/lib/Model/PaymentFlowUpdateRequest.php index 092ac5e..ddbbbc4 100644 --- a/lib/Model/PaymentFlowUpdateRequest.php +++ b/lib/Model/PaymentFlowUpdateRequest.php @@ -530,7 +530,7 @@ public function getDescription(): ?string /** * Sets description * - * @param string|null $description オブジェクトにセットする任意の文字列。ユーザーには表示されません。 + * @param string|null $description オブジェクトにセットする任意の文字列。 * * @return self */ diff --git a/lib/Model/PaymentMethodConfigurationDetailsResponse.php b/lib/Model/PaymentMethodConfigurationDetailsResponse.php index 2483d7c..273b78c 100644 --- a/lib/Model/PaymentMethodConfigurationDetailsResponse.php +++ b/lib/Model/PaymentMethodConfigurationDetailsResponse.php @@ -65,6 +65,7 @@ class PaymentMethodConfigurationDetailsResponse implements ModelInterface, Array 'name' => 'string', 'paypay' => '\PAYJPV2\Model\PaymentMethodConfigurationSettingResponse', 'card' => '\PAYJPV2\Model\PaymentMethodConfigurationSettingResponse', + 'applePay' => '\PAYJPV2\Model\PaymentMethodConfigurationSettingResponse', ]; /** @@ -82,6 +83,7 @@ class PaymentMethodConfigurationDetailsResponse implements ModelInterface, Array 'name' => null, 'paypay' => null, 'card' => null, + 'applePay' => null, ]; /** @@ -97,6 +99,7 @@ class PaymentMethodConfigurationDetailsResponse implements ModelInterface, Array 'name' => true, 'paypay' => false, 'card' => false, + 'applePay' => false, ]; /** @@ -192,6 +195,7 @@ public function isNullableSetToNull(string $property): bool 'name' => 'name', 'paypay' => 'paypay', 'card' => 'card', + 'applePay' => 'apple_pay', ]; /** @@ -207,6 +211,7 @@ public function isNullableSetToNull(string $property): bool 'name' => 'setName', 'paypay' => 'setPaypay', 'card' => 'setCard', + 'applePay' => 'setApplePay', ]; /** @@ -222,6 +227,7 @@ public function isNullableSetToNull(string $property): bool 'name' => 'getName', 'paypay' => 'getPaypay', 'card' => 'getCard', + 'applePay' => 'getApplePay', ]; /** @@ -301,6 +307,7 @@ public function __construct(?array $data = null) $this->setIfExists('name', $data ?? [], null); $this->setIfExists('paypay', $data ?? [], null); $this->setIfExists('card', $data ?? [], null); + $this->setIfExists('applePay', $data ?? [], null); } /** @@ -357,6 +364,9 @@ public function listInvalidProperties() if ($this->container['card'] === null) { $invalidProperties[] = "'card' can't be null"; } + if ($this->container['applePay'] === null) { + $invalidProperties[] = "'applePay' can't be null"; + } return $invalidProperties; } @@ -598,6 +608,37 @@ public function setCard(\PAYJPV2\Model\PaymentMethodConfigurationSettingResponse return $this; } + + /** + * Gets applePay + * + * @return \PAYJPV2\Model\PaymentMethodConfigurationSettingResponse + */ + public function getApplePay(): \PAYJPV2\Model\PaymentMethodConfigurationSettingResponse + { + if ($this->container['applePay'] === null) { + throw new \LogicException('Property "applePay" is required but has not been set.'); + } + + return $this->container['applePay']; + } + + /** + * Sets applePay + * + * @param \PAYJPV2\Model\PaymentMethodConfigurationSettingResponse $applePay Apple Pay の設定 + * + * @return self + */ + public function setApplePay(\PAYJPV2\Model\PaymentMethodConfigurationSettingResponse $applePay): self + { + if (is_null($applePay)) { + throw new \InvalidArgumentException('non-nullable applePay cannot be null'); + } + $this->container['applePay'] = $applePay; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/PaymentMethodConfigurationUpdateRequest.php b/lib/Model/PaymentMethodConfigurationUpdateRequest.php index 33e4783..2593cca 100644 --- a/lib/Model/PaymentMethodConfigurationUpdateRequest.php +++ b/lib/Model/PaymentMethodConfigurationUpdateRequest.php @@ -62,6 +62,7 @@ class PaymentMethodConfigurationUpdateRequest implements ModelInterface, ArrayAc 'name' => 'string', 'card' => '\PAYJPV2\Model\CardConfigRequest', 'paypay' => '\PAYJPV2\Model\PayPayConfigRequest', + 'applePay' => '\PAYJPV2\Model\ApplePayConfigRequest', ]; /** @@ -76,6 +77,7 @@ class PaymentMethodConfigurationUpdateRequest implements ModelInterface, ArrayAc 'name' => null, 'card' => null, 'paypay' => null, + 'applePay' => null, ]; /** @@ -88,6 +90,7 @@ class PaymentMethodConfigurationUpdateRequest implements ModelInterface, ArrayAc 'name' => true, 'card' => true, 'paypay' => true, + 'applePay' => true, ]; /** @@ -180,6 +183,7 @@ public function isNullableSetToNull(string $property): bool 'name' => 'name', 'card' => 'card', 'paypay' => 'paypay', + 'applePay' => 'apple_pay', ]; /** @@ -192,6 +196,7 @@ public function isNullableSetToNull(string $property): bool 'name' => 'setName', 'card' => 'setCard', 'paypay' => 'setPaypay', + 'applePay' => 'setApplePay', ]; /** @@ -204,6 +209,7 @@ public function isNullableSetToNull(string $property): bool 'name' => 'getName', 'card' => 'getCard', 'paypay' => 'getPaypay', + 'applePay' => 'getApplePay', ]; /** @@ -267,6 +273,7 @@ public function __construct(?array $data = null) $this->setIfExists('name', $data ?? [], null); $this->setIfExists('card', $data ?? [], null); $this->setIfExists('paypay', $data ?? [], null); + $this->setIfExists('applePay', $data ?? [], null); } /** @@ -446,6 +453,40 @@ public function setPaypay(?\PAYJPV2\Model\PayPayConfigRequest $paypay): self return $this; } + + /** + * Gets applePay + * + * @return \PAYJPV2\Model\ApplePayConfigRequest|null + */ + public function getApplePay(): ?\PAYJPV2\Model\ApplePayConfigRequest + { + return $this->container['applePay']; + } + + /** + * Sets applePay + * + * @param \PAYJPV2\Model\ApplePayConfigRequest|null $applePay applePay + * + * @return self + */ + public function setApplePay(?\PAYJPV2\Model\ApplePayConfigRequest $applePay): self + { + if (is_null($applePay)) { + array_push($this->openAPINullablesSetToNull, 'applePay'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('applePay', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['applePay'] = $applePay; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/PaymentRefundCreateRequest.php b/lib/Model/PaymentRefundCreateRequest.php index 19e7f48..6c33ca8 100644 --- a/lib/Model/PaymentRefundCreateRequest.php +++ b/lib/Model/PaymentRefundCreateRequest.php @@ -299,8 +299,8 @@ public function listInvalidProperties() if ($this->container['paymentFlowId'] === null) { $invalidProperties[] = "'paymentFlowId' can't be null"; } - if (! is_null($this->container['amount']) && ($this->container['amount'] < 0)) { - $invalidProperties[] = "invalid value for 'amount', must be bigger than or equal to 0."; + if (! is_null($this->container['amount']) && ($this->container['amount'] < 1)) { + $invalidProperties[] = "invalid value for 'amount', must be bigger than or equal to 1."; } return $invalidProperties; @@ -372,8 +372,8 @@ public function setAmount(?int $amount): self throw new \InvalidArgumentException('non-nullable amount cannot be null'); } - if (($amount < 0)) { - throw new \InvalidArgumentException('invalid value for $amount when calling PaymentRefundCreateRequest., must be bigger than or equal to 0.'); + if (($amount < 1)) { + throw new \InvalidArgumentException('invalid value for $amount when calling PaymentRefundCreateRequest., must be bigger than or equal to 1.'); } $this->container['amount'] = $amount; diff --git a/lib/Model/SetupFlowCreateRequest.php b/lib/Model/SetupFlowCreateRequest.php index 4ef2ea9..1563c7e 100644 --- a/lib/Model/SetupFlowCreateRequest.php +++ b/lib/Model/SetupFlowCreateRequest.php @@ -468,7 +468,7 @@ public function getDescription(): ?string /** * Sets description * - * @param string|null $description 説明。顧客に表示されます。 + * @param string|null $description 説明。 * * @return self */ diff --git a/lib/Model/SetupFlowDataRequest.php b/lib/Model/SetupFlowDataRequest.php index 6136046..b827b21 100644 --- a/lib/Model/SetupFlowDataRequest.php +++ b/lib/Model/SetupFlowDataRequest.php @@ -58,6 +58,7 @@ class SetupFlowDataRequest implements ModelInterface, ArrayAccess, \JsonSerializ * @var string[] */ protected static $openAPITypes = [ + 'description' => 'string', 'metadata' => 'array', ]; @@ -69,6 +70,7 @@ class SetupFlowDataRequest implements ModelInterface, ArrayAccess, \JsonSerializ * @psalm-var array */ protected static $openAPIFormats = [ + 'description' => null, 'metadata' => null, ]; @@ -78,6 +80,7 @@ class SetupFlowDataRequest implements ModelInterface, ArrayAccess, \JsonSerializ * @var bool[] */ protected static array $openAPINullables = [ + 'description' => true, 'metadata' => false, ]; @@ -167,6 +170,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'description' => 'description', 'metadata' => 'metadata', ]; @@ -176,6 +180,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'description' => 'setDescription', 'metadata' => 'setMetadata', ]; @@ -185,6 +190,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'description' => 'getDescription', 'metadata' => 'getMetadata', ]; @@ -245,6 +251,7 @@ public function getModelName() */ public function __construct(?array $data = null) { + $this->setIfExists('description', $data ?? [], null); $this->setIfExists('metadata', $data ?? [], null); } @@ -290,6 +297,40 @@ public function valid() } + /** + * Gets description + * + * @return string|null + */ + public function getDescription(): ?string + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description description + * + * @return self + */ + public function setDescription(?string $description): self + { + if (is_null($description)) { + array_push($this->openAPINullablesSetToNull, 'description'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('description', $nullablesSetToNull); + if ($index !== false) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['description'] = $description; + + return $this; + } + /** * Gets metadata * diff --git a/lib/Model/SetupFlowUpdateRequest.php b/lib/Model/SetupFlowUpdateRequest.php index e356bfc..5617b86 100644 --- a/lib/Model/SetupFlowUpdateRequest.php +++ b/lib/Model/SetupFlowUpdateRequest.php @@ -434,7 +434,7 @@ public function getDescription(): ?string /** * Sets description * - * @param string|null $description 説明。顧客に表示されます。 + * @param string|null $description 説明。 * * @return self */ diff --git a/test/Model/ApplePayConfigRequestTest.php b/test/Model/ApplePayConfigRequestTest.php new file mode 100644 index 0000000..3dff100 --- /dev/null +++ b/test/Model/ApplePayConfigRequestTest.php @@ -0,0 +1,90 @@ +