Home Integration Methods WebToPay


This integration method uses integration with WebToPay API. More info about this payment gateway can be found here:

The integration method is divided into two main sections:
1. Passing the visitor ID (cookie value) to the webtopay gateway
2. Reading the response from webtopay
Getting the cookie value
First thing is to get the cookie value, e.g. using standard PHP methods, or you can use our script that reads it from cookies:
Based on the method you used, you can get the cookie value from GET or POST parameter.
Passing the visitor ID into the gateway
Now, when you have the value, you have to attach it to callbackurl, BEFORE using the function WebToPay::buildRequest($request)
E.g. if your callbackurl parameter was set like this:
$request['callbackurl'] = $request_url;
append the cookie value, sent in GET parameter like this:
This will send get parameter "papCookie" to the gateway. This is needed so we can use Post Affiliate Pro API when parsing response from webtopay... otherwise the sale would be unreferred.
Parsing the response
After calling the function WebToPay::checkResponse() in your callbackurl, in a place where you are sure everything is correct, you can call our API to register a commission.
Do not forget to set correct path to your PapApi.class.php file (in api/ directory of Post Affiliate Pro)
This is all you need to track a sale commission.
More info can be found here: