Redirects

Together with the integration of the payment functionalities, MoneyHash recommends you set up a notification system to track all operations related to your business. This way, you can stay up to date with all operations related to each transaction. You can accomplish this using Webhooks or Redirects. This page focuses on the Redirects solution.

Why use Redirects

After integrating with MoneyHash, you may want to receive immediate notifications in your application when certain events occur, such as a successful transaction. Redirects offer a powerful solution for achieving this. They enable MoneyHash to automatically direct your customers to a designated web page without requiring continuous requests to your server. Unlike Webhooks, which use a different URL to send you a POST request, Redirects provides instant feedback within the redirected page.

Redirects are a great way to ensure a smooth user experience and keep you and your customers informed about the status of a transaction or event. The first step is to create different URLs for each possible scenario during the payment process, such as success, failure, and pending. Your customers will be directed to the appropriate page based on the outcome. MoneyHash will provide all the necessary information by combining the parameters with the redirect_url. Below is an example of a redirecting URL for a successful transaction. You can access the transaction ID, amount, currency, and more from the URL.

https://your-redirect-url.com/success?type=transaction.successful&status=SUCCESSFUL&transaction_id=60794bb7-a0c4-4b63-8184-8444fe3c916a&intent_id=LWWA7GL&amount=50.00&currency=USD&token_saved=False

Setting up Redirects

Using redirects is very similar to the use of webhooks in MoneyHash. When creating a new intent to start a payment process, you can provide the payload with different redirect_urls for each different possible event. The table below presents the possible parameters you can provide when creating the intent and their descriptions.

ParameterDescription
successful_redirect_urlThe URL where customers will be redirected after a successful transaction. This page should confirm the successful completion of a transaction and may provide additional details or instructions.
failed_redirect_urlThe URL to which customers will be redirected if a transaction fails. This page should communicate the failure, suggest possible solutions, and ensure transparency in the transaction process.
pending_external_action_redirect_urlThe URL to redirect customers to when an action external to your application is required to complete a transaction. This page should guide users on what external action is needed and how to proceed, ensuring a seamless customer experience.
time_expired_redirect_urlThe URL to which customers will be redirected if intent is expired. This page should communicate the end of the intent, suggest possible solutions, and ensure transparency in the transaction process.
closed_redirect_urlThe URL to which customers will be redirected if intent is closed. This page should communicate the end of the intent, suggest possible solutions, and ensure transparency in the transaction process.