我是PayPal集成的新手。我需要为用户每月支付PayPal定期付款。我已经使用这种方法进行即时付款:
<form method="post" action="https://www.paypal.com/cgi-bin/webscr" name="form_paypal" id="paypal_form">
<input type="hidden" name="amount" value="<?php echo $amount; ?>" />
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="no_note" value="1" />
<input type="hidden" name="lc" value="USA" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="business" value="test@gmail.com">
<input type="hidden" name="custom" value='<?php echo $custom;?>' />
<input type="hidden" name="first_name" value= "Anonymous" />
<input type="hidden" name="last_name" value="User" />
<input type="hidden" name="payer_email" value="customer@example.com" />
<input type="hidden" name="item_number" value="123" / >
<input type="hidden" name="item_name" value="test.co Services" / >
<input type="hidden" name="notify_url" value="http://test.co/pg_return.php" / >
<input type="submit" value="Pay" name="pay" id="paypal_submit">
</form>
我需要更改哪些内容才能在我的面板中集成定期付款?请帮我!如果需要,我会提供更多信息!
答案 0 :(得分:0)
根据您的示例,以下是使用相同方法设置订阅/定期付款的方式:
<form method="post" action="https://www.paypal.com/cgi-bin/webscr" name="form_paypal" id="paypal_form">
<input type="hidden" name="cmd" value="_xclick-subscriptions" />
<input type="hidden" name="business" value="test@gmail.com">
<input type="hidden" name="a3" value="<?php echo $amount; ?>" />
<input type="hidden" name="t3" value="M" >
<input type="hidden" name="p3" value="1" >
<input type="hidden" name="src" value="1" >
<input type="hidden" name="no_note" value="1" />
<input type="hidden" name="lc" value="US" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="custom" value="<?php echo $custom;?>"/>
<input type="hidden" name="first_name" value= "Anonymous" />
<input type="hidden" name="last_name" value="User" />
<input type="hidden" name="item_number" value="123" / >
<input type="hidden" name="item_name" value="test.co Services" / >
<input type="hidden" name="notify_url" value="http://test.co/pg_return.php" / >
<input type="submit" value="Pay" name="pay" id="paypal_submit">
</form>
请注意,我做了一些更改。 &#34; A3&#34;表示订阅金额和&#34; p3&#34;表示持续时间的单位(即M =月,D =每日等)。要使订阅无限期地重复,请设置&#34; src&#34;和&#34; p3&#34;到1.
供参考,您可以在此处阅读PayPal文档链接:https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables/#id08A6HI00JQU