Skip to content
Create account
or
Sign in
The Stripe Docs logo
/
Ask AI
Create account
Sign in
Get started
Payments
Revenue
Platforms and marketplaces
Money management
Developer tools
Overview
About Stripe payments
Upgrade your integration
Payments analytics
Online payments
OverviewFind your use caseManaged Payments
Use Payment Links
Build a checkout page
Build an advanced integration
Build an in-app integration
Payment Methods
Add payment methods
    Overview
    Payment method integration options
    Manage default payment methods in the Dashboard
    Payment method types
    Cards
    Pay with Stripe balance
    Crypto
    Bank debits
    Bank redirects
    Bank transfers
    Credit transfers (Sources)
    Buy now, pay later
    Real-time payments
    Vouchers
    Wallets
    Enable local payment methods by country
      Nigeria
      South Korea
        South Korean cards
        Kakao Pay
          Accept a payment
          Set up future payments
        Naver Pay
        PAYCO
        Samsung Pay
    Custom payment methods
Manage payment methods
Faster checkout with Link
Payment interfaces
Payment Links
Checkout
Web Elements
In-app Elements
Payment scenarios
Custom payment flows
Flexible acquiring
Orchestration
In-person payments
Terminal
Other Stripe products
Financial Connections
Crypto
Climate
HomePaymentsAdd payment methodsEnable local payment methods by countrySouth Korea

Accept a payment using Kakao Pay in South Korea

Learn how to accept payments from Kakao Pay users.

Copy page

Integrating with Kakao Pay enables South Korea-based customers to pay using this popular local payment method.

When a customer makes a payment, we redirect them to our local processor partner to authenticate and authorise the payment. After the customer authorises the payment, Stripe redirects them back to your site.

Use the Payment Intents API to accept payments from South Korean customers using local cards and local payment methods.

Set up Stripe
Server-side

First, you need a Stripe account. Register now.

Use our official libraries for access to the Stripe API from your application:

Command Line
Ruby
# Available as a gem sudo gem install stripe
Gemfile
Ruby
# If you use bundler, you can add this line to your Gemfile gem 'stripe'

Create a PaymentIntent
Server-side

A PaymentIntent is an object that represents your intent to collect a payment from a customer and tracks the payment process. To create a PaymentIntent that accepts a payment using kakao_pay, specify the amount to collect, krw as the currency, and kakao_pay in the payment_method_types list. If you maintain a list of payment method types that you pass when creating a PaymentIntent, add kakao_pay to it.

Additionally, you must provide the buyer’s email address.

Command Line
cURL
curl https://api.stripe.com/v1/payment_intents \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d amount=10000 \ -d currency=krw \ -d "payment_method_types[]"=kakao_pay \ -d "payment_method_data[type]"=kakao_pay \ --data-urlencode "payment_method_data[billing_details][email]"="jane.diaz@stripe.com"

Retrieve the client secret

The PaymentIntent includes a client secret that the client side uses to securely complete the payment process. You can use different approaches to pass the client secret to the client side.

Retrieve the client secret from an endpoint on your server, using the browser’s fetch function. This approach is best if your client side is a single-page application, particularly one built with a modern front-end framework such as React. Create the server endpoint that serves the client secret:

main.rb
Ruby
get '/secret' do intent = # ... Create or retrieve the PaymentIntent {client_secret: intent.client_secret}.to_json end

And then fetch the client secret with JavaScript on the client side:

(async () => { const response = await fetch('/secret'); const {client_secret: clientSecret} = await response.json(); // Render the form using the clientSecret })();

Make sure that your customers understand the terms of use
Client-side

Stripe’s processor partner requires that customers be made aware of the identity of the processor, and understand its terms of use. You must include the following language and link in your checkout page:

Note

After submission, you’re redirected to complete next steps. This transaction is processed through NICEPAY in accordance with NICEPAY’s terms of use.

Redirect to local processor
Client-side

When a customer clicks to pay with Kakao Pay, use Stripe.js to submit the payment to Stripe. Stripe.js is the foundational JavaScript library for building payment flows. It automatically handles complexities like the redirect described below, and enables you to extend your integration to other payment methods. Include the Stripe.js script on your checkout page by adding it to the head of your HTML file.

checkout.html
<head> <title>Checkout</title> <script src="https://js.stripe.com/v3/"></script> </head>

Create an instance of Stripe.js with the following JavaScript on your checkout page.

client.js
// Set your publishable key. Remember to change this to your live publishable key in production! // See your keys here: https://dashboard.stripe.com/apikeys const stripe = Stripe(
'pk_test_TYooMQauvdEDq54NiTphI7jx'
);

Use the client secret of the PaymentIntent and call stripe.confirmPayment to handle redirecting to the checkout page of the local processor. On this page, the customer selects their issuer and authorises the payment. Add a return_url to determine where Stripe redirects the customer after they complete the payment.

client.js
const form = document.getElementById('payment-form'); form.addEventListener('submit', async function(event) { event.preventDefault(); // Set the clientSecret of the PaymentIntent const { error } = await stripe.confirmPayment({ clientSecret: clientSecret, confirmParams: { payment_method_data: { type: 'kakao_pay', }, // Return URL where the customer should be redirected after the authorization return_url: `${window.location.href}`, }, }); if (error) { // Inform the customer that there was an error. const errorElement = document.getElementById('error-message'); errorElement.textContent = result.error.message; } });

The return_url corresponds to a page on your website that displays the result of the payment. You can determine what to display by verifying the status of the PaymentIntent. To verify the status, the Stripe redirect to the return_url includes the following URL query parameters. You can also append your own query parameters to the return_url. They persist throughout the redirect process.

ParameterDescription
payment_intentThe unique identifier for the PaymentIntent.
payment_intent_client_secretThe client secret of the PaymentIntent object.

Test integration with Kakao Pay

Test your integration with Kakao Pay with your test API keys by viewing the redirect page. You can test the successful payment case by authenticating the payment on the redirect page. The PaymentIntent transitions from requires_action to succeeded. To test the case where the customer fails to authenticate, use your test API keys and view the redirect page. On the redirect page, click Fail test payment. The PaymentIntent transitions from requires_action to requires_payment_method.

OptionalHandle post-payment events

Was this page helpful?
YesNo
Need help? Contact Support.
Join our early access programme.
Check out our changelog.
Questions? Contact Sales.
LLM? Read llms.txt.
Powered by Markdoc