我创建了一个包含多个字段的订单(代码如下所述)。现在我要做的是将贝宝的“立即购买”按钮与此表单集成!由于我是这里的新手,我不知道如何完成同样的事情!如您所见,表单有一个常规的“提交”按钮,需要将其替换为 paypal 的立即购买。
我想弄清楚的另一件重要的事情是如何在完成付款后通过单击“立即购买”按钮将客户输入的数据保存到数据库中。任何帮助,将不胜感激。
我的自定义表格:
<!-- FORM DIV STARTS HERE -->
<div id="order-form">
<form name="orderform" id="orderform" action="" method="">
<!-- PERSONAL INFORMATION BLOCK-->
<legend class="form-header">Personal Information</legend>
<fieldset class="order-form-line">
<span class="req">Name:*</span> <input type="text" name="customername" id="customername" class="required letterswithbasicpunc" style="margin-left:78px;"/><br />
<div class="help">Enter your full name such as "John Smith"</div>
<span class="req">Email:*</span> <input type="text" name="customeremail" class="required email" style="margin-left:82px;" /><br />
<div class="help">Enter a valid email such as "johnsmith@gmail.com"</div>
Website: <input type="text" name="customersite" class="url" style="margin-left:72px;" />
<div class="help">Enter url like "http://www.yoursitename.com"</div>
</fieldset>
<!-- ORDER INFORMATION BLOCK-->
<legend class="form-header">Order Description</legend>
<fieldset class="order-form-line">
<div class="formbuttons">
<span class="req new">Content Type:*</span>
<input type="checkbox" name="webcontent" class="required" /> Article
<input type="checkbox" name="webcontent" /> Review
</div>
<div class="formbuttons2">
<span class="req new">Content Tone:*</span>
<input type="checkbox" name="contenttone" class="required" /> Professional
<input type="checkbox" name="contenttone" /> Friendly
</div>
Keyword(s): <input type="text" name="keys" class="" style="margin-left:51px;" /><br />
<div class="help">You can enter keywords in a comma-separated format</div>
Description: <div class="areatxt"><textarea rows="5" cols="31">Your description goes here</textarea></div>
<div class="help">Describe if you have any other requirements</div>
Audience: <input type="text" name="audience" class="" style="margin-left:66px;" />
<div class="help">You can provide info on your target audience</div>
</fieldset>
<!-- PAYMENT DETAILS BLOCK -->
<legend class="form-header">Payment Details</legend>
<fieldset class="order-form-line modified">
<span class="req">No. of Words:*</span> <input type="text" name="wordsno" id="wordsno" class="required digits" value="0" style="margin-left:31px; text-align:center;" /> <br />
<div class="help">Enter (only digits) your per word requirement such as "500" for five-hundred word articles</div>
<span class="req">Quantity:*</span> <input type="text" name="wordsqty" id="wordsqty" class="required digits" value="0" style="margin-left:60px;text-align:center;" /> <br />
<div class="help">Enter (only digits) the total number of articles you need such as "10" for ten articles</div>
Unit Price: <input type="text" name="wordsunitprice" value="$0.02" disabled="disabled" style="margin-left:64px;text-align:center;" /><br />
<div class="help">This is the "per word" cost</div>
Total Cost: <input type="text" name="wordstotalcost" id="wordstotalcost" value="$0.00" disabled="disabled" style="margin-left:59px;text-align:center;" /><br />
<div class="help">This reflects the total amount you would have to pay. It multiplies the 'unit price' with the result we get multiplying 'no. of words' and 'quantity'</div>
<input type="submit" value="Submit" />
</fieldset>
</form>
</div><!-- FORM DIV ENDS HERE -->
所以我的确切问题是: -
(1) 现在如何用 paypal 购买替换自定义表单的常规 html 提交按钮?注意:“客户支付的金额”将动态传递给贝宝的购买。
(2) 如果他想将整个客户信息保存到数据库中,他会怎么做?这应该在收到贝宝端的付款确认后发生!