PHPackages                             se468/kakaopay-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. se468/kakaopay-php

ActiveLibrary[API Development](/categories/api)

se468/kakaopay-php
==================

Kakaopay REST API wrapper for PHP

v0.0.3(8y ago)61493MITPHPPHP &gt;=5.5.9

Since Apr 7Pushed 8y ago1 watchersCompare

[ Source](https://github.com/se468/kakaopay-php)[ Packagist](https://packagist.org/packages/se468/kakaopay-php)[ RSS](/packages/se468-kakaopay-php/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (5)Versions (4)Used By (0)

Kakaopay REST API PHP wrapper
=============================

[](#kakaopay-rest-api-php-wrapper)

[![Latest Stable Version](https://camo.githubusercontent.com/1f0db93ae0cb2e70a230d9cc013b56810fcfa0ea236cba8ef121a8b0bdc87243/68747470733a2f2f706f7365722e707567782e6f72672f73653436382f6b616b616f7061792d7068702f762f737461626c65)](https://packagist.org/packages/se468/kakaopay-php)[![Total Downloads](https://camo.githubusercontent.com/377aba2d2993cfaaba92c65666e0e105037616b9063a4c6af3ac7c3ac4381bf3/68747470733a2f2f706f7365722e707567782e6f72672f73653436382f6b616b616f7061792d7068702f646f776e6c6f616473)](https://packagist.org/packages/se468/kakaopay-php)[![License](https://camo.githubusercontent.com/9fe3d2045c7cbaa599f49d50f6885f068526fdeccb16b92f0ad9c26566fad036/68747470733a2f2f706f7365722e707567782e6f72672f73653436382f6b616b616f7061792d7068702f6c6963656e7365)](https://packagist.org/packages/se468/kakaopay-php)

Wrapper for Kakaopay REST API. Kakaopay provides convenient way to do internet transaction in Korea because it doesn't need a separate Payment Gateway (PG). The transaction is done only with the user's Kakaotalk account.

**Official Kakaopay REST API documentation**: [here](https://developers.kakao.com/docs/restapi/kakaopay-api).

**Example Implementation**: [here](https://github.com/se468/kakaopay-laravel-example).

**Demo**: [here](http://package-demos.seyongcho.com/kakaopay).

Installation
------------

[](#installation)

Via Composer:

```
composer require se468/kakaopay-php

```

Usage
-----

[](#usage)

### Single payment process

[](#single-payment-process)

#### Payment Ready

[](#payment-ready)

Used for requesting the user for the transaction. User will receive a message to confirm the transaction.

API Endpoint:

```
POST /v1/payment/ready HTTP/1.1

```

Usage Example:

```
$payment = new \se468\Kakaopay\Payment();
\se468\Kakaopay\Kakaopay::setAdminKey(env('KAKAOPAY_ADMIN_KEY'));

$result = $payment->ready([
    'cid' => 'TC0ONETIME',
    'partner_order_id' => 'partner_order_id',
    'partner_user_id' => 'partner_user_id',
    'item_name' => '초코파이',
    'quantity' => '1',
    'total_amount' => '2200',
    'vat_amount' => '200',
    'tax_free_amount' => '0',
    'approval_url' => 'http://package-development.valet/kakaopay/success',
    'cancel_url' => 'http://package-development.valet/kakaopay/fail',
    'fail_url' => 'http://package-development.valet/kakaopay/cancel'
]);
```

Here's the explanation of the process:

- Result from `payment/ready` will have transation ID, or `tid` (`$result->tid`), which you can safely store in your session.
- Store the `tid` in session and redirect to `$result->next_redirect_pc_url`. Customer will be prompted to enter their Kakaopay phone number and password.
- After the customer fills in the form, they will receive a message in their Kakaotalk to approve the transaction. The screen will then redirect to the `approval_url` that you've provided.
- You can then call `payment/approve` using the `tid` stored in the session and it will process the payments.

#### Payment Approve

[](#payment-approve)

With the given `tid` from payment ready, approve the transaction to finalize.

```
POST /v1/payment/approve HTTP/1.1

```

Example:

```
$payment = new \se468\Kakaopay\Payment();
\se468\Kakaopay\Kakaopay::setAdminKey(env('KAKAOPAY_ADMIN_KEY'));
$result = $payment->approve([
    'cid' => 'TC0ONETIME',
    'tid' => 'T1234567890123456789', //tid received from result from 'ready'
    'partner_order_id' => 'partner_order_id',
    'partner_user_id' => 'partner_user_id',
    'pg_token' => $input['pg_token']
]);
```

- You can delete the `tid` after you get the result from here, and store the `$result` in your DB, which contains the information about the transaction and show it back to the customer.

### Subscription Process

[](#subscription-process)

#### Payment Ready

[](#payment-ready-1)

Example Payment Ready for subscription

```
$payment = new \se468\Kakaopay\Payment();
\se468\Kakaopay\Kakaopay::setAdminKey(env('KAKAOPAY_ADMIN_KEY'));

$result = $payment->ready([
    'cid' => 'TCSUBSCRIP',
    'partner_order_id' => 'partner_order_id',
    'partner_user_id' => 'partner_user_id',
    'item_name' => '음악정기결제',
    'quantity' => '1',
    'total_amount' => '9900',
    'vat_amount' => '900',
    'tax_free_amount' => '0',
    'approval_url' => 'http://package-development.valet/kakaopay/subscription/success',
    'cancel_url' => 'http://package-development.valet/kakaopay/subscription/fail',
    'fail_url' => 'http://package-development.valet/kakaopay/subscription/cancel'
]);
```

> Note that only thing different here from single payment is the `cid` parameter.

#### Payment Approve

[](#payment-approve-1)

> Check the documentation for single payment. It is exactly same process.

#### Subscription from second payment

[](#subscription-from-second-payment)

On going subscription fees can be called like the following:

```
POST /v1/payment/subscription HTTP/1.1

```

Example:

```
$payment = new \se468\Kakaopay\Payment();
\se468\Kakaopay\Kakaopay::setAdminKey(env('KAKAOPAY_ADMIN_KEY'));

$result = $payment->subscription([
    'cid' => 'TCSUBSCRIP', // cid for testing
    'sid' => 'S1234567890987654321',
    'partner_order_id' => 'subscription_order_id_1',
    'partner_user_id' => 'subscription_user_id_1',
    'item_name' => '음악정기결제',
    'quantity' => '1',
    'total_amount' => '9900',
    'vat_amount' => '900',
    'tax_free_amount' => '0',
]);
```

#### Cancelling Payments

[](#cancelling-payments)

```
POST /v1/payment/cancel HTTP/1.1

```

```
$payment = new \se468\Kakaopay\Payment();
\se468\Kakaopay\Kakaopay::setAdminKey(env('KAKAOPAY_ADMIN_KEY'));

$result = $payment->cancel([
    'cid' => 'TC0ONETIME', // cid for testing
    'tid' => 'T1234567890123456789',
    'cancel_amount' => '2200',
    'cancel_tax_free_amount' => '0',
    'cancel_vat_amount' => '200',
    'cancel_available_amount' => '4000',
]);
```

#### Order checking

[](#order-checking)

```
GET/POST /v1/payment/order HTTP/1.1

```

Example:

```
$payment = new \se468\Kakaopay\Payment();
\se468\Kakaopay\Kakaopay::setAdminKey(env('KAKAOPAY_ADMIN_KEY'));

$result = $payment->order([
    'cid' => 'TC0ONETIME', // cid for testing
    'tid' => 'T1234567890123456789',
]);
```

#### Checking the Subscription information

[](#checking-the-subscription-information)

```
POST /v1/payment/manage/subscription/status HTTP/1.1

```

Example:

```
$payment = new \se468\Kakaopay\Payment();
\se468\Kakaopay\Kakaopay::setAdminKey(env('KAKAOPAY_ADMIN_KEY'));

$result = $payment->order([
    'cid' => 'TCSUBSCRIP', // cid for testing
    'tid' => 'S1234567890987654321',
]);
```

#### Deactivating Subscription

[](#deactivating-subscription)

```
POST /v1/payment/manage/subscription/inactive HTTP/1.1

```

Example:

```
$payment = new \se468\Kakaopay\Payment();
\se468\Kakaopay\Kakaopay::setAdminKey(env('KAKAOPAY_ADMIN_KEY'));

$result = $payment->inactive([
    'cid' => 'TCSUBSCRIP', // cid for testing
    'sid' => 'S1234567890987654321',
]);
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

3

Last Release

2957d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/47734150c4de2c84b26e02fb4f6dcaecf3bcc2c4721b9dfd339ac09d31fab05b?d=identicon)[se468](/maintainers/se468)

---

Top Contributors

[![se468](https://avatars.githubusercontent.com/u/1775954?v=4)](https://github.com/se468 "se468 (10 commits)")

---

Tags

kakaopaykakaopay-phpkakaotalkphpphpkakaopaykakaopay-rest-apikakaotalk

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/se468-kakaopay-php/health.svg)

```
[![Health](https://phpackages.com/badges/se468-kakaopay-php/health.svg)](https://phpackages.com/packages/se468-kakaopay-php)
```

###  Alternatives

[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[mailchimp/transactional

458.9M16](/packages/mailchimp-transactional)[unicodeveloper/jusibe-php-lib

Jusibe PHP Library

3417.4k1](/packages/unicodeveloper-jusibe-php-lib)[manamine/php-eos-rpc-sdk

PHP SDK for the EOS RPC API

187.5k](/packages/manamine-php-eos-rpc-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
