Redirect after Payment
Find out how to handle post payment end-user redirection
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
https://www.google.com?trid=123456789&status=success&userid=testuser&reference=DemoForDocument&sign=12a4fs3d6aXXXXXXXXX
- Subscription redirection
https://www.google.com?status=success&operator=XXXXXXX&reference=201512d45xxxxxxxx&userid=34xxxxxxx&msisdn=346668xxxxx×tamp=1449502720750
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. | 4520627787 |
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:
http://www.google.com?userid=60165175712&activesub=true&validsub=true&subscriptionid=3685958×tamp=1449069171015
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= ,
- 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=,
- reference=,
- error_description=
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] (Check what will be new team name and new email)
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...
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.
Updated over 1 year ago