问题
What I want to do is to have a PayPal subscription button on my website, with a quarterly rebilling option.
I know there is a way to do this with non-hosted button code, but I am wondering if there is any way to implement this using PayPal hosted subscription buttons (for security). I'd like to avoid having to use an unhosted button code with encryption and all the script work that entails.
回答1:
Paypal has an Advanced Subscription Button that integrates a few additional hidden fields to customize the billing period and frequency.
Sample Code
<form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<input type="hidden" name="business" value="me@mybusiness.com">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="no_shipping" value="1">
<input type="image" src="http://www.paypal.com/en_US/i/btn/btn_subscribe_LG.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<input type="hidden" name="a3" value="50.00">
<input type="hidden" name="p3" value="3">
<input type="hidden" name="t3" value="M">
<input type="hidden" name="src" value="1">
<input type="hidden" name="sra" value="1">
</form>
The above code will create a recurring payment of $50.00 every 3 months (quarterly). The following fields affect the billing amount, period and frequency.
- a3 - amount to billed each recurrence
- p3 - number of time periods between each recurrence
- t3 - time period (D=days, W=weeks, M=months, Y=years)
来源:https://stackoverflow.com/questions/9606430/how-to-implement-a-quarterly-subscription-paypal-button