Home Integration Methods SafePay

SafePay

SafePay integrates using IPN callback. Make sure you don't already use SafePay IPN for another purpose, such as some kind of digital delivery or membership registration.
1
Enable and setup plugin
First you must enable and setup SafePay plugin in PAP4. Go to Start menu->plugins and click Enable for SafePay plugin. When enabled, click Configure. Now you must setup number of custom field you will use to sending custom cookie. Next you must set your secret passphrase from your SafePay merchant panel.
2
SafePay buttons
Now add the following code into EVERY SafePay button form
<input type="hidden" name="notifyURL" value="http://www.yoursite.com/affiliate/plugins/SafePay/notify.php">
<input type="hidden" name="custom2" value="" id="pap_dx8vc2s5">

Red number is number of custom field you entered in last step.

After form add this code:

<script id="pap_x2s6df8d" src="http://www.yoursite.com/affiliate/scripts/notifysale.php" type="text/javascript">
</script>


3
Example form button
<form action="https://www.safepaysolutions.com/index.php" method="post">
<input type="hidden" name="_ipn_act" value="_ipn_payment">
<input type="hidden" name="fid" value="a8966ef75849cd589a5c2e80310986">
<input type="hidden" name="itestmode" value="off">
<input type="hidden" name="notifyURL" value="http://www.yoursite.com/affiliate/plugins/SafePay/notify.php">
<input type="hidden" name="returnURL" value="https://mydomain.com/thankyou.html">
<input type="hidden" name="cancelURL" value="https://mydomain.com/cancelled.html">
<input type="hidden" name="notifyEml" value="webmaster@mycompany.com">
<input type="hidden" name="iowner" value="MerchantSupplierUsername">
<input type="hidden" name="ireceiver" value="MerchantSupplierUsername">
<input type="hidden" name="iamount" value="199.95">
<input type="hidden" name="itemName" value="Test E-Product">
<input type="hidden" name="itemNum" value="1">
<input type="hidden" name="idescr" value="The perfect description for my product!">
<input type="hidden" name="idelivery" value="3">
<input type="hidden" name="iquantity" value="1">
<input type="hidden" name="imultiplyPurchase" value="n">
<input type="hidden" name="custom2" value="" id="pap_dx8vc2s5">
<input type="hidden" name="colortheme" value="LightBlueYellow">
<input type="image" src="https://www.safepaysolutions.com/images/xpmt_paybutton_2.gif" alt="Pay through SafePay Solutions">
</form>
<script id="pap_x2s6df8d" src="http://www.yoursite.com/affiliate/scripts/notifysale.php" type="text/javascript">
</script>
This is all that is required. Now whenever there's sale, SafePay will use its IPN function to call our sale tracking script, and system will generate commission for the affiliate.