SlimPay Help Center

URLs Management

In this article you will find the most frequent questions about URL:

What is a notification URL?

A notification URL proceeds to a server treatment on your side, after a signature or a payment made through the SlimPay tunnel.

The content

A notification contains exactly the same content as a #get-orders API call.

How to retrieve it

The notification is sent from SlimPay in a JSON. You must retrieve the entire body and parse it.

Since the PHP does not automatically parse the JSON, you must do it manually, otherwise the notification seems to be empty.

Two examples below:

$body = file_get_contents("php://input"); // string of the whole body

$json = json_decode($body, true); // array of the whole body

With the client PHP provided by SlimPay:

$body = file_get_contents("php://input"); // string of the whole body

$resource = \HapiClient\Hal\Resource::fromJson($body); // \HapiClient\Hal\Resource Object

$state = $resource->getState(); // array of the state of the resource (all the properties except the _links)

What is a return URL?

A return URL allows users to come back on the merchant's page after the signature or a payment did on SlimPay pages.

The content

There is no information sent in the return URL. However, with your agreement, we have the possibility to activate an option that add the transaction reference in the return URL. In this way, your URL will have this format:

http://YOUR/RETURN/URL?order_reference=id-of-the-transaction

You can do a #get-orders with this ID and retrieve the same information as the one sent in the notification URL.

What is the difference between notification URL and return URL?

  • The return URL is the page on which your clients will be at the end of the process or after a cancellation or a failure.
  • The notification URL is a URL to your server that can update your database in back-end (server to server).

How to configure the URLs?

 

Dashboard V1

(also called Back Office)

API
Notification URL You can configure your URL going to Administration > HAPI APP Management > Create.  -- 
Return URL

You can configure your URL going to Administration > HAPI APP Management > Create.

Only one URL can be configured, whatever the transaction result.

You can configure the URL putting directly in your request #create-orders with the returnUrl, failureUrl, successUrl, cancelUrl parameters. 

 

Can you handle different return URLs?

Yes, it is possible. When you create orders you can put directly via API one URL in case of success, one in case of failure and one in case of cancellation. The utilization of dynamic URLs does not give the possibility to retrieve the order_reference via the return URL.

Via the Back Office, only one URL can be configured.

How to handle dynamic URLs?

With a #create-orders you can send the return URLs. For more information you can visit this page.

 

 

Was this article helpful?
1 out of 1 found this helpful