how to implement paypal payment button in an existent sign up form
I have a really strong feeling that this question will either be closed or not answered at all because I've seen many paypal questions not answered on the web :D
but I'm ready to take the risk and I'm gonna ask it here because paypal forum is inactive and I have googled for months and did not see anything like my question
I have an existent sign up form and login form on my site, I just wanna add a paypal subscribe to my existent forum i don't want to re-write the whole thing, I don't know if have to use ipm or api or simply the html code whatever...
i can't use sandbox to test my code (i don't know why) so i rely on you to give me a working example or some kind of tutorial, I have seen most of them (if not all) and no tutorial teach what i need to know
the simplest thing would be to remove my sign up button, and use paypal subscribe button instead
here's my sign up form (I'm using smarty template just for now, I'm gonna be using another template in the future)
{assign var='required_fields' value=$userquery->load_signup_fields()}
{assign var='custom_field' value=$userquery->custom_signup_fields}
{if $mode == 'signup_success'}
<div class="signup_con" style="margin-top:20px;">
<div class="simple_container">
{if $udetails.usr_status !='Ok'}
{lang code='signup_success_usr_ok'}
{else}
{lang code='signup_success_usr_emailverify' assign='signupsuccessusremailverify'}
{link name='login' assign='login_link'}
{$signupsuccessusremailverify|sprintf:$login_link}
{/if} </div>
{else}
<div class="signup_left full_round_10">
<h2>{lang code='user_mem_login'}</h2>
{lang code='if_you_already_hv_account'}
<div class="signup_container">
<form name="login_form" id="login_form" method="post" action="" >
<label for="login_username" class="label">{lang code='username'} : </label>
<div class="input_container">
<input name="username" type="text" id="login_username" size="30" >
</div>
<div class="clearfix"></div>
<label for="login_password" class="label">{lang code='password'} : </label>
<div class="input_container">
<input name="password" type="password" id="login_password" size="30" >
</div>
<div class="clearfix"></div>
<label for="" class="label"> </label>
<div class="input_container">
<input type="submit" name="login" class="send_msg"value="{lang code='login'}" >
</div>
<div class="clear"></div>
<div align="center"><a href="{$baseurl}/forgot.php">{lang code='user_forgot_password'}</a> | <a href="{$baseurl}/forgot.php">{lang code='user_forgot_username'}</a></div>
</form>
</div>
{lang code='signup_message_under_login'}
</div>
<div class="signup_right full_round_10">
<h2>{lang code='new_mems_signup_here'}</h2>
{lang code='register_as_our_website_member'}
<div class="signup_container">
<form name="login_form" id="login_form" method="post" action="" &开发者_运维知识库gt;
{foreach from=$required_fields item=field}
<label for="{$field.id}" class="label">{$field.title}</label>
<div class="input_container">
{if $field.hint_1}
<div class="hint">{$field.hint_1}</div>
{/if}
{ANCHOR place=$field.anchor_before}{$formObj->createField($field)}{ANCHOR place=$field.anchor_after}
{if $field.hint_2}
<div class="hint">{$field.hint_2}</div>
{/if}
</div>
<div class="clearfix"></div>
{/foreach}
<!-- Loading Custom Fields -->
{foreach from=$custom_field item=field}
<label for="{$field.id}" class="label">{$field.title}</label>
<div class="input_container">
{if $field.hint_1}
<div class="hint">{$field.hint_1}</div>
{/if}
{ANCHOR place=$field.anchor_before}{$formObj->createField($field)}{ANCHOR place=$field.anchor_after}
{if $field.hint_2}
<div class="hint">{$field.hint_2}</div>
{/if}
</div>
<div class="clearfix"></div>
{/foreach}
<!-- Loading Captcha if anny -->
{assign var=captcha value=func->get_captcha()}
{if $captcha}
{if $captcha.show_field}
<label class="label" for="verification_code">Verification Code</label>
{load_captcha captcha=$captcha load=field field_params = ' id="verification_code" '}
<div class="clearfix"></div>
{/if}
<label class="label"> </label>
<div class="input_container">
{load_captcha captcha=$captcha load=function}
</div>
<div class="clearfix"></div>
{/if}
<div class="clear"></div>
<div align="center">
<input name="agree" type="checkbox" id="agree" value="yes" checked="checked" />
{lang code='user_i_agree_to_the' assign='user_i_agree_to_the'}
- {$user_i_agree_to_the|sprintf:$cbpage->get_page_link(3):$cbpage->get_page_link(2)}</a>
</div>
<label for="" class="label"> </label>
<div class="input_container">
<input type="submit" name="signup" class="send_msg" value="{lang code='signup'}" style="margin-top:10px" />
</div>
<div class="clearfix"></div>
</form>
</div>
</div>
{/if}
</div>
<div class="clearfix"></div
>
if you need my login as well, I'll edit the question and I'll add that, you can do anything you want to do, you can use Ipn, api, or whatever...
Thanks in advance :D
EDIT
@ROBERT:
as far as i know website payment pro and express checkout is used for selling stuff online right? if so, i don't need them, sir i need a subscription button, and I'll follow any example to get it, anything that comes to your mind or any link that you find
thank you for saying that paypal is a big company, now you know my problem lol, it's not like facebook, if you want to do this, you use this api, if you want to do that you use that api, paypal is not like that, it has so many stuff, paypal is so confusing
this is my first project where i have to use paypal, i keep reading articles, every articles is totally different than the other and none of them say what i need to know :D
How do i plan to handle their returns back to my site? and do i need to collect info from people?
I don't need to collect info, you see i have a sign up form, so people are arleady filling their info which is stored in my db, even their email address of course so why would i need to collect anything at all through paypal?
when you sign up to my site, you receive a mail saying that u have signed up, welcome... I THINK that the simplest thing would be to remove the sign up button, put the paypal subscription button and when the payment is made they receive the confirmation email that they have signed up
since i am no pro in paypal world, i would like to go for the simplest way to get the job done, which is to use the basic html code for subscription button and the payment is made the confirmation email will be sent
again it's is just a suggestion, i don't know if and how it's possible... ?
if not I'll go for any solution that you suggest as long as the job gets done
Okay, having read your revised question, and taking into account your limited experience, I'd say you're probably better off placing the subscription button after the sign up page(s).
That way, all you need to do is paste in some simple PayPal HTML code, rather than integrate the button (and checkout flow) mid flow of your signup page.
For a simple PayPal Subscription (HTML-based = Website Payments Standard), just visit here and select all the required options. Once created, modify the HTML as needed. E.g., if you want to dynamically alter the price, simply adjust the values for a1 / a2 as needed.
See also this variables for more available parameters you can use. Note: with Website Payments Standard, all parameters are usually POST'ed as 'hidden' input fields ()
精彩评论