Menu

Widgets

Widget for order confirmation

This widget is linked to API IMA As A Service.

The widget is broken down into several screens:

  1. Order Summary or Additional Quote (in the case of a rider)
  2. Payment of the order in an integrated widget
  3. Confirmation
  4. Technical error

Use

To be able to set up the widget, a preliminary exchange with the support is necessary to declare the url which will integrate the widget and to obtain the key to use.

Once this step is done, integrate the following javascript code, including the appKey provided during the exchanges:

<script type="text/javascript" src="https://widget.ima.eu/widgets/payment/v1/widget?key={{appKey}}"></script>

Then place an HTML element with id ImaPayment :

<div id="ImaPayment" data-token="{{string}}" lang="{{alpha-2}}" withConfirmationPage="{{boolean}}" returnUrlSuccess="{{string}}" returnUrlError="{{string}}" redirectTimeOut="{{integer}}">

With:

  • id : Technical identifier of the element containing the widget, which must always be equal to “ImaPayment”
  • data-token : The token contains the information needed to initialize the widget, to be filled in dynamically : obtained when generating the link/token
  • lang : Allows the consumer to force the language of the widget
  • returnUrlSuccess : Indicates the URL to redirect to an external order confirmation page in case of successful payment if withConfirmationPage = false
  • returnUrlError : Indicates the URL to redirect to an external error page in case of payment failure or internal error, if withConfirmationPage = false
  • redirectTimeOut : Determines the time in milliseconds before a redirection takes place in case of internal error of the widget, if withConfirmationPage = false

Description of the attribute withConfirmationPage :

  1. If value is true :
    1. Displays the widget’s internal payment confirmation page in case of a successful payment
      successful
    2. Return to the order summary page if the payment failed
    3. Displays the internal error page of the widget in case of an error, without no redirection
  2. If value is false :
    1. Redirects to the URL entered in returnUrlSuccess in case of successful payment
    2. Redirects to the URL entered in returnUrlError in case of failed payment
    3. Displays the widget’s internal error page in case of a widget-specific error, then applies a redirect to returnUrlError after a configurable delay with the redirectTimeOut attribute

If returnUrlSuccess and/or returnUrlError are not set while withConfirmationPage is false, the behavior withConfirmationPage = true is applied for each missing returnUrl value.