diff --git a/web/src/App.js b/web/src/App.js index 903c6e81..5ccfe72c 100644 --- a/web/src/App.js +++ b/web/src/App.js @@ -48,6 +48,7 @@ import ProductEditPage from "./ProductEditPage"; import ProductBuyPage from "./ProductBuyPage"; import PaymentListPage from "./PaymentListPage"; import PaymentEditPage from "./PaymentEditPage"; +import PaymentResultPage from "./PaymentResultPage"; import AccountPage from "./account/AccountPage"; import HomePage from "./basic/HomePage"; import CustomGithubCorner from "./CustomGithubCorner"; @@ -529,6 +530,7 @@ class App extends Component { this.renderLoginIfNotLoggedIn()}/> this.renderLoginIfNotLoggedIn()}/> this.renderLoginIfNotLoggedIn()}/> + this.renderLoginIfNotLoggedIn()}/> this.renderLoginIfNotLoggedIn()}/> }/> { return (
+ { + this.setState({ + payment: payment, + }); + + if (payment.state === "Created") { + setTimeout(() => this.getPayment(), 1000); + } + }); + } + + render() { + const payment = this.state.payment; + + if (payment === null) { + return null; + } + + if (payment.state === "Paid") { + return ( +
+ { + Setting.renderHelmet(payment) + } + { + Setting.goToLink(payment.returnUrl); + }}> + {i18next.t("payment:Return to Website")} + + ]} + /> +
+ ) + } else if (payment.state === "Created") { + return ( +
+ { + Setting.renderHelmet(payment) + } + , + ]} + /> +
+ ) + } else { + return ( +
+ { + Setting.renderHelmet(payment) + } + { + Setting.goToLink(payment.returnUrl); + }}> + {i18next.t("payment:Return to Website")} + + ]} + /> +
+ ) + } + } +} + +export default PaymentResultPage; diff --git a/web/src/locales/de/data.json b/web/src/locales/de/data.json index 3fa3c78e..c4a4112b 100644 --- a/web/src/locales/de/data.json +++ b/web/src/locales/de/data.json @@ -259,14 +259,23 @@ "Currency - Tooltip": "Currency - Tooltip", "Edit Payment": "Edit Payment", "New Payment": "New Payment", + "Please click the below button to return to the original website": "Please click the below button to return to the original website", "Price": "Price", "Price - Tooltip": "Price - Tooltip", + "Processing...": "Processing...", "Product": "Product", "Product - Tooltip": "Product - Tooltip", + "Result": "Result", + "Return to Website": "Return to Website", "State": "State", "State - Tooltip": "State - Tooltip", + "The payment has failed": "The payment has failed", + "The payment is still under processing": "The payment is still under processing", "Type": "Type", - "Type - Tooltip": "Type - Tooltip" + "Type - Tooltip": "Type - Tooltip", + "You have successfully completed the payment": "You have successfully completed the payment", + "please wait for a few seconds...": "please wait for a few seconds...", + "the current state is": "the current state is" }, "permission": { "Actions": "Aktionen", @@ -301,6 +310,8 @@ "Price - Tooltip": "Price - Tooltip", "Quantity": "Quantity", "Quantity - Tooltip": "Quantity - Tooltip", + "Return URL": "Return URL", + "Return URL - Tooltip": "Return URL - Tooltip", "SKU": "SKU", "Sold": "Sold", "Sold - Tooltip": "Sold - Tooltip", diff --git a/web/src/locales/en/data.json b/web/src/locales/en/data.json index 5c61aa4e..5eab9f1b 100644 --- a/web/src/locales/en/data.json +++ b/web/src/locales/en/data.json @@ -259,14 +259,23 @@ "Currency - Tooltip": "Currency - Tooltip", "Edit Payment": "Edit Payment", "New Payment": "New Payment", + "Please click the below button to return to the original website": "Please click the below button to return to the original website", "Price": "Price", "Price - Tooltip": "Price - Tooltip", + "Processing...": "Processing...", "Product": "Product", "Product - Tooltip": "Product - Tooltip", + "Result": "Result", + "Return to Website": "Return to Website", "State": "State", "State - Tooltip": "State - Tooltip", + "The payment has failed": "The payment has failed", + "The payment is still under processing": "The payment is still under processing", "Type": "Type", - "Type - Tooltip": "Type - Tooltip" + "Type - Tooltip": "Type - Tooltip", + "You have successfully completed the payment": "You have successfully completed the payment", + "please wait for a few seconds...": "please wait for a few seconds...", + "the current state is": "the current state is" }, "permission": { "Actions": "Actions", @@ -301,6 +310,8 @@ "Price - Tooltip": "Price - Tooltip", "Quantity": "Quantity", "Quantity - Tooltip": "Quantity - Tooltip", + "Return URL": "Return URL", + "Return URL - Tooltip": "Return URL - Tooltip", "SKU": "SKU", "Sold": "Sold", "Sold - Tooltip": "Sold - Tooltip", diff --git a/web/src/locales/fr/data.json b/web/src/locales/fr/data.json index d34fd052..5bb8f0b5 100644 --- a/web/src/locales/fr/data.json +++ b/web/src/locales/fr/data.json @@ -259,14 +259,23 @@ "Currency - Tooltip": "Currency - Tooltip", "Edit Payment": "Edit Payment", "New Payment": "New Payment", + "Please click the below button to return to the original website": "Please click the below button to return to the original website", "Price": "Price", "Price - Tooltip": "Price - Tooltip", + "Processing...": "Processing...", "Product": "Product", "Product - Tooltip": "Product - Tooltip", + "Result": "Result", + "Return to Website": "Return to Website", "State": "State", "State - Tooltip": "State - Tooltip", + "The payment has failed": "The payment has failed", + "The payment is still under processing": "The payment is still under processing", "Type": "Type", - "Type - Tooltip": "Type - Tooltip" + "Type - Tooltip": "Type - Tooltip", + "You have successfully completed the payment": "You have successfully completed the payment", + "please wait for a few seconds...": "please wait for a few seconds...", + "the current state is": "the current state is" }, "permission": { "Actions": "Actions", @@ -301,6 +310,8 @@ "Price - Tooltip": "Price - Tooltip", "Quantity": "Quantity", "Quantity - Tooltip": "Quantity - Tooltip", + "Return URL": "Return URL", + "Return URL - Tooltip": "Return URL - Tooltip", "SKU": "SKU", "Sold": "Sold", "Sold - Tooltip": "Sold - Tooltip", diff --git a/web/src/locales/ja/data.json b/web/src/locales/ja/data.json index f964eac8..4af44609 100644 --- a/web/src/locales/ja/data.json +++ b/web/src/locales/ja/data.json @@ -259,14 +259,23 @@ "Currency - Tooltip": "Currency - Tooltip", "Edit Payment": "Edit Payment", "New Payment": "New Payment", + "Please click the below button to return to the original website": "Please click the below button to return to the original website", "Price": "Price", "Price - Tooltip": "Price - Tooltip", + "Processing...": "Processing...", "Product": "Product", "Product - Tooltip": "Product - Tooltip", + "Result": "Result", + "Return to Website": "Return to Website", "State": "State", "State - Tooltip": "State - Tooltip", + "The payment has failed": "The payment has failed", + "The payment is still under processing": "The payment is still under processing", "Type": "Type", - "Type - Tooltip": "Type - Tooltip" + "Type - Tooltip": "Type - Tooltip", + "You have successfully completed the payment": "You have successfully completed the payment", + "please wait for a few seconds...": "please wait for a few seconds...", + "the current state is": "the current state is" }, "permission": { "Actions": "アクション", @@ -301,6 +310,8 @@ "Price - Tooltip": "Price - Tooltip", "Quantity": "Quantity", "Quantity - Tooltip": "Quantity - Tooltip", + "Return URL": "Return URL", + "Return URL - Tooltip": "Return URL - Tooltip", "SKU": "SKU", "Sold": "Sold", "Sold - Tooltip": "Sold - Tooltip", diff --git a/web/src/locales/ko/data.json b/web/src/locales/ko/data.json index e499bfad..5e2d7ed2 100644 --- a/web/src/locales/ko/data.json +++ b/web/src/locales/ko/data.json @@ -259,14 +259,23 @@ "Currency - Tooltip": "Currency - Tooltip", "Edit Payment": "Edit Payment", "New Payment": "New Payment", + "Please click the below button to return to the original website": "Please click the below button to return to the original website", "Price": "Price", "Price - Tooltip": "Price - Tooltip", + "Processing...": "Processing...", "Product": "Product", "Product - Tooltip": "Product - Tooltip", + "Result": "Result", + "Return to Website": "Return to Website", "State": "State", "State - Tooltip": "State - Tooltip", + "The payment has failed": "The payment has failed", + "The payment is still under processing": "The payment is still under processing", "Type": "Type", - "Type - Tooltip": "Type - Tooltip" + "Type - Tooltip": "Type - Tooltip", + "You have successfully completed the payment": "You have successfully completed the payment", + "please wait for a few seconds...": "please wait for a few seconds...", + "the current state is": "the current state is" }, "permission": { "Actions": "Actions", @@ -301,6 +310,8 @@ "Price - Tooltip": "Price - Tooltip", "Quantity": "Quantity", "Quantity - Tooltip": "Quantity - Tooltip", + "Return URL": "Return URL", + "Return URL - Tooltip": "Return URL - Tooltip", "SKU": "SKU", "Sold": "Sold", "Sold - Tooltip": "Sold - Tooltip", diff --git a/web/src/locales/ru/data.json b/web/src/locales/ru/data.json index 37ebec1d..14c96bdc 100644 --- a/web/src/locales/ru/data.json +++ b/web/src/locales/ru/data.json @@ -259,14 +259,23 @@ "Currency - Tooltip": "Currency - Tooltip", "Edit Payment": "Edit Payment", "New Payment": "New Payment", + "Please click the below button to return to the original website": "Please click the below button to return to the original website", "Price": "Price", "Price - Tooltip": "Price - Tooltip", + "Processing...": "Processing...", "Product": "Product", "Product - Tooltip": "Product - Tooltip", + "Result": "Result", + "Return to Website": "Return to Website", "State": "State", "State - Tooltip": "State - Tooltip", + "The payment has failed": "The payment has failed", + "The payment is still under processing": "The payment is still under processing", "Type": "Type", - "Type - Tooltip": "Type - Tooltip" + "Type - Tooltip": "Type - Tooltip", + "You have successfully completed the payment": "You have successfully completed the payment", + "please wait for a few seconds...": "please wait for a few seconds...", + "the current state is": "the current state is" }, "permission": { "Actions": "Действия", @@ -301,6 +310,8 @@ "Price - Tooltip": "Price - Tooltip", "Quantity": "Quantity", "Quantity - Tooltip": "Quantity - Tooltip", + "Return URL": "Return URL", + "Return URL - Tooltip": "Return URL - Tooltip", "SKU": "SKU", "Sold": "Sold", "Sold - Tooltip": "Sold - Tooltip", diff --git a/web/src/locales/zh/data.json b/web/src/locales/zh/data.json index e3f35017..b1d8ea8d 100644 --- a/web/src/locales/zh/data.json +++ b/web/src/locales/zh/data.json @@ -259,14 +259,23 @@ "Currency - Tooltip": "如USD(美元),CNY(人民币)等", "Edit Payment": "编辑付款", "New Payment": "添加付款", + "Please click the below button to return to the original website": "请点击下方按钮返回原网站", "Price": "价格", "Price - Tooltip": "商品价格", + "Processing...": "正在处理...", "Product": "商品", "Product - Tooltip": "商品名称", + "Result": "结果", + "Return to Website": "返回原网站", "State": "状态", "State - Tooltip": "交易状态", + "The payment has failed": "支付失败", + "The payment is still under processing": "支付正在处理", "Type": "支付方式", - "Type - Tooltip": "商品购买时的支付方式" + "Type - Tooltip": "商品购买时的支付方式", + "You have successfully completed the payment": "支付成功", + "please wait for a few seconds...": "请稍后...", + "the current state is": "当前状态为" }, "permission": { "Actions": "动作", @@ -301,6 +310,8 @@ "Price - Tooltip": "价格 - 工具提示", "Quantity": "库存", "Quantity - Tooltip": "库存 - 工具提示", + "Return URL": "返回URL", + "Return URL - Tooltip": "返回URL - 工具提示", "SKU": "货号", "Sold": "售出", "Sold - Tooltip": "售出 - 工具提示",