Verify Payments

Verify Payments

Verify transactions after payments using Lahza's verify API

How to verify payments

From Popup or Mobile SDKs

You'll have to send the reference to your server, then from your server you call the verify endpoint.

From the Redirect API

You initiate this request from your callback URL. The transaction reference is returned as a query parameter to your callback URL.

Always confirm that you have not already delivered value for that transaction to avoid double fulfillments, especially, if you also use webhooks.

Here's a code sample for verifying transactions:

curl https://api.lahza.io/transaction/verify/:reference
-H "Authorization: Bearer YOUR_SECRET_KEY"
-X GET

The API response includes a key called response.status, which indicates the status of the API call itself. It is important to note that this is not the status of the transaction. To obtain the status of the transaction, you need to refer to the data object within the verify API response, specifically response.data.status. For more detailed information about the format of the Lahza API responses, please refer to the documentation to gain a comprehensive understanding.

Charge returning Users

The verify response also provides information about the payment instrument used by the user in the data.authorization object. If the channel indicates a card payment, you can store the authorization_code associated with that card for the respective user. This stored authorization code can then be used for future transactions to charge the user conveniently without requiring them to re-enter their payment details. This allows for a seamless payment experience for subsequent transactions. Learn more about recurring charges.

Last updated