Redirect

Purpose

Implements a redirection to the payment gateway page.

Mandatory

Yes, if a redirection to the gateway page is required.

Input Parameters

An associative array that contains the following values:

Param name Description Type
config The plug-in configuration values saved in the Billing database. array
environment The Billing environment information. Environment
account_info The account's details. AccountDetails
vendor_info the vendor's details. AccountDetails
document_info The payment document description. DocumentInfo

transaction_category

The transaction category for merchant-initiated payments (relevant and available only for transaction_initiator = MIT). Possible values are:

  • C: for Unscheduled Credential on File payments,
  • R: for recurring payments (payments at regular intervals).
string

transaction_moto

The parameter that defines whether it is the MOTO transaction. Possible values are:

  • true: for MIT payments on behalf of a customer,
  • transaction_moto is not sent: for CIT payments and recurring or renewing MIT payments.
boolean

transaction_initiator

The transaction initiator. Possible values are:

string
ref_no The Billing transaction identifier. integer
transaction_amount The transaction amount. double
currency_iso The currency of the transaction amount in the ISO format (for example, USD or EUR). string

current_lang

The current language. string
client_ip The IP from the client computer. string

The example of input parameters is shown below as a JSON object:

Response

An associative array that contains the following keys:

Param name Description Type
STATUS (Mandatory) The method execution status. Valid values for the Redirect method are:
  • REDIRECT: The request is successfully processed and a customer is redirected to the payment gateway.
  • DECLINED: The request processing failed. The reason or error message can be sent in the TEXT parameter.
string
TEXT (Optional) The array that contains the following parameters:
  • customer_message: Contains text that will be displayed to a customer as a status message (String, optional).
  • vendor_message: Contains text that will be displayed to a vendor (String, optional).
array
REDIRECT_HASH

(Mandatory) Provides information for the redirect. The parameters are:

  • url: The URL where a customer is redirected (String, mandatory).
  • attrs: Parameters and values that will be used for redirect (Array, mandatory).
  • method: The method used to pass the data: GET, POST. If not set, the POST method will be used (String, optional).
array
TRANSACTION_DETAIL

(Optional) The array that will be associated with the current transaction and will be represented back in an unchanged form as the value of the previous_transaction_data parameter at the next call of transaction processing methods of the plugin.

Note: Billing looks up the trans_id parameter that identifies a transaction on the gateway side to display it in the provider's UI. We highly recommend that you use this parameter.

array

The example of a response is shown below as a JSON object:

Example

The built-in Demo plugin supports Redirect. The example below shows how this plugin implements the Redirect method:

See Also

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.