Redirect Workflow

Using the Redirect payment flow allows a customer to be redirected to the gateway payment page to select a payment option that is supported by the gateway. When the payment is processed by the gateway, the customer is redirected back to the CloudBlue Commerce website.

From the Billing perspective, a Redirect plugin is a plugin that implements the Redirect method. Once the Redirect plugin is registered, Billing creates a new Payment System ($(PLUGIN_NAME).Redirect) of the External Payment Site type (for details, refer to Plugin Registration).

The Redirect workflow is the following:

  1. A customer creates an Order in CloudBlue Commerce and proceeds to pay it.

  2. A browser receives the request and calls Billing initiating the payment flow.

  3. Billing detects that the payment method selected by the customer is the Redirect flow.

  4. Billing calls the Redirect method in the plugin associated with the payment method.

  5. The plugin processes the Redirect request.

    1. Depending on the plugin implementation, it may perform an API call to the payment gateway. The payment gateway may require the callbackURL1 (that is, the URL that the payment gateway will redirect to the customer when it finishes processing) to be informed at this point.

  6. The plugin responds with the REDIRECT status and parameters, which includes the URL to redirect to the customer (for details, refer to the Redirect method description).

  7. Billing processes the Redirect method response.

  8. Billing responds with a URL and parameters.

  9. The browser calls the URL through a HTTP POST request. In this HTTP request, parameters received from the plugin will be sent to the payment gateway. These parameters include the callbackURL.

  10. The customer fills out a payment form with the desired payment method and data in the gateway payment page.

  11. The payment gateway processes the request.

  12. The payment gateway calls the callbackURL2, sending the process resulting data.

  13. Billing calls the Callback method in the plugin passing the parameters received in the request.

  14. The plugin completes transactions with the payment gateway.

  15. The plugin responds with the result status and transaction details (for details, refer to the Callback method description).

  16. Billing completes the transaction and updates the Payment and Order status and details.

  17. Billing responds with the URL to redirect back to CloudBlue Commerce.

  18. The customer is redirected back to CloudBlue Commerce. This redirect request is usually a HTTP GET request with the 302 Found status and the location header of the CloudBlue Commerce URL.

    1 Billing provides three callback URLs: return_url, return_url_ok, and return_url_fail. Billing sends those URLs in the Environment array when calling the Redirect and Callback methods.

    2 Note that the callbackURL can be sent to the payment gateway in two ways:

    • During the plugin request method execution, through some payment gateway API call, or

    • In the parameters sent on request.

    The best way depends on how the payment gateway works.

CloudBlue, an Ingram Micro business, uses cookies to improve the usability of our site. By continuing to use this site and/or logging in you are accepting the use of these cookies. For more information, visit our Privacy Policy.