Javascript:

var timestamp = ''+(new Date()).getTime();
var secret = 'secret';
var encrypted = CryptoJS.HmacSHA1(timestamp, secret); 
encrypted = CryptoJS.enc.Base64.stringify(encrypted);

Java:

String timestamp = ""+System.currentTimeMillis(); 
String secret = "secret"
SecretKeySpec secretKeySpec = new SecretKeySpec(secret.getBytes(), "HmacSHA1"); 
Mac mac = Mac.getInstance("HmacSHA1");
mac.init(secretKeySpec);
String encrypted = Base64.getEncoder().encodeToString(mac.doFinal(timestamp.getBytes("UTF-8")));

Service Api: https://pms-prod-fps.ttretail.com/online/gateway


Request

{
	"apiKey": "pxBf7pn6IswN7b4N",
	"lang": "zh_hk",
	"sign": "oqfrzy/ABJH4vn+LA0E4wz1UA0c=",
	"timestamp": 1623205724171
}

Response

{
    "extendParam": "",
    "gateways": [{
                                8/22
                "type": "WXPAY",
                "desc": "Wechat Pay",
                "langDesc": "微信支付",
                "base64Logo": "data:image/svg+xml;base64,..."
		}, {
                "type": "ALIPAY",
                "desc": "Alipay",
                "langDesc": "支付寶",
                "base64Logo": "data:image/svg+xml;base64,..."
		}, {
                "type": "ALIPAYOS",
                "desc": "Alipay Oversea",
                "langDesc": "支付寶(香港)",
                "base64Logo": "data:image/svg+xml;base64,..."
		}, {
                "type": "FPSPAY",
                "desc": "Faster Payment System Pay",
                "langDesc": "轉數快",
                "base64Logo": "data:image/svg+xml;base64,..."
		}, {
                "type": "VMPAY",
                "desc": "Visa/Master Online",
                "langDesc": "信用卡支付",
                "base64Logo": "data:image/svg+xml;base64,..."
		}, {
                "type": "UNIONPAY",
                "desc": "Union Pay",
                "langDesc": "銀聯(信用卡)支付",
                "base64Logo": "data:image/svg+xml;base64,..."
		}
    ],
    "errorCode": "0",
    "errorMessage": "no error"
}

1. Content-Type

- application/json

2. User-Agent

- PMS will render a PC-version or a Mobile-version page, which depends on

the "User-Agent" in the request.