简体   繁体   English

贝宝网站捐赠IPN / API

[英]PayPal Website Donation IPN/API

So I'm wondering how to create a PayPal Donation IPN/API. 所以我想知道如何创建PayPal捐赠IPN / API。 I'm not exactly sure if that is what they are called so here is a screen shot of what I'm talking about. 我不确定这是否就是他们所说的,所以这是我在说的内容的屏幕截图。

http://s9.postimg.org/jxixshjan/paypal.jpg (Updated) http://s9.postimg.org/jxixshjan/paypal.jpg (已更新)

Here is the naked input and button only. 这只是裸输入和按钮。 No lists. 没有清单。

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="example@example.com">
<input type="hidden" name="lc" value="CAD">
<input type="hidden" name="item_name" value="Example">
<div class="input-prepend" style="display:inline; padding-right:10px;">
<span class="add-on">$</span><input type="text" id="supportAmount" name="amount" value="5.00" style="width:50px;">
</div>
<input type="hidden" name="currency_code" value="CAD">
<input type="hidden" name="button_subtype" value="services">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="cn" value="Leave a message to the Developer:">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="rm" value="1">
<input type="hidden" name="return" value="https://www.example.com/index?supporter=true">
<input type="hidden" name="cancel_return" value="https://www.example.com/index">
<input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynowCC_LG.gif:NonHosted">
<input type="hidden" name="notify_url" value="#">
<input type="hidden" name="custom" value="example">
<input type="submit" id="supportbtn" value="Support Me" />
</form>

I'm wondering if only with this HTML code, would I be able to put this on my site and once people click "support me" will the donation come to my PayPal account (after the donator filled out the proper Credit Card or PayPal info of course) 我想知道是否可以仅使用此HTML代码将其放置在我的网站上,一旦人们单击“支持我”,捐款将进入我的PayPal帐户(在捐赠者填写正确的信用卡或PayPal信息之后)当然)

I only have a premier account for PayPal as well. 我也只有PayPal的高级帐户。 And the name="business" value="email@email.com" needs to be my email associated with PayPal to receive the donation correct? 并且名称=“ business” value =“ email@email.com”需要作为我与PayPal相关的电子邮件才能正确接收捐赠吗?


If this code does work only with this HTML code am I able to place the... 如果此代码仅适用于此HTML代码,我是否可以放置...

<input type="submit" id="supportbtn" value="Support Me" />

anywhere within the code? 代码中的任何地方? (Look for * ) (寻找*

Like for example between 例如之间

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top" >
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="example@example.com">
<input type="hidden" name="lc" value="CAD">
<input type="hidden" name="item_name" value="Example">
<div class="input-group input-group-sm" style="width:100%;">
<span class="input-group-addon">$</span>
<input type="text" class="form-control" name="amount" value="5.00" placeholder="5.00">
<span class="input-group-btn">
*******<input type="submit" class="btn btn-danger" value="Support Me">*******
</span>
</div>
<input type="hidden" name="currency_code" value="CAD">
<input type="hidden" name="button_subtype" value="services">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="cn" value="Leave a message to the Developer:">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="rm" value="1">
<input type="hidden" name="return" value="http://www.example.com">
<input type="hidden" name="cancel_return" value="http://www.example.com">
<input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynowCC_LG.gif:NonHosted">
<input type="hidden" name="notify_url" value="#">
<input type="hidden" name="custom" value="example">
</form>

I think I can answer this question for you. 我想我可以为您回答这个问题。

The donation button in PayPal can be created on their site. PayPal中的捐赠按钮可以在其网站上创建。 They give you code to insert that button into your site. 他们为您提供了将该按钮插入您的网站的代码。 You will then get an email from the donator and it will tell you who donated to your site. 然后,您将收到捐赠者的电子邮件,其中会告诉您谁捐赠了您的网站。

Now I'm not sure exactly what your asking, but if you want the list of people that donated to your site to appear on your website for everyone to view, you would have to set that up in the PayPal Sandbox. 现在,我不确定您要问的是什么,但是如果您希望将捐赠给您站点的人员列表显示在您的网站上,以供所有人查看,则必须在PayPal沙箱中进行设置。 You would also have to make some sort of database that would submit user information to it: 您还必须建立某种数据库来向其提交用户信息:

$donate = $_POST['custom'];

mysql_query("UPDATE `persons` SET donated='1' WHERE donator='".$donate."'");

Basically this is a hidden file that PayPal points to once the information has been paid for. 基本上,这是一个隐藏文件,一旦支付了信息,贝宝就会指向该文件。 Paypal will automatically send a file with strings of values of people who have donated to your site. Paypal会自动发送包含捐赠给您网站的人的价值字符串的文件。 The code above would then insert that information into my database. 然后,上面的代码会将这些信息插入到我的数据库中。

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM