Skip to content

Latest commit

 

History

History
67 lines (47 loc) · 2.66 KB

smilepay.md

File metadata and controls

67 lines (47 loc) · 2.66 KB

SmilePay General Payment Integration Guide

🌐 KO

This guide covers only SmilePay specific information. Check the following general payment integration sections in the README file.

1. Set up PG

Use the following guide to set up SmilePay as PG in test mode: SmilePay General Test Mode Configuration

2. Request payment

To open the payment window, call IMP.request_pay(param, callback).

In both PC and mobile browsers, callback is invoked after calling IMP.request_pay(param, callback).

  • pg: PG
    • If not specified and this is the only PG setting that exists, default PG is automatically set.
    • If there are multiple PG settings, set to smilepay.
  • pay_method : overwritten by the option(card, trans, or point) selected in SmilePay app.
IMP.request_pay({
    pg : 'smilepay',
    pay_method : 'card', // Can be omitted
    merchant_uid : '{Merchant created Order ID}', // Example: order_no_0001
    name : 'Order name: Test payment request',
    amount : 14000,
    buyer_email : '[email protected]',
    buyer_name : 'John Doe',
    buyer_tel : '010-1234-5678',
    buyer_addr : 'Shinsa-dong, Gangnam-gu, Seoul',
    buyer_postcode : '123-456'
}, function(rsp) { // callback logic
	//* ...Omitted (Check sample code in README file)... *//
});

3. Mobile App WebView integration

3.1 iOS

ℹ️ To call the merchant app_scheme to return to the merchant app after payment is approved through the Smile Pay app, the app_scheme value must be registered in advance through the LGCNS contract manager.

SmilePay supports payment via web or app according to the cookie settings.

  • Cookies allowed: web or app
  • Cookies denied: app only

When you allow cookies, you can choose between web login or app login as follows:

SmilePay payment window when cookies are accepted

For web login, enabled state of the Auto Login toggle button is not maintained when you return to the page. To keep automatic login enabled, load the page into the webView by calling WebView.loadHTMLString with the HTML string of the page and baseURL (https://www.mysmilepay.com) as follows:

    if (myPG == "smilepay") {
        if let base = URL(string: "https://www.mysmilepay.com") {
            wv.loadHTMLString("<HTML 내용>", baseURL: base)
        }
    }