いくつかのフィールドを含む注文フォームを作成しました(コードは以下に記載されています)。今私がやろうとしているのは、ペイパルの今すぐ購入ボタンをこのフォームに統合することです!私はここでは初心者なので、同じことを達成する方法がわかりません!ご覧のとおり、フォームには通常の「送信」ボタンがあり、ペイパルの今すぐ購入に置き換える必要があります。
私が理解しようとしているもう1つの重要なことは、支払いの完了時に、[今すぐ購入]ボタンをクリックして、顧客が入力したデータをデータベースに保存する方法です。どんな助けでもいただければ幸いです。
私のカスタムフォーム:
<!-- 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)カスタムフォームの通常のhtml送信ボタンを今すぐペイパル購入に置き換えるにはどうすればよいですか?注:「顧客が支払う金額」は、PayPalの購入に動的に渡されます。
(2)顧客情報全体をデータベースに保存したい場合はどうしますか?これは、ペイパル側から支払い確認を受け取ったときに発生するはずです。