Reputation: 197
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="[email protected]">
<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!
Upvotes: 1
Views: 1123
Reputation: 491
please check here is the best example i have used :
https://github.com/thenbrent/paypal-digital-goods/blob/master/paypal-subscription.class.php
Upvotes: 4
Reputation: 224
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
Upvotes: 3