Once the payment step has been performed, regardless of its outcome, you will have to redirect the user appropriately.
Validity of the parameters that were sent in initial payment request will determine the redirection process. Basically, it depends on whether the transaction is successful, canceled or failed.
## Redirection when payment is successful
##
If status of the payment flow is **SUCCESS**, end user will be redirected to **returnurl**, which should lead directly to content.
**One Time payment redirection**
**Subscription redirection**
When **returnurl** is sent with a valid value (i.e. valid URL, http://www.google.com), user will be returned to the specified URL. If this parameter is not sent in the initial request, Centili will display the final payment page and remain on it by default.
In case when user is redirected to the return URL, our system will forward additional parameters in order to supply you with all necessary data about the particular transaction and its status. Those parameters will be added to return URL and are described below:
### Parameters:
Parameter | Description | Example |
**trid** | Transaction ID, a unique identifier of transaction in Centili system. | Lg+csT/uQVWFW+BQbUQyJA== |
**userid** | Identification of the end user who is performing the payment at that moment. | usrId1983 _NOTE: If the value is not set within the payment request, this field will contain MSISDN of the particular customer._ |
**status** | Status of finished transaction. | _ success _ failed * canceled |
**reference** | Unique identification parameter under your system (pass-through variable). | appID1 |
**operator** | End user mobile network operator. | ES_VODAFONE |
**subscriptionid** | If user is subscribed you will get the ID of his subscription under Centili system. | 1234567 |
**activesub** | Provides an information if user is already subscribed to this service. | _ **true** - user is subscribed _ **false** - user is not subscribed |
**validsub** | Provides an information if user is already subscribed to this service Checks if the end user was charged for the subscription period during the last renewal attempt. | _ **true** - user was charged _ **false** - user wasn't charged |
**timestamp** | Gives you an information if user was charged for the service in the past. The number string represents seconds from the moment when user was charged last time. | 1462888063 |
**sign** | Represents signed string of all concatenated request parameters sorted alphabetically with Centili issued key using previously agreed encoding algorithm. _NOTE: Please refer to the [signature key generation guide](🔗)._ | 1f7a5457f65f745787h7a7e578 |
If you are trying to subscribe the end user to the subscription service to which he is already subscribed, you will get additional parameters **activesub** and **validsub** ( with possible values _true_ or _false_). If user is already subscribed you should provide him with content immediately.
The same thing should occur if user has a valid but not active subscription, e.g. user has _unsubscribed_ from the service, but he still has access to the content he payed for, for the remaining period of subscription. In case when subscription is neither valid nor active user will be redirected to the payment page.
Also, in some cases when WAP flow is enabled you can get a unique identifier of the identification transaction, _identid_, concatenated to parameter list.
If user is already subscribed to the service but you are trying to subscribe him again, he will be returned back to:
You can see that user has an active subscription under our system and that he should be redirected to the content.
## Redirection when payment is canceled
##
If transaction is **CANCELED** before user entered the mobile phone number into the Centili widget he will be returned back to the initially sent **returnurl** during payment request with parameter: status=canceled.
If transaction is CANCELED by user during the payment flow we will return user back to 'returnURL' with following parameters:
status=canceled,
trid=231xxxxx,
userid= <userid>,
msisdn=<enduser_msisdn>,
operator=<enduser_mno>,
reference=<your_transaction_identifier >.
## Redirection when payment is failed
##
If transaction is in **FAILED** state it means that some error occurred during the payment flow and user will also be returned back with following parameters:
status=failed,
trid=231xxxxxx,
userid=<userid>,
reference=<passthrough variable from your system>,
error_description=<description of the error which caused transaction to fail>
Depending on the country your services are deployed to, parameters you receive in this redirection may vary. For the final update please check with Centili Platform Operations team via [[email protected]](🔗)
Subscription redirect process
When initiating the payment request for subscription services our Payment Page will automatically check if there is any active subscription under our system for the current user. If user is not subscribed, it will proceed with subscription process and following payment.
## Next step...
### **[Payment Result Notification](🔗)**
The final step of every payment transaction is being notified of the outcome - i.e. whether the payment was successful or not. Payment result notification provides you with all the relevant data for your further processing.
Please refer to [Payment Result Notification](🔗) guide for complete reference on how to get notifications.