Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add specific type and min supported amount in error response for the payments below min supported amount #10092

Closed
kidinov opened this issue Jan 7, 2025 · 0 comments · Fixed by #10112

Comments

@kidinov
Copy link

kidinov commented Jan 7, 2025

Description

Currently, for Tap To Pay and Card Payments, when the amount is lower than the minimum supported in a country, we get the following response

curl -v -X POST 'https://public-api.wordpress.com/rest/v1.1/jetpack-blogs/198349371/rest-api/?locale=en_US' .... '{"path":"/wc/v3/payments/orders/2408/capture_terminal_payment/\u0026_method\u003dpost","json":"true","body":"{\"payment_intent_id\":\"pi_\"}"}'
{"error":"wcpay_capture_error","message":"Payment capture failed to complete with the following message: Minimum required amount was not reached."}

To handle it correctly and show complete necessary information on the clients, we need:

  • Specific error type, e.g. wcpay_capture_error_amount_too_small instead of generic wcpay_capture_error
  • The minimum amount in the country, e.g., extra field "minimum_amount": "500" in the respons

Additional context

pdfdoF-67u-p2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment