Hello,
We are developing a payment app and all works great except one thing.
When shopify call our create payment endpoint, we can sometime reject the payment due to our internal condition (for example, the payment is requested in dollar but we only support euro).
In that, case, and following the documentation, we send a GraphQL mutation request to reject the payment (with a custom error message in the GraphQL request like in the doc).
We receive the answer of the request with the redirect link and we redirect the user to this link, all works well !
Nevertheless, when the user is redirected to the checkout page, the error message is just a generic “technical error” and not our custom message.
It’s strange because when I go to the merchant admin page, I can see our custom message in the order, so it means all worked as expected.
My question:
What is the proper way to customize the error message displayed to the client after redirecting to checkout page ?
Thanks
2 Likes
Yeah exactly the same issue. Did you solve it? I am making a request to the GraphQL api 2022-04
mutation RefundSessionReject(\$id: ID!, \$reason: RefundSessionRejectionReasonInput!) {
refundSessionReject(id: \$id, reason: \$reason) {
refundSession {
id
status {
code
reason {
... on RefundSessionStatusReason {
code
merchantMessage
}
}
}
}
userErrors {
field
message
}
}
}
I see proper response and it redirects me to the Shopify store and no matter what the reason of the rejection is, I am always facing
When I post successful payment, everything works well.
Maybe the reason is Test mode?
Sadly it’s not a bug, it’s the intended behavior, Shopify doesn’t allow customization of this message whereas with the old gateway mode it was possible.
1 Like
Just to be consistent I posted refund part in code section.
This is the one that I’m using for payment rejection
mutation paymentSessionReject(\$id: ID!, \$reason: PaymentSessionRejectionReasonInput!) {
paymentSessionReject(id: \$id, reason: \$reason) {
paymentSession {
id
nextAction {
action
context {
... on PaymentSessionActionsRedirect {
redirectUrl
}
}
}
}
userErrors {
field
message
}
}
}
Hello Szymontp, Have you solved this issue? I’m also getting exactly the same issue.
+1 to this. Wish we could have some way to tell customer what went wrong.