Page 1 of 1

button values not feeding to PayPal

PostPosted: October 27th, 2010, 8:10 pm
by KirkWard
As a test, I copied the PayPal button code shown in the s2 button editor for level 1 and pasted it into a page. Then I looked at the page by clicking on the preview button.

The first item I noted was that the beginning and ending brackets from the amount field that was commented out were modified by something on my site, leaving the brackets and a line break. I don't know if this was done by a plugin or Wordpress.

Here is the before ...
Code: Select all
<!-- <input type="hidden" name="amount" value="0.01" /> -->

Here is the after ...
Code: Select all
<br />
<!--<br />
<input type="hidden" name="amount" value="0.01" /> &#8211;></p>


In addition, I received an error message from PayPal that said ...
Invalid first trial period. You must specify valid values for the A1, P1, and T1 parameters for a subscription.

But, the code in the button was ...
Code: Select all
<input type="hidden" name="a1" value="0.00" />
<input type="hidden" name="p1" value="0" />
<input type="hidden" name="t1" value="D" />


By deleting these three lines and removing the commented "amount" line, the button did take me to PayPal.

I then cut and pasted the button shortcode into the same page and it worked properly.

So, from this I learned that the button code does not work directly in a page.

But, I need to add %cv's% to the CUSTOM field.

First, why doesn't the raw button code work, second, how do I get my CV code into the CUSTOM field, and third, would the button code, modified as I describe, work with s2?

Cheers and felicitations!

Re: button values not feeding to PayPal

PostPosted: October 27th, 2010, 10:26 pm
by Jason Caldwell
Thanks for the great questions.

First, why doesn't the raw button code work?

I recommend the Shortcode format for your PayPal Buttons, because the WordPress® Visual Editor has a very bad habit of mangling raw HTML code. Using the Full Button Code inside WordPress® will often lead to corruption, such as you're describing.

Also, in order to suppress automatic paragraphs and entity conversions that WordPress® injects through its built-in content filters, you will need to install a plugin like this if you're going to use raw HTML.
- Raw HTML plugin: http://wordpress.org/extend/plugins/raw-html/

second, how do I get my CV code into the CUSTOM field?

Using the Shortcode format, do something like this.
Code: Select all
[s2Member-PayPal-Button ... custom="www.example.com|something|something" /]

If you're trying to grab the user's IP address, install the Exec-PHP plugin, and do something like this:
Code: Select all
[s2Member-PayPal-Button ... custom="www.example.com|<?php echo esc_attr($_SERVER["REMOTE_ADDR"]); ?>" /]
%%cv1%% now equals = the Member's IP address.

------------ for the benefit of other readers ---------------------

Custom Replacement Codes can be inserted using these instructions:

%%cv0%% = The domain of your site, which is passed through the `custom` attribute in your Shortcode.
%%cv1%% = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute, inside your Shortcode, like this: custom="www.example.com|cv1|cv2|cv3".

You can have an unlimited number of custom variables that track IP addresses, affiliate IDs, etc. In some cases you may need to use PHP code to insert a value into the custom field dynamically. Obviously this is for advanced webmasters, but the functionality has been made available for those who need it.

Re: button values not feeding to PayPal

PostPosted: October 28th, 2010, 10:47 am
by KirkWard
Bingo!

Once again, THANKS!