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
54 changes: 16 additions & 38 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,26 @@
name: Release
name: release

on:
push:
tags:
- 'v*'
release:
types: [published]

jobs:
release:
test:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: curl, json, mbstring

- name: Install dependencies
run: composer install --no-dev --optimize-autoloader

- name: Run tests
run: |
composer install --dev
vendor/bin/phpunit

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
body: |
## Changes
- uses: actions/checkout@v4

See the [CHANGELOG](CHANGELOG.md) for details.
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.1"
extensions: curl, json, mbstring

## Installation
- name: Install dependencies
run: composer install --dev

```bash
composer require payjp/payjpv2-php:${{ github.ref_name }}
```
- name: Run tests
run: vendor/bin/phpunit
10 changes: 8 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.4`
- Package version: `1.0.5`
- Generator version: `7.14.0`
- Build package: `org.openapitools.codegen.languages.PhpClientCodegen`

Expand Down Expand Up @@ -93,6 +93,8 @@ Class | Method | HTTP request | Description
*CustomersApi* | [**updateCustomer**](docs/Api/CustomersApi.md#updatecustomer) | **POST** /v2/customers/{customer_id} | Update Customer
*EventsApi* | [**getAllEvents**](docs/Api/EventsApi.md#getallevents) | **GET** /v2/events | Get All Events
*EventsApi* | [**getEvent**](docs/Api/EventsApi.md#getevent) | **GET** /v2/events/{event_id} | Get Event
*PaymentDisputesApi* | [**getAllPaymentDisputes**](docs/Api/PaymentDisputesApi.md#getallpaymentdisputes) | **GET** /v2/payment_disputes | Get All Payment Disputes
*PaymentDisputesApi* | [**getPaymentDispute**](docs/Api/PaymentDisputesApi.md#getpaymentdispute) | **GET** /v2/payment_disputes/{payment_dispute_id} | Get Payment Dispute
*PaymentFlowsApi* | [**cancelPaymentFlow**](docs/Api/PaymentFlowsApi.md#cancelpaymentflow) | **POST** /v2/payment_flows/{payment_flow_id}/cancel | Cancel Payment Flow
*PaymentFlowsApi* | [**capturePaymentFlow**](docs/Api/PaymentFlowsApi.md#capturepaymentflow) | **POST** /v2/payment_flows/{payment_flow_id}/capture | Capture Payment Flow
*PaymentFlowsApi* | [**confirmPaymentFlow**](docs/Api/PaymentFlowsApi.md#confirmpaymentflow) | **POST** /v2/payment_flows/{payment_flow_id}/confirm | Confirm Payment Flow
Expand Down Expand Up @@ -180,6 +182,10 @@ Class | Method | HTTP request | Description
- [Locale](docs/Model/Locale.md)
- [MetadataValue](docs/Model/MetadataValue.md)
- [PayPayConfigRequest](docs/Model/PayPayConfigRequest.md)
- [PaymentDisputeListResponse](docs/Model/PaymentDisputeListResponse.md)
- [PaymentDisputeReason](docs/Model/PaymentDisputeReason.md)
- [PaymentDisputeResponse](docs/Model/PaymentDisputeResponse.md)
- [PaymentDisputeStatus](docs/Model/PaymentDisputeStatus.md)
- [PaymentFlowCancelRequest](docs/Model/PaymentFlowCancelRequest.md)
- [PaymentFlowCancellationReason](docs/Model/PaymentFlowCancellationReason.md)
- [PaymentFlowCaptureRequest](docs/Model/PaymentFlowCaptureRequest.md)
Expand Down Expand Up @@ -300,6 +306,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.4`
- Package version: `1.0.5`
- Generator version: `7.14.0`
- Build package: `org.openapitools.codegen.languages.PhpClientCodegen`
143 changes: 143 additions & 0 deletions docs/Api/PaymentDisputesApi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
# PAYJPV2\PaymentDisputesApi

All URIs are relative to https://api.pay.jp, except if the operation defines another base path.

| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
| [**getAllPaymentDisputes()**](PaymentDisputesApi.md#getAllPaymentDisputes) | **GET** /v2/payment_disputes | Get All Payment Disputes |
| [**getPaymentDispute()**](PaymentDisputesApi.md#getPaymentDispute) | **GET** /v2/payment_disputes/{payment_dispute_id} | Get Payment Dispute |


## `getAllPaymentDisputes()`

```php
getAllPaymentDisputes($limit, $startingAfter, $endingBefore, $paymentFlowId, $status): \PAYJPV2\Model\PaymentDisputeListResponse
```

Get All Payment Disputes

### Example

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure HTTP basic authorization: HTTPBasic
$config = PAYJPV2\Configuration::getDefaultConfiguration()
->setUsername('YOUR_USERNAME')
->setPassword('YOUR_PASSWORD');

// Configure Bearer authorization: HTTPBearer
$config = PAYJPV2\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new PAYJPV2\Api\PaymentDisputesApi(
// 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
);
$limit = 10; // int | 取得するデータの最大件数
$startingAfter = 'startingAfter_example'; // string | このIDより後のデータを取得
$endingBefore = 'endingBefore_example'; // string | このIDより前のデータを取得
$paymentFlowId = 'paymentFlowId_example'; // string | 取得する payment_dispute に紐づく payment_flow の ID
$status = array(new \PAYJPV2\Model\\PAYJPV2\Model\PaymentDisputeStatus()); // \PAYJPV2\Model\PaymentDisputeStatus[] | 取得する payment_dispute のステータス。複数指定可能

try {
$result = $apiInstance->getAllPaymentDisputes($limit, $startingAfter, $endingBefore, $paymentFlowId, $status);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling PaymentDisputesApi->getAllPaymentDisputes: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **limit** | **int**| 取得するデータの最大件数 | [optional] [default to 10] |
| **startingAfter** | **string**| このIDより後のデータを取得 | [optional] |
| **endingBefore** | **string**| このIDより前のデータを取得 | [optional] |
| **paymentFlowId** | **string**| 取得する payment_dispute に紐づく payment_flow の ID | [optional] |
| **status** | [**\PAYJPV2\Model\PaymentDisputeStatus[]**](../Model/\PAYJPV2\Model\PaymentDisputeStatus.md)| 取得する payment_dispute のステータス。複数指定可能 | [optional] |

### Return type

[**\PAYJPV2\Model\PaymentDisputeListResponse**](../Model/PaymentDisputeListResponse.md)

### Authorization

[HTTPBasic](../../README.md#HTTPBasic), [HTTPBearer](../../README.md#HTTPBearer)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: `application/json`, `application/problem+json`

[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)

## `getPaymentDispute()`

```php
getPaymentDispute($paymentDisputeId): \PAYJPV2\Model\PaymentDisputeResponse
```

Get Payment Dispute

### Example

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure HTTP basic authorization: HTTPBasic
$config = PAYJPV2\Configuration::getDefaultConfiguration()
->setUsername('YOUR_USERNAME')
->setPassword('YOUR_PASSWORD');

// Configure Bearer authorization: HTTPBearer
$config = PAYJPV2\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new PAYJPV2\Api\PaymentDisputesApi(
// 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
);
$paymentDisputeId = 'paymentDisputeId_example'; // string

try {
$result = $apiInstance->getPaymentDispute($paymentDisputeId);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling PaymentDisputesApi->getPaymentDispute: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **paymentDisputeId** | **string**| | |

### Return type

[**\PAYJPV2\Model\PaymentDisputeResponse**](../Model/PaymentDisputeResponse.md)

### Authorization

[HTTPBasic](../../README.md#HTTPBasic), [HTTPBearer](../../README.md#HTTPBearer)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: `application/json`, `application/problem+json`

[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)
2 changes: 1 addition & 1 deletion docs/Model/CheckoutSessionLineItemDataResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Name | Type | Description | Notes
**amountTax** | **int** | 税額 |
**amountTotal** | **int** | 割引と税金が適用された後のすべての商品の合計金額 |
**currency** | [**\PAYJPV2\Model\Currency**](Currency.md) | 価格の通貨。現在は &#x60;jpy&#x60; のみサポートしています。 |
**description** | **string** | 説明 |
**description** | **string** | |
**price** | [**\PAYJPV2\Model\PriceDetailsResponse**](PriceDetailsResponse.md) | 料金情報 |
**quantity** | **int** | 数量 |

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

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**object** | **string** | | [optional] [default to 'list']
**url** | **string** | リスト取得URL |
**hasMore** | **bool** | 次のページがあるかどうか |
**data** | [**\PAYJPV2\Model\PaymentDisputeResponse[]**](PaymentDisputeResponse.md) | PaymentDispute リスト |

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

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------

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

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**object** | **string** | | [optional] [default to 'payment_dispute']
**id** | **string** | PaymentDispute ID |
**livemode** | **bool** | 本番環境かどうか |
**paymentFlowId** | **string** | 関連する PaymentFlow の ID |
**amount** | **int** | 金額 |
**currency** | [**\PAYJPV2\Model\Currency**](Currency.md) | 通貨コード (ISO 4217) |
**status** | [**\PAYJPV2\Model\PaymentDisputeStatus**](PaymentDisputeStatus.md) | disputeのステータス | 値 | |:---| | **pre_warning_needs_response**: 利用照会 | | **warning_needs_response**: 配送保留 | | **warning_needs_refund**: 配送停止 | | **warning_under_review**: 加盟店回答済 | | **needs_response**: チャージバック | | **under_review**: 反証済 | | **lost**: チャージバック受入 | | **cancel**: 取下げ | |
**reason** | [**\PAYJPV2\Model\PaymentDisputeReason**](PaymentDisputeReason.md) | |
**dueBy** | **\DateTime** | |
**paymentMethodType** | [**\PAYJPV2\Model\PaymentMethodTypes**](PaymentMethodTypes.md) | 支払い方法の種類 |
**metadata** | [**array<string,\PAYJPV2\Model\MetadataValue>**](MetadataValue.md) | メタデータ |
**createdAt** | **\DateTime** | 作成日時 (UTC, ISO 8601 形式) |
**updatedAt** | **\DateTime** | 更新日時 (UTC, ISO 8601 形式) |

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

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------

[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
2 changes: 1 addition & 1 deletion docs/Model/PaymentFlowConfirmRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ 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**: 顧客が支払いを承認すると一旦確定を保留し、後で Capture API を使用して確定します。(すべての支払い方法がこれをサポートしているわけではありません)。 | | [optional]
**captureMethod** | [**\PAYJPV2\Model\CaptureMethod**](CaptureMethod.md) | 支払いの確定方法を指定します。 | 値 | |:---| | **automatic**: (デフォルト) 顧客が支払いを承認すると、自動的に確定させます。 | | **manual**: 顧客が支払いを承認すると一旦確定を保留し、後で Payment Flow の Capture API を使用して確定します。(すべての支払い方法がこれをサポートしているわけではありません)。 | | [optional]
**returnUrl** | **string** | 顧客が支払いを完了後かキャンセルした後にリダイレクトされる URL。アプリにリダイレクトしたい場合は URI Scheme を指定できます。 | [optional]
**description** | **string** | オブジェクトにセットする任意の文字列。ユーザーには表示されません。 | [optional]

Expand Down
2 changes: 1 addition & 1 deletion docs/Model/PaymentFlowCreateRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
**currency** | [**\PAYJPV2\Model\Currency**](Currency.md) | 価格の通貨。現在は &#x60;jpy&#x60; のみサポートしています。 |
**captureMethod** | [**\PAYJPV2\Model\CaptureMethod**](CaptureMethod.md) | 支払いの確定方法を指定します。 | 値 | |:---| | **automatic**: (デフォルト) 顧客が支払いを承認すると、自動的に確定させます。 | | **manual**: 顧客が支払いを承認すると一旦確定を保留し、後で Capture API を使用して確定します。(すべての支払い方法がこれをサポートしているわけではありません)。 | | [optional]
**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&#x3D;true の場合のみ指定できます。 | [optional]
**description** | **string** | オブジェクトにセットする任意の文字列。ユーザーには表示されません。 | [optional]
Expand Down
2 changes: 1 addition & 1 deletion docs/Model/PaymentFlowDataRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**captureMethod** | [**\PAYJPV2\Model\CaptureMethod**](CaptureMethod.md) | 支払いの確定方法を指定します。 | 指定できる値 | |:---| | **automatic**: 顧客が支払いを承認すると自動的に確定します。 | | **manual**: 顧客が支払いを承認すると一旦確定を保留し、後で Capture API を使用して確定します。(すべての支払い方法がこれをサポートしているわけではありません)。 | | [optional]
**captureMethod** | [**\PAYJPV2\Model\CaptureMethod**](CaptureMethod.md) | 支払いの確定方法を指定します。 | 指定できる値 | |:---| | **automatic**: 顧客が支払いを承認すると自動的に確定します。 | | **manual**: 顧客が支払いを承認すると一旦確定を保留し、後で Payment Flow の Capture API を使用して確定します。(すべての支払い方法がこれをサポートしているわけではありません)。 | | [optional]
**metadata** | [**array<string,\PAYJPV2\Model\MetadataValue>**](MetadataValue.md) | キーバリューの任意のデータを格納できます。20件まで登録可能で、空文字列を指定するとそのキーを削除できます。&lt;a href&#x3D;\&quot;https://docs.pay.jp/v2/guide/developers/metadata\&quot;&gt;詳細はメタデータのドキュメントを参照してください。&lt;/a&gt; | [optional]

[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)
Loading