Paypal分期付款计划的自定义变量

时间:2018-01-08 03:19:07

标签: php html5 paypal

我决定使用Paypal的支付网关方法,允许我的客户完全支付金额或有分期付款计划,以便他们支付他们订购的东西。

我知道您可以在创建分期付款计划按钮之前定义变量。但是,问题在于变量是预定义的。 enter image description here

我正在寻找的是,如果有办法改变这些变量的价值,我该怎么做?

到目前为止,这是我的购物车页面的代码。

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="YQUKWHZVR23K8">
<table> 
<tr><td><input type="hidden" name="on0" value="plan"></td></tr>

<tr><td><input type="hidden" name="os0" value ="option_0"></td><td>

<strong>Installment for Programme</strong></td></tr>

<tr><td></td><td>Number of payments 4</td></tr><tr><td></td><td>Start 
payments At checkout</td></tr>
<tr><td></td><td>

<table>
<tr><th align="left">Due*</th><th align="right">Amount</th></tr>
<tr><td>At checkout</td><td align="right"><?php echo ($totalAmount/4) + 
"SGD" ; ?></td></tr><tr><td>Every 1 month (x 3)</td><td align="right"><?php 
echo ($totalAmount/4);?></td></tr><tr><td COLSPAN="2" ALIGN="right"><?php 
echo $totalAmount ?></td></tr></table></td></tr>
<tr><td colspan="3"><i>* We calculate payments from the date of checkout.
</i></td></tr></table>
<table><tr><td align=center><i></i></td></tr><tr><td><input type="image" 
src="https://www.paypalobjects.com/en_US/i/btn/btn_installment_plan_LG.gif" 
border="0" name="submit" alt="PayPal - The safer, easier way to pay 
online!"></td></tr></table>
<img alt="" border="0" 
src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" 
height="1">
</form>

我试图在StackOverflow上查找此问题,但他们主要询问的是Full in Payment,而不是分期付款计划方法。此外,我已经尝试过他们的解决方案,但无济于事。

任何帮助都将不胜感激。

1 个答案:

答案 0 :(得分:0)

根据分期付款计划,您可以选择不同的金额和非常的还款期限。请记住,只允许分期4次。 为托管按钮提供屏幕截图,为非托管按钮提供代码。请注意,我们建议您保护所有非托管按钮。 PayPal开发者网站上的分期付款计划信息:

https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/installment_step_1/

下面的非托管按钮代码(当前指向沙箱):

<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_xclick-payment-plan">
<input type="hidden" name="business" value="youremail@email.com">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="item_name" value="Test Installment Plan">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="cn" value="Add special instructions to the seller:">
<input type="hidden" name="no_shipping" value="2">
<input type="hidden" name="disp_tot" value="Y">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="bn" value="PP-PaymentPlanBF:btn_installment_plan_LG.gif:NonHosted">
<table>
<tr><td><input type="hidden" name="on0" value="plan"></td></tr>
<tr><td><input type="hidden" name="os0" value ="option_0"></td><td><strong>Variable Installments</strong></td></tr>
<tr><td></td><tr><td></td><td>Number of payments 4</td></tr><tr><td></td><td>
<table>
<tr><th align="left">No.</th><th align="left">Due*</th><th align="right">Amount</th></tr>
<tr><td>1</td><td>At checkout</td>
<td align="right">$50.00 USD</td></tr><tr><td>2</td><td>after 1 week</td>
<td align="right">$75.00 USD</td></tr><tr><td>3</td><td>after 2 weeks</td>
<td align="right">$85.00 USD</td></tr><tr><td>4</td><td>after 3 weeks</td>
<td align="right">$90.00 USD</td></tr><tr><td COLSPAN="3" ALIGN="right">Total   $300.00 USD</td></tr></table></td></tr>
<tr><td colspan="3"><i>* We calculate payments from the date of checkout.</i></td></tr></table>
<input type="hidden" name="option_select0" value="option_0">
<input type="hidden" name="option_select0_name" value="Variable Installments">
<input type="hidden" name="option_select0_type" value="V">
<input type="hidden" name="option_select0_a0" value="50.00">
<input type="hidden" name="option_select0_p0" value="0">
<input type="hidden" name="option_select0_t0" value="W">
<input type="hidden" name="option_select0_n0" value="1">
<input type="hidden" name="option_select0_a1" value="75.00">
<input type="hidden" name="option_select0_p1" value="1">
<input type="hidden" name="option_select0_t1" value="W">
<input type="hidden" name="option_select0_n1" value="1">
<input type="hidden" name="option_select0_a2" value="85.00">
<input type="hidden" name="option_select0_p2" value="2">
<input type="hidden" name="option_select0_t2" value="W">
<input type="hidden" name="option_select0_n2" value="1">
<input type="hidden" name="option_select0_a3" value="90.00">
<input type="hidden" name="option_select0_p3" value="3">
<input type="hidden" name="option_select0_t3" value="W">
<input type="hidden" name="option_select0_n3" value="1">
<input type="hidden" name="option_index" value="0">
<table><tr><td align=center><i>Sign up for</i></td></tr><tr><td><input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/btn_installment_plan_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"></td></tr></table>
<img alt="" border="0" src="https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>

以下是托管按钮的屏幕截图: enter image description here


谢谢,