自定义错误消息,如果无法启动异步付款。

huangapple go评论58阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2023年3月9日 13:58:25
  • 转载请务必保留本文链接:https://go.coder-hub.com/75680910.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定