Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I'm creating a paypal check-out form for a subscription service.

Paypal allows me to specify the "reacurring times" of the subscription with the "srt" option: https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_html_Appx_websitestandard_htmlvariables

I would like to create a drop-down list that allows the customer to select either an indefinite number of times or a specific number of times.

The select would probably look like this, however, I'm unsure how to specify an unlimited duration. Should I leave the value blank, or is there a way not to send the variable through at all?:

<select name="srt">
    <option value="1"></option>  <!-- One time --> 
    <option value="9"></option>  <!-- Nine times --> 
    <option value=""></option>  <!-- Indefinitely?? --> 
</select>

I'm unsure how to handle this use case. Any help would be appreciated. Thanks!

Update:

It also looks like its impossible to specify srt="1" (the first option). When this option is selected, paypal rejects the link as invalid because a subscription service must be more than one time. From my understanding. Only wants to purchase one interval, then another option: "src" must be set to "0".

Can I do this with one html drop-down, or do I need to use javascript to respond to user input and then change hidden form values accordingly?

share|improve this question
1  
I believe the srt option should be omitted for indefinite recurring payments. However, you could try setting this to 0 - as this appears to work for other options(?) paypalobjects.com/en_US/ebook/subscriptions/html.html –  w3d Sep 11 '11 at 14:34
add comment

1 Answer

According to the PayPal documentation on the srt parameter:

Recurring Times. This is the number of payments which will occur at the regular rate. If omitted, payment will continue to recur at the regular rate until the subscription is cancelled

So you would have to omit the parameter to get to get recurring payments until cancelled. This means that you would need to use some JavaScript to respond to the select menu and add a hidden field to a form with this parameter when it is required.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.