Once got a valid response, merchants need to open a new page to the "paymentUrl"


REQUEST

apiKey

M

String

sign

M

String

use a key the encrypt

the timestamp

timestamp

M

Integer

current timestamp

(milliseconds)

server will expire the request

with very old timestamp

type

M

String

​payment type, from

/online/gateway

​e.g.: ALIPAYOS, ALIPAY,

WXPAY, FPSPAY

rrn

M

String

the unique transaction

ID

If the rrn is duplicated with

the previous transaction, the

payment fails and an error

message will be returned to

indicate that the payment is

duplicated.

storeCode

M

String

ST01

tillId

M

String

01

salesman

M

String

9999

txDateTime

M

String

format

yyyy-MM-dd'T'HH:mm

:ssZ

e.g.:2021-06-09T13:10:33+0

800

amt

M

Integer

payment amount, min currency

e.g.: 10 ($0.1)

ccy

M

String

currency code, ONLY support HKD now

e.g.: HKD

lang

M

String

language code, default: zh_hk

e.g.: zh_cn, zh_hk, en

extendParam

M/O

String

in jsonString format:

"{\"subject\":\"Water\",

\"seller\":\"Watsons

HK\"}"

​subject & seller

subject: description of sales

goods/items

seller: description of

merchant

returnUrl

M/O

String

the URL for PMS to

redirect after payment

- if returnUrl is empty. It will

redirect to default PMS

success/fail

(synchronous with

HTTP GET)

result page

- details see here

webhookUrl

M/O

String

the URL for PMS to

notify merchant, by

sending a http request

(asynchronous with

HTTP POST)

- if webhookUrl is empty,

there will be no notify to the

merchant.

- when to stop notifying?

1. notify will be sent

max 5 times, each 5

minutes

2. merchant responses

- notify will be sent with a

Http Request (POST with

JSON)

- details see here

remarks

O

String

cashier

O

String

RESPONSE

errorCode

M

String

details see ErrorCode

errorMessage

O

String

type

M

String

rrn

M

String

the unique transaction

ID

storeCode

O

String

tillId

O

String

txDateTime

M

String

amt

M

Integer

pay amount

ccy

M

String

paymentUrl

M

String

​- PMS renders a

payment page

(support PC desktop

and mobile-site,

details see Http

Headers)

e.g.:https://mapi.alipaydev.com

/gateway.do?subject=Beautylis

h+Order+%23TESTING+-+CH

ANGE+ME&sign_type=RSA&o

ut_trade_no=83159197356096

49&currency=USD&total_fee=1

00&partner=208810112213624

1&notify_url=http%3A%2F%2F

www.alipay.com&sendFormat=

normal&return_url=http%3A%2F%2Fwww.alipay.com&sign=Rb

n7JXjgG%2BWt%2FHK8ej1oov

8OTDrI7rxH%2FQmfNJ%2FyA

SGuayUVvD3NkoP0mLo5rmR

NF8qNrzH0lQ68U0EFcU4Z6p

CVavHI%2BML3lNUagkFQ3Yc

S6f9pY1WoyEUt02%2FC2Vyzx

iEDTM%2FS6o6YiDZaUUdS2E

PTHPBgvJLvghcafyMKTIo%3D

&_input_charset=UTF-8&secon

dary_merchant_id=834945&sec

ondary_merchant_industry=343

5&secondary_merchant_name

=holiday&service=create_forex

_trade

gwRefCode

O

String

gateway reference code

gwErrorCode

O

String

​gateway error code

gwErrorMessage

O

String

gateway error message

extendParam

O

String

​timeout

O

String


Api:

https://pms-prod-fps.ttretail.com/tt-pms-ws/rest/online/sales


Request

{
	"apiKey": "pxBf7pn6IswN7b4N",
	"timestamp": 1623399510000,
	"sign": "KkiMG0H1KFHvj/YdbucvZ8SUwgQ=",
	"lang": "zh_hk",
	"storeCode": "WP001",
	"tillId": "01",
	"txDateTime": "2021-06-11T16:18:30+0800",
	"type": "VMPAY",
	"salesman": "WP9999",
	"cashier": "WP9999",
	"amt": 90000,
	"rrn": "002106110418309975314570",
	"extendParam": "{\"subject\":\"Long Desc\",\"seller\":\"Short Desc\"}",
	"returnUrl": "https://www.xxxx.com/checkout-2/order-paid/648",
	"ccy": "HKD",
	"webhookUrl": "https://www.xxx.com/service/order-paid/648"
}


Response

{
	"type": "VMPAY",
	"rrn": "002106110418309975314570",
	"storeCode": "WP001",
	"tillId": "01",
	"tradeMode": "WEBSITE",
	"txDateTime": "2021-06-11T16:18:30+0800",
	"amt": 90000,
	"additionalAmt": 0,
	"ccy": "HKD",
	"lang": "TC",
	"paymentUrl":
"https://pms-prod-fps.ttretail.com/pms-payment/#/eft-payment?value=ACAC81D9FE
B9D13166066F2E4D557EB7FA8962141B1D962E8923CA8910C078708ADD29AE2
083EB527C97384183DDFB045849491618F5A4531639C9B93542A9B2",
	"gwRefCode": "",
	"gwErrorCode": "Approved",
	"gwErrorMessage": "",
	"timeout": 0,
	"errorCode": "0",
	"errorMessage": "成功"
}

- The returnUrl is provided by merchants, and PMS will redirect to the "returnUrl"

provided by merchants when payment success or failure. (DO NOT guarantee page

redirect success. That is why merchants are highly recommended to take use of

"webhookUrl").


- If returnUrl is empty. It will redirect to default PMS result page


- eg: redirecting to the following page with QUERY PARAMETER after paid success.

https://www.xxxx.com/checkout-2/order-paid/648?rrn=xxxxxx&txDatetime=xxx

xxx&...