Page 1 of 1

How can I use the paypal generated code outside wordpress?

PostPosted: May 19th, 2010, 1:08 am
by surfries
I hope someone can help me with this.

I want to use my entire wordpress site as the members area. It will just have 1 level for access to the entire wordpress site. So, my question is can I take the generated paypal code for my level1 membership and place it on a page outside of my wordpress site and still have it generate the users info and give them access to my wordpress membership site?

e.g. / wordpress site (membership.site.com) - Buy Now s2member generated paypal script page outside wordpress (site.com)

Thanks...

Re: How can I use the paypal generated code outside wordpres

PostPosted: May 19th, 2010, 2:51 am
by Jason Caldwell
Yes, that is possible. However, you'll need to use the Full Button Code ( not the Shortcode ), and you'll need to remove the two PHP tags in the Full Button Code. The two PHP tags are references to s2Member API Constants, which would not be available outside of WordPress®. Not a huge deal though. Those two PHP tags are only designed to handle Subscription Modifications.

So you might have something like this on your external site:
Code: Select all
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="business" value="xxxxxxxxxxxxxxxxxxxx" />
<input type="hidden" name="cmd" value="_xclick-subscriptions" />
<!-- Instant Payment Notification & Return Page Details -->
<input type="hidden" name="notify_url" value="http://www.example.com/?s2member_paypal_notify=1" />
<input type="hidden" name="cancel_return" value="http://www.example.com" />
<input type="hidden" name="return" value="http://www.example.com/?s2member_paypal_return=1" />
<input type="hidden" name="rm" value="2" />
<!-- Configures All Of The Checkout Fields -->
<input type="hidden" name="no_shipping" value="1" />
<input type="hidden" name="no_note" value="1" />
<input type="hidden" name="custom" value="www.example.com" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="page_style" value="paypal" />
<input type="hidden" name="item_name" value="Bronze" />
<input type="hidden" name="item_number" value="1" />
<!-- Identifies/Updates An Existing Member After Checkout -->
<input type="hidden" name="on0" value="" />
<input type="hidden" name="os0" value="" />
<input type="hidden" name="modify" value="0" />
<!-- Customizes Prices, Payments & Billing Cycle -->
<!--<input type="hidden" name="amount" value="0.01" />-->
<input type="hidden" name="src" value="1" />
<input type="hidden" name="sra" value="1" />
<input type="hidden" name="a3" value="0.01" />
<input type="hidden" name="p3" value="1" />
<input type="hidden" name="t3" value="M" />
<!-- Displays The PayPal® Image Button -->
<input type="image" alt="PayPal®" style="border:0;" src="https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif" />
</form>

If you'd like the full details regarding those two PHP Constants that need to be removed for this to work, see: s2Member -> API Scripting -> Constants. Look toward the very bottom for documentation on the ON0|OS0 Constants.

Re: How can I use the paypal generated code outside wordpres

PostPosted: May 22nd, 2010, 7:02 am
by surfries
Perfect! That's what I thought just wasn't sure about those ON0 / OS0 codes.

Thanks for the fast reply..