|
@@ -17,10 +17,10 @@ public class OmgPaymentReturnPageRenderer {
|
|
|
public OmgPaymentReturnPage success(String orderId) {
|
|
public OmgPaymentReturnPage success(String orderId) {
|
|
|
String appLink = buildAppLink(orderId);
|
|
String appLink = buildAppLink(orderId);
|
|
|
if (appLink == null) {
|
|
if (appLink == null) {
|
|
|
- return error(503, "App 返回地址尚未配置");
|
|
|
|
|
|
|
+ return error(503, "App 返回網址尚未設定");
|
|
|
}
|
|
}
|
|
|
String escapedLink = escapeHtml(appLink);
|
|
String escapedLink = escapeHtml(appLink);
|
|
|
- String html = page("正在返回 App", "请稍候,App 打开后会确认最终付款状态。",
|
|
|
|
|
|
|
+ String html = page("正在返回 App", "請稍候,App 開啟後會確認最終付款狀態。",
|
|
|
"<a id=\"open-app\" href=\"" + escapedLink + "\">返回 App</a>"
|
|
"<a id=\"open-app\" href=\"" + escapedLink + "\">返回 App</a>"
|
|
|
+ "<script>window.location.replace(document.getElementById('open-app').href);</script>");
|
|
+ "<script>window.location.replace(document.getElementById('open-app').href);</script>");
|
|
|
return new OmgPaymentReturnPage(200, html);
|
|
return new OmgPaymentReturnPage(200, html);
|
|
@@ -28,7 +28,7 @@ public class OmgPaymentReturnPageRenderer {
|
|
|
|
|
|
|
|
public OmgPaymentReturnPage error(int statusCode, String message) {
|
|
public OmgPaymentReturnPage error(int statusCode, String message) {
|
|
|
return new OmgPaymentReturnPage(statusCode,
|
|
return new OmgPaymentReturnPage(statusCode,
|
|
|
- page("无法返回 App", escapeHtml(message), ""));
|
|
|
|
|
|
|
+ page("無法返回 App", escapeHtml(message), ""));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private String buildAppLink(String orderId) {
|
|
private String buildAppLink(String orderId) {
|
|
@@ -40,7 +40,7 @@ public class OmgPaymentReturnPageRenderer {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private static String page(String title, String message, String action) {
|
|
private static String page(String title, String message, String action) {
|
|
|
- return "<!doctype html><html lang=\"zh-Hant\"><head><meta charset=\"utf-8\">"
|
|
|
|
|
|
|
+ return "<!doctype html><html lang=\"zh-Hant-TW\"><head><meta charset=\"utf-8\">"
|
|
|
+ "<meta name=\"viewport\" content=\"width=device-width,initial-scale=1\">"
|
|
+ "<meta name=\"viewport\" content=\"width=device-width,initial-scale=1\">"
|
|
|
+ "<title>" + title + "</title><style>body{font-family:system-ui,sans-serif;"
|
|
+ "<title>" + title + "</title><style>body{font-family:system-ui,sans-serif;"
|
|
|
+ "margin:0;padding:32px;background:#f7f7f7;color:#222;text-align:center}main{max-width:480px;"
|
|
+ "margin:0;padding:32px;background:#f7f7f7;color:#222;text-align:center}main{max-width:480px;"
|