Accept a payment using Samsung Pay in South Korea
Samsung Pay allows South Korea-based customers to pay using this local payment method.
When a customer makes a payment, we redirect them to our local processor partner to authenticate and authorize the payment. After the customer authorizes the payment, we redirect 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 StripeServer-side
First, you need a Stripe account. Register now.
Use our official libraries for access to the Stripe API from your application:
Create a PaymentIntentServer-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 samsung_
, specify the amount to collect, krw
as the currency, and samsung_
in the payment_method_types list. If you maintain a list of payment method types that you pass when creating a PaymentIntent
, add samsung_
to it.
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.
Make sure that your customers understand the terms of useClient-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:
Remarque
After submission, you will be redirected to complete next steps. This transaction will be processed via NICEPAY in accordance with NICEPAY’s terms of use.
Redirect to local processorClient-side
When a customer clicks to pay with Samsung 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.
<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.
// 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.
to handle redirecting to the checkout page of the local processor. On this page, the customer selects their issuer and authorizes the payment. Add a return_
to determine where Stripe redirects the customer after they complete the payment.
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: 'samsung_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_
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_
includes the following URL query parameters. You can also append your own query parameters to the return_
. They persist throughout the redirect process.
Parameter | Description |
---|---|
payment_ | The unique identifier for the PaymentIntent . |
payment_ | The client secret of the PaymentIntent object. |
Test integration with Samsung Pay
Test your integration with Samsung 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_
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_
to requires_
.