latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Button Encryption without Shortcodes

Home Forums Community Forum Button Encryption without Shortcodes

This topic contains 7 replies, has 3 voices. Last updated by  Cristián Lávaque 4 years, 9 months ago.

Topic Author Topic
Posted: Friday Mar 30th, 2012 at 8:18 am #9576
Holger
Username: infoking

Hello dear S2Member-Team,
I can not solve this problem alone, please help me.
I would like to encrypt my S2Member PayPal-code. Unfortunately I can not use the S2Member-shortcodes, because I dynamically create some variables in the page-template (depending on the specific post).

Is there a way to encrypt the button code via template-tag?

My button code looks like this:

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" class="zahlungsbutton">
 <input type="hidden" name="business" value="info@x.net" />
 <input type="hidden" name="cmd" value="_xclick" />
 <!-- Instant Payment Notification & Return Page Details -->
 <input type="hidden" name="notify_url" value="http://www.x.net/?s2member_paypal_notify=1" />
 <input type="hidden" name="cancel_return" value="http://www.x.net/" />
 <input type="hidden" name="return" value="http://www.x.net/?s2member_paypal_return=1" />
 <input type="hidden" name="rm" value="2" />
 <!-- Configures Basic Checkout Fields -->
 <input type="hidden" name="lc" value="" />
 <input type="hidden" name="no_shipping" value="1" />
 <input type="hidden" name="no_note" value="1" />
 <input type="hidden" name="custom" value="www.x.net" />
 <input type="hidden" name="currency_code" value="EUR" />
 <input type="hidden" name="page_style" value="paypal" />
 <input type="hidden" name="charset" value="utf-8" />
 <input type="hidden" name="item_name" value="Sofortzugang Artikel <?php the_ID(); ?>" />
 <input type="hidden" name="item_number" value="sp:<?php the_ID(); ?>:2190" />
 <input type="hidden" name="amount" value="<?php echo $preis;?>" />
 <!-- Configures s2Member's Unique Invoice ID/Code  -->
 <input type="hidden" name="invoice" value="<?php echo S2MEMBER_VALUE_FOR_PP_INV(); ?>" />
 <!-- Associates Purchase With A User/Member ( when/if applicable ) -->
 <input type="hidden" name="on0" value="Titel" />
 <input type="hidden" name="os0" value="<?php the_title(); ?>" />
 <!-- Identifies The Customer's IP Address For Tracking -->
 <input type="hidden" name="on1" value="Kunden IP-Adresse" />
 <input type="hidden" name="os1" value="<?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1; ?>" />
 <!-- Displays The PayPal® Image Button -->
 <input type="image" src="https://www.paypal.com/de_DE/i/btn/btn_xpressCheckout.gif" style="width:auto; height:auto; border:0;" alt="PayPal®" />
</form>

Can I pass my generated code to a S2Member-function to encrypt it?

Best wishes, Holger

List Of Topic Replies

Viewing 7 replies - 1 through 7 (of 7 total)
Author Replies
Author Replies
Posted: Friday Mar 30th, 2012 at 10:07 pm #9624

Hi Holger.

You can use variables in the shortcode too, have you tried that? http://www.primothemes.com/forums/viewtopic.php?f=36&t=1604

I hope that helps. :)

Posted: Saturday Mar 31st, 2012 at 7:34 am #9656
Holger
Username: infoking

Hi Cristian.
Hmm, that might be an idea. Thanks for the tip!
But then I will have another problem: How can I use this shortcode in the template? I want to process a large number of posts on this wise. So it is not possible to insert the shortcode in each post content. That’s why I’ve chosen the HTML/PHP code.

Is there no way to encrypt my buttoncode in the template using a s2Member-function, without using shortcode?

Posted: Saturday Mar 31st, 2012 at 9:16 am #9659
Holger
Username: infoking

Ah, figured it out!

This works great in the template and the button gets encrypted:

<?php echo do_shortcode('[s2Member-PayPal-Button sp="1" ids="'.$mypostid.'" exp="4380" desc="'.$buchungstext.'" ps="paypal" lc="" cc="EUR" dg="0" ns="1" custom="www.x.net" ra="'.$preis.'" image="default" output="button" /]'); ?>

There is no need to use an PHP-Execution-plugin this way.

Thanks for the help and for this wonderful plugin! :-)

Posted: Saturday Mar 31st, 2012 at 9:31 am #9660
Eduan
Username: Eduan
Moderator

Hello Holger, thanks for your inquiry.

Ah, figured it out!

This works great in the template and the button gets encrypted:

shortcode snip

Excellent!

There is no need to use an PHP-Execution-plugin this way.

Actually, there is still a need; since you’re trying to execute PHP in a page or post, in which your page is gonna be.

Posted: Sunday Apr 1st, 2012 at 11:17 pm #9731

Excellent, Holger! That’s exactly what I was going to suggest. Glad you solved it. :)

Eduán, he’s now using PHP in the template only but, yeah, he’ll need the plugin if he later wants PHP in the post’s body.

Posted: Monday Apr 2nd, 2012 at 8:25 am #9758
Eduan
Username: Eduan
Moderator

Eduán, he’s now using PHP in the template only but, yeah, he’ll need the plugin if he later wants PHP in the post’s body.

Oh ok, sorry, I didn’t catch that part. :)

Posted: Monday Apr 2nd, 2012 at 7:47 pm #9818

No problem. :)

Viewing 7 replies - 1 through 7 (of 7 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.