不确定要问什么,但我已按照PayPal开发者网站上的说明操作: https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/buynow_buttons/
有另一个问题。我有一个表格:
<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="myemail@myaddress.com">
<input type="hidden" name="bn" value="MR_BuyNow_WPS_CA">
<input type='hidden' name='lc' value='CA'>
<input type="hidden" name="currency_code" value="CAD">
<input type="hidden" name="no_shipping" value="0">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="return" value="/design/payments/success/">
<input type="hidden" name="cancel_return" value="/design/payments/failed/">
<input type="hidden" name="cbt" value="Return to MR">
<input type="hidden" name="item_number" value="buy-time">
<table>
<tr><td>
<p>Provide the following:</p>
</td></tr>
<tr><td>
<div class="row collapse">
<div class="small-3 columns">
<span class="prefix"><span data-tooltip aria-haspopup="true" class="has-tip" title="Please provide your full name as it appears on the order form.">Name:</span></span>
</div>
<div class="small-9 columns">
<input type="text" placeholder="What is your name?" name="os0" maxlength="200">
</div>
</div>
<div class="row collapse">
<div class="small-12 columns">
<select name="item_name">
<option value="Maintenance Hours">Maintenance</option>
<option value="General Work Hours">General Work (Additions, etc.)</option>
</select>
</div>
</div>
<div class="row collapse">
<div class="small-12 columns">
<select name="os1">
<option value="2 Hours ($50/Hour)">2 Hours ($50/Hour) - $100.00 CAD</option>
<option value="3 Hours ($45/Hour)">3 Hours ($45/Hour) - $135.00 CAD</option>
<option value="4 Hours ($45/Hour)">4 Hours ($45/Hour) - $180.00 CAD</option>
<option value="5 Hours ($45/Hour)">5 Hours ($45/Hour) - $225.00 CAD</option>
<option value="6 Hours ($45/Hour)">6 Hours ($45/Hour) - $270.00 CAD</option>
</select>
</div>
</div>
</td></tr>
</table>
<input type="hidden" name="on0" value="Client">
<input type="hidden" name="on1" value="Hours">
<input type="image" class="payments-buy" src="http://mrobertsdesign.ca/img/payments_buy.png" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
</form>
现在它在技术上有效(它至少会进入paypal购买页面),直到我实际为按钮添加价格:
<input type="hidden" name="option_select0" value="2 Hours">
<input type="hidden" name="option_amount0" value="100.00">
<input type="hidden" name="option_select1" value="3 Hours">
<input type="hidden" name="option_amount1" value="135.00">
<input type="hidden" name="option_select2" value="4 Hours">
<input type="hidden" name="option_amount2" value="180.00">
<input type="hidden" name="option_select3" value="5 Hours">
<input type="hidden" name="option_amount3" value="225.00">
<input type="hidden" name="option_select4" value="6 Hours">
<input type="hidden" name="option_amount4" value="270.00">
如果任何有经验的人都能指出我错过的东西会很棒=)
答案 0 :(得分:1)
我不完全确定您的目标是什么,但是使用PayPal内置的按钮下拉按钮会更容易吗?由于您基本上是说每小时费率打折,您可以使用现在购买按钮设置为50美元,如果他们选择3或更多的数量,它打折至45美元。希望这会有所帮助。
答案 1 :(得分:0)
事实证明,ABC
,<option value="A">
和<input type="hidden" name="option_selectX" value="B">
中<input type="hidden" name="option_amountX" value="C">
的值必须(1)不包含任何大写字母,特殊字符或空格,(2) )它也必须是字母数字或至少包含一个字母,(3)是一个完整的短语:
接受:
1plug
thisisananswer
5000b
我不接受:
1
1 plug
5000
this is an answer
这对我来说很奇怪,因为在我加入<option value="A">
和<input type="hidden" name="option_selectX" value="B">
之前<input type="hidden" name="option_amountX" value="C">
的值可能包含空格。
我试了一下试错法来解决这个问题。