Webshop 支付联动

circle-info

为联动 ONE webshop 支付,必须完成 PNS 接收 和 购买确认。

  • PNS(Payment Notification Service)

    • 用户完成购买后,Webshop 会通过 PNS 通知将支付结果与相关信息发送至开发者服务器 URL。

    • 请根据该信息向用户发放道具。

  • 购买确认

    • 用于将道具已成功发放的信息通知至 ONE store 服务器。

    • 可根据需求使用 consumePurchase 或 acknowledgePurchase。

    • 若购买确认未在 3 天内完成,则视为发放失败,该购买将自动取消。

1. PNS

发生购买或取消时,ONE store 会向开发者服务器发送通知。

circle-info

PNS 规范与 In‑App Payment API V7 相同 (Reference : 使用PNS(Push Notification Service))

1.1 Configure PNS Reception Server URL

可在以下位置设置 PNS 接收 URL:Developer Center > Webshop > Integration Mgmt.

详细设置方法请参考 Integration Mgmt Guide

1.2 PNS 详细规格

URI : 在开发者中心设置的 Payment Notification URL

Method : POST

Request Parameters : N/A

Request Header :

Name
Type
Value

Content-Type

String

application/json

Request Body : JSON format

Name
Type
Description

msgVersion

String

消息版本

  • 开发(Sandbox) : 3.1.0D

  • 商用(商用测试) : 3.1.0

clientId

String

ONE webshop 标题 ID(商品 ID)

productId

String

ONE webshop 道具 ID(In-App 商品 ID)

messageType

String

SINGLE_PAYMENT_TRANSACTION 固定

purchaseId

String

购买ID

developerPayload

String

由开发公司管理以标识购买件的标识符

  • 该参数属于 PNS 公共规范项,在 Webshop 中不使用。

purchaseTimeMillis

Long

在ONE store支付系统中完成支付的时间(ms)

purchaseState

String

COMPLETED : 已支付 / CANCELED : 取消

price

String

支付金额

priceCurrencyCode

String

支付金额货币代码(KRW, USD, ...)

productName

String

请求购买时,如开发公司设置了customized In-App商品标题则传达

paymentTypeList[]

List

支付信息列表

paymentTypeList[].paymentMethod

String

Payment method (for details, refer to the definition of paymentMethod)

paymentTypeList[].amount

String

Amount per payment method

billingKey

String

用于扩展的付款密钥

isTestMdn

Boolean

是否是测试机(true : 测试机, false : 非测试机)

purchaseToken

String

购买token

environment

String

支付环境

  • 开发(SANDBOX) : SANDBOX

  • 商用 :COMMERCIAL

marketCode

String

市场分类编码 ( MKT_ONE : ONE store, MKT_GLB : Global ONE store)

  • 在 Webshop 中,该值固定为 MKT_ONE。

signature

String

此消息的signature

serviceUserId

String

用户游戏 ID

serviceServerId

String

用户服务器 ID

Example

paymentMethod(ONE store支付方式)定义

paymentMethod
支付方式名称
说明

DCB

手机支付

在运营商费用账单上以"信息使用费"项目收取

PHONEBILL

手机小额支付

在运营商费用账单上以"小额支付"项目收取

ONEPAY

ONE pay

ONE store提供的便捷支付

CREDITCARD

信用卡

一般信用卡支付

11PAY

11Pay

SK Plannet提供的信用卡便捷支付

NAVERPAY

N pay

Naver提供的Naver pay支付

CULTURELAND

Culture cash

韩国文化振兴提供的Culture cash支付

TELCOMEMBERSHIP

通讯公司会员

通讯公司提供的会员支付

OCB

OK cashbag

SK Plannet提供的OK cashbag支付

POINT

ONE store point

ONE store point支付

ONESTORECASH

ONE store cash

ONE store cash支付

COUPON

ONE store coupon

ONE store Coupon支付

EWALLET

e-Wallet

e-Wallet支付

BANKACCT

银行账户支付

一般银行账户支付

PAYPAL

PAYPAL

Paypal支付

MYCARD

My card

智冠科技提供的MY CARD支付

Signatue验证方法

使用下面的代码,您可以检查signature是否伪造。

  • 代码中的 PublicKey 指的是 Developer Center > Webshop > Intergration Mgmt. > Settings for Licensing菜单中提供的许可证密钥。

1.3 Notification传输方法

ONE store中的PNS服务器通过HTTP(S)请求向开发公司服务器发送notification。

此时,开发公司服务器应以200响应HTTP Status Code,表示已正常接收notification。

如果由于网络延迟而丢失,或者由于开发公司服务器的异常情况,HTTP Status Code未能以200进行响应,PNS服务器将认为notification传输失败,并在3天内最多执行30次重传。

Notification的重传是在具有一定delay后执行,如下例所示,当重试次数增多时,delay会逐渐增加。

Example

次数
delay (秒)
重传时间

0 (首次)

0

2020-05-17 13:10:00

1

30

2020-05-17 13:10:30

2

120

2020-05-17 13:12:30

3

270

2020-05-17 13:17:00

4

480

2020-05-17 13:25:00

...

...

...

2. 购买确认

为确保道具正常发放,必须执行购买确认流程。

circle-exclamation

2.1 consumePurchase

[ API Spec. ]

Protocol
HTTPS
Method
POS

Content-Type

application/json

Response Format

application/json

Description

  • 将购买的管理型商品状态更改为消费状态。

    • 处理完成后,用户可以再次购买相同道具

[ Request ]

Parameter

Parameter Name
Data Type
Required
Description

clientId

String

Y

调用 API的应用软件客户端ID

purchaseToken

String

Y

购买token

Header

Parameter Name
Data Type
Required
Description

Authorization

String

Y

通过Access Token API接收的access_token

x-market-code

String

N

市场分类代码

  • MKT_ONE: South Korea

  • MKT_GLB: other than South Korea

Body

Parameter Name
Data Type
Data Size
Required
Description

developerPayload

String

200

N

开发公司提供的支付固有标识符

Example

[ Response ]

Element Name
Data Type
Data Size
Description

result

Object

{

code

String

50

Response Code (Successful Processing)

message

String

300

Response Message (Successful Processing)

}

Example

2.2 acknowledgePurchase

[ API Spec. ]

Protocol
HTTPS
Method
POST

Content-Type

application/json

Response Format

application/json

Description

  • 将购买的管理型或包月型商品变更为购买确认状态。

    • 处理完成后,用户可以再次购买相同道具

[ Request ]

Parameter

Parameter
Data Type
Required
Description

clientId

String

Y

调用 API的应用软件客户端ID

purchaseToken

String

Y

购买token

Header

Parameter Name
Data Type
Required
Description

Authorization

String

Y

通过Access Token API接收的access_token

x-market-code

String

N

市场分类代码

  • MKT_ONE: South Korea

  • MKT_GLB: other than South Korea

Body

Element Name
Data Type
Data Size
Required
Description

developerPayload

String

200

N

开发公司提供的支付固有标识符

Example

[ Response ]

Element Name
Data Type
Data Size
Description

result

Object

{

code

String

50

Response Code (Successful Processing)

message

String

300

Response Message (Successful Processing)

}

Example

Last updated