... one year later ... Still a very useful post.
Notice that s2Member's built-in
button generator works exceptionally well. The reason I am using PayPal saved buttons is to prevent fraud. With generated buttons, many fields such as price, could be manipulated by the user. Encrypted buttons are another attempt to thwart fraud, but I have yet to get those to work (in
Sandbox).
I've been setting up a PayPal saved subscription
button, and there are a couple differences from what I saw in this thread:
- PayPal appears to (inconsistently) call "Item ID" a "Subscription ID" (I enter the value 1 so s2Member knows I'm upselling to level 1).
- In the Advanced field, I add
- notify_url=http://mydomain.com/?s2member_paypal_notify=1
- custom=mydomain.com
- modify=1
The
modify=1 is because I have pre-registration (free Level 0), which modifies up to Level 1 with paid subscription.
At this point, s2Member will not know who this payment is for when the IPN comes in. I must add additional dynamic fields to the
button code on my site. It appears that PayPal will accept these additional fields along with the pre-configured saved settings of the referenced
button:
- Code: Select all
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="WXYZABCDE">
<input type="hidden" name="on0" value="<?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0; ?>" />
<input type="hidden" name="os0" value="<?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0; ?>" />
<input type="hidden" name="on1" value="<?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1; ?>" />
<input type="hidden" name="os1" value="<?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1; ?>" />
<input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/btn_subscribe_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
Looking at s2Member-generated
button code, I see a lot of other fields, but they appear to all relate to the pricing and such (things saved at PayPal for this referenced
button).
Can anyone confirm that these four S2MEMBER_ variables are all that s2Member needs to properly track the transaction?