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.

Strange Invoice ID from PayPal

Home Forums Community Forum Strange Invoice ID from PayPal

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

Topic Author Topic
Posted: Wednesday Sep 19th, 2012 at 7:05 pm #25863

I just upgraded my secure website from dlGuard to s2member two days ago. I am operating under PHP 5.3, WordPresss 3.4.2 with a Swift 6.2.2 theme. My website is located at http://www.dragonsbard.com/masters/102/

My subscription sales include both web access AND a physical product. This means that I must use the HTML code rather than the preferred shortcode so that I can change the ‘no_shipping’ value to ‘2’ and add a

<input type="hidden" name="weight" value="1" />

for shipping and tax calculations. If there is a way to include a “weight” function in the shortcode, I’d certainly go that route. However, I should mention that with or without this modification, I’m still getting the odd results below.

I had my first sale today but it returned a strange Invoice ID from Paypa as shown in the screen capture below:

I went to the sales page to try the button. When I click on the purchase button (buy now), it took me to paypal but the check out page shows a strange option as in the screen capture below:

When I hover over the ‘Options:’ link in PayPal, it opens a pop-up containing what looks like four lines containing a a string “?php echo S2MEMBER_CURRENT_USER_VALUE_FO” followed by what looks to be three repeating strings of “?>:< ?php echo S2MEMBER_CURRENT_USER_VALUE_FO". These, I believe, are truncated returns of the button lines which identify previous users and the customer's IP address for tracking.

The customer who purchased the item was a previous user and I, being the administrator of the site, would be identified as a previous user as well. I checked the purchaser's user record on my wordpress site and there was no posting made regarding the transaction ID.

You can look at the link in question on my sales page.

Click on the button below ‘Mordale Early Subscription’ to see the Paypal response.

As this is a new installation … what have I done wrong?

Tracy Hickman

  • This topic was modified 4 years, 3 months ago by  Tracy Hickman.
  • This topic was modified 4 years, 3 months ago by  Tracy Hickman.

List Of Topic Replies

Viewing 6 replies - 1 through 6 (of 6 total)
Author Replies
Author Replies
Posted: Thursday Sep 20th, 2012 at 12:35 am #25880
David Welch
Username: dwbiz05

My first thought is that you don’t have a plugin that allows you to put php code into your wordpress pages.

See, wordpress does not natively parse php code that is put into the page editor, even if it’s in the “html” side.

You need a plugin that will force wordpress to parse the php code in your button form so it will enter the correct data.

Probably the most common, and the one recommended by S2member is http://wordpress.org/extend/plugins/php-execution-plugin/

You can also find it by searching in the new plugins section of wordpress for “php execution.”

That should solve the problem, unless you already have it installed and it’s still not working.

Hope that helps,

Dave

Posted: Thursday Sep 20th, 2012 at 8:17 am #25925

That’s right, you need a PHP execution plugin if you use the full HTML code for the button, since it has some PHP code too.

If you don’t want to use PHP, though, you can edit the code to replace those values with the shortcodes for them: [hilite path]Dashboard -› s2Member® -› API / Scripting -› PHP/API Constants[/hilite]

Posted: Thursday Sep 20th, 2012 at 3:31 pm #25987

I have now installed the PHP Execution plugin as both excellent responses suggest. I certainly see the need for it now.

Unfortunately the behavior apparently remains the same. When I click on the button now after installing the plugin, the resulting PayPal page still shows an ‘option’ with the PHP scripting after it as described above which would seem to indicate that the PHP is still not executing.

Thoughts?

Posted: Thursday Sep 20th, 2012 at 11:18 pm #26014
Raam Dev
Username: Raam
Staff Member

Tracy,

The problem is still that your page is not “processing” the PHP code. Installing and activating the PHP Execution plugin should’ve been enough to tell WordPress to process the PHP code on that page, but apparently something else is going on. I believe the plugin has settings that allow you to define who is allowed to run PHP code. Have you checked those settings? If the “Collectable Membership Subscriptions” page was created by someone who doesn’t have permission to run PHP code, the PHP code on that page won’t get processed.

Another thing I recommend trying is using the s2Member PayPal Button Shortcode instead of copy/pasting the HTML Form code (which is what it looks like you’ve done… however I could be mistaken). If you’re using the HTML Code version, I recommend trying to the Shortcode version (simply regenerate the button in Dashboard -› s2Member® -› PayPal® Buttons and copy/paste the resulting shortcode).

If you do “View Source” when viewing your “Collectable Membership Subscriptions” page, you should not see any PHP code in there. PHP code is supposed to be processed on the server and turned into regular HTML and text before it ever gets to your browser, so if you’re seeing PHP code anywhere except in your WordPress editor, then the problem is that your server is not processing the PHP.

Posted: Thursday Sep 20th, 2012 at 11:30 pm #26016

After a long session with my IP support, the following solution worked:

The original script read, in part, as follows:

<input type="hidden" name="invoice" value="&lt;?php echo S2MEMBER_VALUE_FOR_PP_INV(); ?&gt;" />
<!-- Identifies/Updates An Existing User/Member ( when/if applicable )  -->
<input type="hidden" name="on0" value="&lt;?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0; ?&gt;" />
<input type="hidden" name="os0" value="&lt;?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0; ?&gt;" />
<!-- Identifies The Customer's IP Address For Tracking -->
<input type="hidden" name="on1" value="&lt;?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1; ?&gt;" />
<input type="hidden" name="os1" value="&lt;?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1; ?&gt;" />

Support asked me to modify the script by changing all

&lt; values to < and all &gt; values to >

in the five instances in the above script.

The script now reads:

<input type="hidden" name="invoice" value="<?php echo S2MEMBER_VALUE_FOR_PP_INV(); ?>" />
<!-- Identifies/Updates An Existing User/Member ( when/if applicable )  -->
<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; ?>" />
<!-- Identifies The Customer's IP Address For Tracking -->
<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; ?>" />

Now the script appears to be working perfectly.

Posted: Friday Sep 21st, 2012 at 7:49 am #26038

I see. When you pasted the code into the Visual editor, the code got encoded and wasn’t PHP anymore. Make sure you don’t open that page in the Visual editor anymore or you’ll have the problem again, you need to stick to the HTML editor when you use PHP code in a page.

I’m glad you sorted it out. Thanks for the update. :)

Viewing 6 replies - 1 through 6 (of 6 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.