Paypal按钮上的自定义逻辑


Custom Logic on Paypal button

我想让我的贝宝按钮从我的自定义表单中捕获信息,这样所有用户在按下它后都需要做的就是付款。我的自定义表单只有两个字段:金额和电子邮件地址。这可能吗?有人知道如何使用php来做到这一点吗?感谢

如果我理解你的问题,那么这个例子应该是你想要的:

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Paypal</title>
</head>
<body>
    <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
        <input type="hidden" name="cmd" value="_xclick">
        <!-- Change the email -->
        <input type="hidden" name="business" value="email@email.com">
        <!-- Change the return email after payment -->
        <input type="hidden" name="return" value="http://google.com">
        <!-- Change the description of the item -->
        <input type="hidden" name="item_name" value="Item name"/>
        <input type="text" name="user_email" placeholder="Please enter email" value=""/>
        <input type="hidden" name="no_shipping" value="1">
        <input type="text" name="user_amount" placeholder="Please enter amount" value="">  
        <input type="hidden" name="no_note" value="1"> 
        <input type="hidden" name="currency_code" value="USD">  
        <input type="hidden" name="bn" value="PP-BuyNowBF">
        <button type="submit" alt="PayPal - The safer, easier way to pay online!">Pay now</button>
    </form>
</body>
</html>

删除name="email"和name="amount"的输入,并标记可见输入user_email和user_amount,填写并发送表单