–Hidden comment

Use attributes in format region_from and region_to= to change the languages showing in language switcher.
Available regions are:
europe_from europe_to
asia_from asia_to
mideast_from mideast_to
america_from america_to

Example:
europe_from=0 europe_to=22 will put all languages (ordered in language switcher settings) from 1 to 21 to Europe region:
asia_from=22 asia_to=25 will put all languages from 23 to 24 (so only 2) into Asia region.

WebToPay

The faster way to send and receive money all over the world.

This integration method uses integration with WebToPay API. More info about this payment gateway can be found here:
https://www.webtopay.com/index.php?2595448377

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

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:
writeCookieToCustomField OR writeCookieToLink

<script id="pap_x2s6df8d" src="https://URL_TO_PostAffiliatePro/scripts/trackjs.js" type="text/javascript"></script>
<script type="text/javascript">
PostAffTracker.writeCookieToCustomField('fullCookieInfoId');
PostAffTracker.writeCookieToLink('affCookieLinkId', 'papCookie');
</script>

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:

...
$request['callbackurl'] = $request_url."?papCookie=".$_GET['papCookie'];
...

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):

// Post Affiliate Pro integration snippet --------------------------
if (isset($_GET['papCookie']) && (strlen($_GET['papCookie']) > 20)) {
  	    require_once "path_to_PAP/api/PapApi.class.php"; // set correct path to API file here

  	    $saleTracker = new Pap_Api_SaleTracker('https://URL_TO_PostAffiliatePro/scripts/sale.php');
            $saleTracker->setAccountId('default1');
            $saleTracker->setVisitorId(substr($_GET['papCookie'], -32)); // returns only visitor ID, no "default1" prefix

            $total = $response['amount']/100; // need to get rid of hundreds

            $sale = $saleTracker->createSale();
            $sale->setTotalCost($total);
            $sale->setOrderID($response['orderid']);

            $saleTracker->register();
}
// /Post Affiliate Pro integration snippet -------------------------

This is all you need to track a sale commission.

More info can be found here:
https://www.webtopay.com/index.php?683722975

Back to Integrations Create account for FREE

Our website uses cookies. By continuing we assume your permission to deploy cookies as detailed in our privacy and cookies policy.

×

Schedule a one-on-one call and discover how Post Affiliate Pro can benefit your business.

We’re available on multiple dates

Schedule a call