英文:
Custom error message if asynchronous payment can't be initiated
问题
在Shopware文档中提到:
> 如果支付无法启动(例如由于商店的凭据丢失),这种[异步支付响应]也可以返回失败的 status
和/或 message
。
然而,如果我响应一个带有 message
属性的 JSON,其值将不被尊重,我仍然可以在结账页面上看到默认的错误消息。示例负载:
{ "message": "我想为客户显示的自定义消息" }
如何在无法启动异步支付时显示自定义错误消息?文档中是否有我遗漏的重要信息?
英文:
In the Shopware documentation it is stated that:
> in case the payment can't be started (for example because of missing credentials for the shop), this [asynchronous payment response] can also return a fail status
and / or a message
.
However, if I respond with a json having message
property, the value is not respected and I can still see a default error message on a checkout page. Example payload:
{ "message": "my custom message I would like to show for a client" }
How could I show a custom error message if asynchronous payment cannot be initiated? Is there anything important I miss in the documentation?
答案1
得分: 0
我还没有测试过这个,但文档也说明了:
"而不是成功的响应,您还可以提供一个带有消息的失败响应(将被记录)[...]"
所以我认为它并不是用来显示的,而只是用于记录和调试的目的。
英文:
I haven't tested this, but the documentation also states this:
Instead of a successful response, you can also provide a failed response with a message (which will be logged)[...]
So I assume it's not meant to be displayed, but just for logging/debugging purposes.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论