简体   繁体   中英

Paypal Subscription Modification

I was hoping someone could help regarding modifying a subscription price.

I have a social networking site In which you originally could subscribe to a standard or premium account which varied in what applications where active in your account.

My client now whats to scrap the 2 subscriptions and be able to give a choice of what applications the user wants to use and charge a subscription cost for the total cost for the applications specified.

I have a 'bolt-ons' page in which the user clicks a checkbox associated with each application, which then processes the payment and the IPN makes modifications to their account which works fine.

But when a user decides they want more or less applications and fills out the form again, I can't figure out how to modify their payment.

when I add the modify variable to the html form and continue the payment, it brings me to a radio form with other subscriptions from different projects.

I simply want to modify the total outgoings of the users payments. It is the user the process's the form, there is nothing illegitimate going off, just simply looking for the user to be able to change the subscription rate which depends on what applications they want active.

here's my html form:

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" 

style="margin:20px;">
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<input type="hidden" name="business" value="******************************" />
<input type="hidden" name="item_name" value="************************ Application Bolt-on's" />
<input type="hidden" name="return" value="http://www.***************.co.uk/?navigation=home">
<input type="hidden" name="cancel_return" value="http://www.***************.co.uk/?navigation=home">
<input type="hidden" name="item_number" value="1" />
<input type="hidden" name="currency_code" value="GBP" />
<?php
if( isset( $post['mod'] ) ) {
    echo "<input type=\"hidden\" name=\"modify\" value=\"2\" />";   
    echo "<input type=\"hidden\" name=\"a3\" value=\"00.02\" />";
}else{
    echo "<input type=\"hidden\" name=\"a3\" value=\"00.01\" />";
}
?>
<input type="hidden" name="p3" value="1" />
<input type="hidden" name="t3" value="M" />
<input type="hidden" name="src" value="1" />
<input type="hidden" name="sra" value="1" />
<input type="hidden" name="sra" value="1" />
<input type="hidden" name="no_note" value="1" />
<input type="hidden" name="custom" value="<?php echo $custom_str; ?>" />
<input type="image" src="https://www.paypal.com/en_US/GB/i/btn/btn_subscribeCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online.">
<img alt="" border="0" src="https://www.paypal.com/en_GB/i/scr/pixel.gif" width="1" height="1">
</form>

I have read many articles and non touch on this subject in a sense of whether it can or cannot be done so please don't send me links the the paypal site unless it is the exact answer which I may have missed.

Any help is much appreciated,

Regards,

Phil

Hate to give such a partial non-answer to your question, but I think the information you need might be in the following blog post http://talklikeaduck.denhaven2.com/2007/09/02/how-to-cure-the-paypal-subscription-blues (Link is broken, but left here for attribution purposes)

From that article:

Another complexity of PayPal subscriptions is how to allow users to modify subscriptions. In fact this is where I came in on this particular web site. They had been offering only monthly subscriptions and wanted to offer an annual subscription with a discount. The key here is to ensure that you tell PayPal that you are modifying a subscription rather than creating a new one. The PayPal documentation describes the 'modify' attribute which is to be passed with the subscription signup request post to paypal. A value of '1' for this attribute indicates that it will modify an existing subscription, or create a new one if there is no existing subscription. Don't beleive this. My initial testing with the PayPal developer sandbox seemed to indicate that this worked. In practice though, once deployed, it always seemed to create a new subscription, which meant that when a user upgraded a monthly subscription to an annual one, she ended up with both.

The fix was to use a value of '2' for modify when the user had an existing subscription, and not to use the modify attribute at all otherwise.

The article is dated 2007 and I would be careful to trust it as a current reference, but it might be a good starting point.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM