How do you handle payment timeouts in maya api?
To handle payment timeouts in Maya’s API, follow these best practices:
- Set appropriate timeouts: Use a connection timeout of 10 seconds and a read timeout of 60 seconds when making API requests, as recommended for reliable communication.
- Use idempotency keys: Include the
X-Idempotency-Keyheader in your requests to safely retry failed or timed-out calls. Maya will return the original response if the request is identified as a retransmission. - Verify transaction status before retrying: If a timeout occurs, do not immediately retry the payment. Instead, use the
GET /payments/v1/payments/{paymentId}orGET /payments/v1/payments/{paymentId}/statusendpoint to check the current status of the transaction before proceeding. - Avoid duplicate charges: Only retry after confirming the transaction was not processed. For example, if you receive a timeout during Execute Maya Mini App Payment or Capture, check the payment status first to avoid triggering error
PY0010(already processed) orPY0103(expired authorization). - Implement recovery logic: For ECR integrations, use the
CHECKcommand to re-sync with the Maya Terminal if communication is lost, and retry up to 3 times before initiating a new SALE request.
These practices apply across Maya Checkout, QRPh, Mini App, and Payments Processing Platform integrations.
For Sandbox concerns and other technical implementation inquiries, please get in touch with us via:
- Sandbox Health Page: Check real-time service status updates.
- Maya Developer Hub Service Desk: File
a ticket in Sandbox.
To Know More:
We value your input and would love to hear your insights. Please submit you feedback here.