Setcom (Auto-post and custom field used by other script)
Integrate Setcom with PostAffiliate Pro using Auto-post callback. Activate the plugin, configure settings, and update button code. Ensure Auto-post is on and URL is correct. More details in the Setcom Implementation Guide. Free trial available.

Setcom (Auto-post and custom field used by other script) integration
Setcom integrates using Auto-post callback. Use this integration if you are using Auto-post for another purpose, such as some kind of digital delivery or membership registration etc. and you already using custom field for transfering some data.
To integrate with Setcom, you need Setcom plugin which is distributed with PAP by default.
Configure plugin
First you must activate Setcom plugin in PAP > Startmenu > Plugins. After plugin is activated you must configure it. Click Configure button. You must set your Merchant username, password which you are using to login to your merchant panel. Merchant identifier is located in your Setcom merchant panel top menu > My account > Overview tab. You must define some separator. Default value is ||.
SetUp your Setcom settings
Login to your Setcom merchant panel. In top menu > Profile > Selling Preferences select Website Payment Preferences. Make sure that Auto-post is set to on and that Auto-post URL is set to https://URL_TO_PostAffiliatePro/plugins/Setcom/setcom.php.
Do not forget save your settings.
Update Buttons
Now add the following code into EVERY Setcom (Buy now, Add to cart and/or Checkout) button form:
<input type="hidden" name="MerchCustom" value="abc" id="pap_ab78y5t4a">
For example:
<form action="https://www.setcom.com/secure/index.cfm" method="post">
<input type="hidden" name="buttonaction" value="buynow">
<input type="hidden" name="merchantidentifier" value="12345678920">
<input type="hidden" name="liddesc" value="auticko">
<input type="hidden" name="lidsku" value="a123">
<input type="hidden" name="lidprice" value="150.00">
<input type="hidden" name="lidqty" value="1">
<input type="hidden" name="CurrencyAlphaCode" value="ZAR">
<input type="hidden" name="LIDExpiry" value="1">
<input type="hidden" name="ShippingRequired" value="0">
<input type="hidden" name="IsVoucher" value="0">
<input type="hidden" name="Option1Name" value="custom">
<input type="hidden" name="Option1Value" value="oldCustom">
<input type="hidden" name="MerchCustom" value="abc" id="pap_ab78y5t4a">
<input type="image" src="https://www.setcom.com/www/graphics/cartbuttons/bn6.gif">
</form>
After this form you must insert:
<script id="pap_x2s6df8d" src="https://URL_TO_PostAffiliatePro/scripts/notifysale.php" type="text/javascript">
</script>
<script type="text/javascript">
PostAffTracker.setAppendValuesToField('||');
PostAffTracker.writeCookieToCustomField('pap_ab78y5t4a');
</script>
Integration with your script
Now the Auto-post callback is pointed to your script. This callback has to be forwarded also to PAP paypal.php script, which url is https://URL_TO_PostAffiliatePro/plugins/Setcom/setcom.php.
In case, your Setcom processing script is in PHP, you can use following code to accomplish that. You can place it at the beginning of your processing file:
/* PAP integration */
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://URL_TO_PostAffiliatePro/plugins/Setcom/setcom.php");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $_POST);
curl_exec($ch);
/* end of PAP integration */
This will ensure that whole Auto-post callback will be forwarded without affecting your original script
Integration with your script – part 2
The custom parameter is in format 3rdPartySystemValue||PapValue. In order for 3rd party system to work correctly you need to parse 3rdPartySystemValue from the custom parameter. To do this add following code right after Setcom Auto-post verification.
Assume that in variable $custom_value you have custom value loaded from XML sended by Setcom:
$separator = '||';
if ($custom_value!= '') {
$explodedCustomValue = explode($separator, $custom_value, 2);
if (count($explodedCustomValue) == 2) {
$custom_value = $explodedCustomValue[0];
}
}
After this you have your original value in $custom_value.
You can find more detailed info about Setcom integration in Setcom Implementation Guide.
Frequently asked questions
- What is the Setcom (Auto-post and custom field) integration for Post Affiliate Pro?
The Setcom integration allows you to connect Setcom payment processing with Post Affiliate Pro using Auto-post callbacks and custom fields, enabling accurate affiliate transaction tracking even when using custom scripts for digital delivery or membership registration.
- How do I configure the Setcom plugin in Post Affiliate Pro?
Activate the Setcom plugin from PAP > Startmenu > Plugins, then configure it with your merchant username, password, and identifier from your Setcom merchant panel. Set the separator (default is ||) and save your settings.
- What steps are needed to update Setcom payment buttons for integration?
Add a hidden input field named 'MerchCustom' to every Setcom button form, and insert the Post Affiliate Pro tracking script after the form to ensure proper affiliate tracking.
- How can I forward the Auto-post callback to Post Affiliate Pro from my script?
In your Setcom processing script, use cURL to forward the callback POST data to the Post Affiliate Pro Setcom plugin endpoint, ensuring both your original process and affiliate tracking work seamlessly.
- What is the format of the custom parameter used in this integration?
The custom parameter is formatted as 3rdPartySystemValue||PapValue. Parse the value as needed in your script to separate your original value from the affiliate tracking value.
Lucia is a talented content editor who ensures the seamless publication of content across multiple platforms.

Try Post Affiliate Pro for Free
Experience seamless Setcom integration and powerful affiliate tracking. Start your free trial of Post Affiliate Pro today.