{"id":42257952,"url":"https://github.com/se468/kakaopay-php","last_synced_at":"2026-01-27T05:36:37.668Z","repository":{"id":62541502,"uuid":"128544583","full_name":"se468/kakaopay-php","owner":"se468","description":"PHP Wrapper for Kakaopay REST API.","archived":false,"fork":false,"pushed_at":"2018-04-11T03:58:35.000Z","size":29,"stargazers_count":6,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-11T19:58:35.887Z","etag":null,"topics":["kakaopay","kakaopay-php","kakaotalk","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/se468.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-07T15:59:06.000Z","updated_at":"2022-11-21T09:04:47.000Z","dependencies_parsed_at":"2022-11-02T16:16:08.427Z","dependency_job_id":null,"html_url":"https://github.com/se468/kakaopay-php","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/se468/kakaopay-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/se468%2Fkakaopay-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/se468%2Fkakaopay-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/se468%2Fkakaopay-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/se468%2Fkakaopay-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/se468","download_url":"https://codeload.github.com/se468/kakaopay-php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/se468%2Fkakaopay-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28804281,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T03:44:14.111Z","status":"ssl_error","status_checked_at":"2026-01-27T03:43:33.507Z","response_time":168,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["kakaopay","kakaopay-php","kakaotalk","php"],"created_at":"2026-01-27T05:36:36.264Z","updated_at":"2026-01-27T05:36:37.660Z","avatar_url":"https://github.com/se468.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kakaopay REST API PHP wrapper\n[![Latest Stable Version](https://poser.pugx.org/se468/kakaopay-php/v/stable)](https://packagist.org/packages/se468/kakaopay-php)\n[![Total Downloads](https://poser.pugx.org/se468/kakaopay-php/downloads)](https://packagist.org/packages/se468/kakaopay-php)\n[![License](https://poser.pugx.org/se468/kakaopay-php/license)](https://packagist.org/packages/se468/kakaopay-php)\n\nWrapper 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. \n\n**Official Kakaopay REST API documentation**: [here](https://developers.kakao.com/docs/restapi/kakaopay-api).\n\n**Example Implementation**: [here](https://github.com/se468/kakaopay-laravel-example).\n\n**Demo**: [here](http://package-demos.seyongcho.com/kakaopay).\n\n## Installation\nVia Composer:\n```\ncomposer require se468/kakaopay-php\n```\n\n## Usage\n### Single payment process\n#### Payment Ready\nUsed for requesting the user for the transaction. User will receive a message to confirm the transaction.\n\nAPI Endpoint:\n```\nPOST /v1/payment/ready HTTP/1.1\n```\n\nUsage Example:\n```php\n$payment = new \\se468\\Kakaopay\\Payment();\n\\se468\\Kakaopay\\Kakaopay::setAdminKey(env('KAKAOPAY_ADMIN_KEY'));\n\n$result = $payment-\u003eready([\n    'cid' =\u003e 'TC0ONETIME',\n    'partner_order_id' =\u003e 'partner_order_id',\n    'partner_user_id' =\u003e 'partner_user_id',\n    'item_name' =\u003e '초코파이',\n    'quantity' =\u003e '1',\n    'total_amount' =\u003e '2200',\n    'vat_amount' =\u003e '200',\n    'tax_free_amount' =\u003e '0',\n    'approval_url' =\u003e 'http://package-development.valet/kakaopay/success',\n    'cancel_url' =\u003e 'http://package-development.valet/kakaopay/fail',\n    'fail_url' =\u003e 'http://package-development.valet/kakaopay/cancel'\n]);\n```\n\nHere's the explanation of the process: \n\n* Result from `payment/ready` will have transation ID, or `tid` (`$result-\u003etid`), which you can safely store in your session. \n\n* Store the `tid` in session and redirect to `$result-\u003enext_redirect_pc_url`. Customer will be prompted to enter their Kakaopay phone number and password. \n\n* 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.\n\n* You can then call `payment/approve` using the `tid` stored in the session and it will process the payments. \n\n\n#### Payment Approve\nWith the given `tid` from payment ready, approve the transaction to finalize. \n```\nPOST /v1/payment/approve HTTP/1.1\n```\n\nExample:\n```php\n$payment = new \\se468\\Kakaopay\\Payment();\n\\se468\\Kakaopay\\Kakaopay::setAdminKey(env('KAKAOPAY_ADMIN_KEY'));\n$result = $payment-\u003eapprove([\n    'cid' =\u003e 'TC0ONETIME',\n    'tid' =\u003e 'T1234567890123456789', //tid received from result from 'ready'\n    'partner_order_id' =\u003e 'partner_order_id',\n    'partner_user_id' =\u003e 'partner_user_id',\n    'pg_token' =\u003e $input['pg_token']\n]);\n```\n\n* 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.\n\n### Subscription Process\n#### Payment Ready\nExample Payment Ready for subscription\n```php\n$payment = new \\se468\\Kakaopay\\Payment();\n\\se468\\Kakaopay\\Kakaopay::setAdminKey(env('KAKAOPAY_ADMIN_KEY'));\n\n$result = $payment-\u003eready([\n    'cid' =\u003e 'TCSUBSCRIP',\n    'partner_order_id' =\u003e 'partner_order_id',\n    'partner_user_id' =\u003e 'partner_user_id',\n    'item_name' =\u003e '음악정기결제',\n    'quantity' =\u003e '1',\n    'total_amount' =\u003e '9900',\n    'vat_amount' =\u003e '900',\n    'tax_free_amount' =\u003e '0',\n    'approval_url' =\u003e 'http://package-development.valet/kakaopay/subscription/success',\n    'cancel_url' =\u003e 'http://package-development.valet/kakaopay/subscription/fail',\n    'fail_url' =\u003e 'http://package-development.valet/kakaopay/subscription/cancel'\n]);\n```\n\n\u003e Note that only thing different here from single payment is the `cid` parameter. \n\n#### Payment Approve\n\u003e Check the documentation for single payment. It is exactly same process.\n\n\n#### Subscription from second payment\nOn going subscription fees can be called like the following:\n\n```\nPOST /v1/payment/subscription HTTP/1.1\n```\n\nExample:\n```php\n$payment = new \\se468\\Kakaopay\\Payment();\n\\se468\\Kakaopay\\Kakaopay::setAdminKey(env('KAKAOPAY_ADMIN_KEY'));\n\n$result = $payment-\u003esubscription([\n    'cid' =\u003e 'TCSUBSCRIP', // cid for testing\n    'sid' =\u003e 'S1234567890987654321',\n    'partner_order_id' =\u003e 'subscription_order_id_1',\n    'partner_user_id' =\u003e 'subscription_user_id_1',\n    'item_name' =\u003e '음악정기결제',\n    'quantity' =\u003e '1',\n    'total_amount' =\u003e '9900',\n    'vat_amount' =\u003e '900',\n    'tax_free_amount' =\u003e '0',\n]);\n```\n\n#### Cancelling Payments\n```\nPOST /v1/payment/cancel HTTP/1.1\n```\n\n```php\n$payment = new \\se468\\Kakaopay\\Payment();\n\\se468\\Kakaopay\\Kakaopay::setAdminKey(env('KAKAOPAY_ADMIN_KEY'));\n\n$result = $payment-\u003ecancel([\n    'cid' =\u003e 'TC0ONETIME', // cid for testing\n    'tid' =\u003e 'T1234567890123456789',\n    'cancel_amount' =\u003e '2200',\n    'cancel_tax_free_amount' =\u003e '0',\n    'cancel_vat_amount' =\u003e '200',\n    'cancel_available_amount' =\u003e '4000',\n]);\n```\n\n#### Order checking\n```\nGET/POST /v1/payment/order HTTP/1.1\n```\n\nExample:\n```php\n$payment = new \\se468\\Kakaopay\\Payment();\n\\se468\\Kakaopay\\Kakaopay::setAdminKey(env('KAKAOPAY_ADMIN_KEY'));\n\n$result = $payment-\u003eorder([\n    'cid' =\u003e 'TC0ONETIME', // cid for testing\n    'tid' =\u003e 'T1234567890123456789',\n]);\n```\n\n#### Checking the Subscription information\n```\nPOST /v1/payment/manage/subscription/status HTTP/1.1\n```\n\nExample:\n```php\n$payment = new \\se468\\Kakaopay\\Payment();\n\\se468\\Kakaopay\\Kakaopay::setAdminKey(env('KAKAOPAY_ADMIN_KEY'));\n\n$result = $payment-\u003eorder([\n    'cid' =\u003e 'TCSUBSCRIP', // cid for testing\n    'tid' =\u003e 'S1234567890987654321',\n]);\n```\n\n#### Deactivating Subscription\n```\nPOST /v1/payment/manage/subscription/inactive HTTP/1.1\n```\n\nExample:\n```php\n$payment = new \\se468\\Kakaopay\\Payment();\n\\se468\\Kakaopay\\Kakaopay::setAdminKey(env('KAKAOPAY_ADMIN_KEY'));\n\n$result = $payment-\u003einactive([\n    'cid' =\u003e 'TCSUBSCRIP', // cid for testing\n    'sid' =\u003e 'S1234567890987654321',\n]);\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fse468%2Fkakaopay-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fse468%2Fkakaopay-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fse468%2Fkakaopay-php/lists"}