Tips and Tricks HQ Support Portal › Forums › WP Affiliate Platform › Difficulty Setting up WP Affiliate Platform for Paypal Subscription Buttons
- This topic has 3 replies, 2 voices, and was last updated 13 years, 8 months ago by amin007.
-
AuthorPosts
-
March 21, 2011 at 9:08 am #3003dadamsonMember
Hi Guys,
I have searched the forum and I am at a complete loss on how to set the WP Affiliate Platform up for PayPal subscription buttons for ongoing commissions..
Each time I enter the custom code from the “Example Button Code for PHP (PayPal hosted button) ” into the hosted button at PayPal.com it doesn’t copy across to the next page when I save the button and get the button code.
I have entered the snippet of code like this into the “Custom Variables” box:
<input name=”notify_url” type=”hidden” value=”http://www.your-domain.com/wp-content/plugins/wp-affiliate-platform/api/ipn_handler.php” />
<input name=”custom” type=”hidden” value=”<?php echo $_COOKIE; ?>” />
and I have even changed it to this:
notify_url=http://www.your-domain.com/wp-content/plugins/wp-affiliate-platform/api/ipn_handler.php
custom=<?php echo $_COOKIE; ?>
I have also copied the entire code and tried pasting it into the PayPal custom variables section.
Whatever I seem to write there it doesn’t show up in the code on the next page page saving the button and retrieving the code to embed to the site.
Regardless of this, I have hardcoded the entire button code in the site as a test button and used it through my own affiliate account I have created.
I get the clicks registering but I don’t get the sales registering.
I have even copied the <script> snippet of code above and manually added to the correct section of my PayPal code on my site but still I get the same result.
I have been at this for about 3 hrs now with no progress, could anyone shed any light?
Thanks,
Dave
March 21, 2011 at 11:43 pm #30476amin007ParticipantNot sure which instruction you followed. You need to follow this one (option 2):
Here is what you did wrong… you don’t need to add the following to your custom variable box of the hosted button on PayPal (PHP code won’t get executed in the custom variable box like that):
notify_url=http://www.your-domain.com/wp-content/plugins/wp-affiliate-platform/api/ipn_handler.php
custom=<?php echo $_COOKIE['ap_id']; ?>You will specify those values in the button when you place it on a page. For example if you look closely to this example button code you will see where they are being add to in the button:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="7JK4AJCBQGJV6">
<input type="image" src="https://www.paypal.com/en_US/GB/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online.">
<img alt="" border="0" src="https://www.paypal.com/en_GB/i/scr/pixel.gif" width="1" height="1">
<input name="notify_url" type="hidden" value="http://www.your-domain.com/wp-content/plugins/wp-affiliate-platform/api/ipn_handler.php" />
<input name="custom" type="hidden" value="<?php echo $_COOKIE['ap_id']; ?>" />
</form>So basically copy and paste your hosted button code and then add the following two lines just before the
</form>
tag:<input name="notify_url" type="hidden" value="http://www.your-domain.com/wp-content/plugins/wp-affiliate-platform/api/ipn_handler.php" />
<input name="custom" type="hidden" value="<?php echo $_COOKIE['ap_id']; ?>" />Obviously you will change the “you-domain.com” to your actual domain URL. Does that make sense?
The key is to make sure that the PHP code that retrieves the cookie value is actually getting executed. So Remember, if you are planning to place the button code on a WordPress post or page then you need to have a plugin (e.g. PHP Exec plugin) that lets you execute PHP code in WordPress page or post (by default WordPress post or page won’t execute PHP code). If you are placing this code on your themes template file then you are good to go (no need to install a PHP executable plugin)
March 24, 2011 at 1:30 am #30477dadamsonMemberGreat, Got it working now!
My mistake – I didn’t install that PHP handler.
I have created a test transaction and the commission was processed to the affiliate account successfully.
As it is a recurring transaction, I just need to know if the affiliate will get paid for each recurring payment… my test button is set on a daily basis so I guess I’ll know for sure tomorrow.
Thanks for the help! Definitely looks like a solid software.
Cheers,
March 24, 2011 at 2:06 am #30478amin007ParticipantGlad to hear that. Yes the recurring payments will also award commission to the affiliate (this is the advantage of using option 2 as the integration method)
-
AuthorPosts
- You must be logged in to reply to this topic.