user207421
user207421

Reputation: 311050

PayPal Subscribe button with modify - I am breaking it somehow - how?

When I set modify=1 as below and click the button I don't get the advertised behaviour of being taken to a PayPal page where I can upgrade my (the test user's) existing subscription. Instead I just get presented with a new subscription, which doesn't cancel the old one if I agree. I'm sending some extra stuff as well and I figure something there must be breaking it ... but what?

<form target="paypal" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" name="subscribe_XXXXXX" id="subscribe_XXXXXX" style="float: left;">
    <input type="hidden" name="cmd" value="_s-xclick" />
    <input type="hidden" name="bn" value="XXXXXX" />
    <input type="hidden" name="custom" value="XXXXXX" />
    <input type="hidden" name="image_url" value="XXXXXX" />
    <input type="hidden" name="no_shipping" value="1" />
    <input type="hidden" name="notify_url" value="XXXXXX" />
    <input type="hidden" name="return" value="XXXXXX" />
    <input type="hidden" name="rm" value="2" />
    <input type="hidden" name="cbt" value="XXXXXX" />
    <input type="hidden" name="src" value="1" />
    <input type="hidden" name="currency_code" value="USD" />
    <input type="hidden" name="hosted_button_id" value="XXXXXX" />
    <input type="hidden" name="item_name" value="XXXXXX" />
    <input type="hidden" name="modify" value="1" />
    <input type="hidden" name="on0" value="Subscription options" />
    <input type="hidden" name="on1" value="email" />
    <table>
        <tbody>
            <tr>
                <td>Subscription options:</td>
                <td>
                    <select name="os0">

                        <option value="Daily">Daily: </option>
                        <option value="Weekly">Weekly:  </option>
                        <option value="Montly">Monthly: </option>
                        <option value="Yearly">Yearly:  </option>
                    </select>
                </td>
                <td>
                    <input type="text" name="os1" maxlength="200"/>
                </td>
                <td>
                    <input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/btn_subscribeCC_LG.gif" border="0" name="submit" title="Subscribe to CognitiveLab ICND1" alt="PayPal - The safer, easier way to pay online!" width="96" height="30" /><img alt="|" border="0" src="https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1" />
                </td>
            </tr>
        </tbody>
    </table>
</form>

All the URLs are correct and work properly. I've also tried modify=2, and I am setting modify=0 if I know that the user isn't subscribed.

I am expecting this to result in a subscr_modify IPN with a revised period[123] and mc_amount[123] and a subscr_effective date. It doesn't, I get a new subscr_signup.

Upvotes: 1

Views: 1272

Answers (1)

PP_MTS_Matt
PP_MTS_Matt

Reputation: 1394

Try creating an unhosted button. Some values in the form aren't allow to be used when the preset values are saved within the PayPal account.

When creating the button add the steps below to obtain the "raw" HTML code.

  1. Click "Step 2: Track inventory, profit & loss (optional)"
  2. Uncheck "Save button at PayPal"

Once the button is created go ahead and click the link to remove code protection. If the issue continues please post the new form here and I'll take a look.

Hope this helps!

Upvotes: 14

Related Questions