I want to setup a subscription based payment system via PayPal. I currently am using PayPal's api for a few of my items and an IPN listener. The code is as provided:
<form name="_xclick" action="https://www.paypal.com/us/cgi-bin/webscr" class="form-horizontal" method="post" id="paypalformhidden">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="sales@example.com">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" id="ppname" name="item_name" value='Large Brwon Teddy Bear' />
<input type="hidden" name="item_name1" value='Ted' />
<input type="hidden" name="notify_url" value="example.com/listener.php">
<input type="hidden" name="return" value="example.com"/>
<input type="hidden" id="ppamount" name="amount" value='39.00'>
I thought the subscription is as easy as this, but it seems unfriendly. I'd love some input!
The _xclick
command is for "Buy Now" buttons. There's a different command value for Subscription buttons. You can read more about setting up a Subscribe button here on PayPal's developer site: https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/subscribe_buttons/#id08ADF1008HS
please check here is the best example i have used :
https://github.com/thenbrent/paypal-digital-goods/blob/master/paypal-subscription.class.php
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.