Updating a PayPal Customer

Derreck Nassar's Avatar

Derreck Nassar

27 Jul, 2013 08:43 PM

I am trying to update a canceled customer and reactivate their account. I have no trouble doing so using a credit card, but when I try to update that same customer using PayPal as my method I the following error:

6235364 401 Plan change prorate on a canceled subscription is not allowed. Reactivate first.

    current:***REPORT_QUART
    new:***_REPORT_MONTH

I am passing the returnURL and and cancelURL params over but CG keeps giving me an error.

  1. Support Staff 1 Posted by Marc Guyer on 29 Jul, 2013 07:54 PM

    Marc Guyer's Avatar

    Hi Derreck -- Due to the nature of PayPal, the subscription must first be reactivated before the plan change can occur.

  2. 2 Posted by Derreck Nassar on 29 Jul, 2013 08:31 PM

    Derreck Nassar's Avatar

    So what is the best way for to have a ex-paypal user sign up for a new service? If inactive paypal user updates their account will it reactivate it? If so Should I write code to reactivate their account first then immediately upgrade their account so it seems seamless to the user?

  3. Support Staff 3 Posted by Marc Guyer on 29 Jul, 2013 08:36 PM

    Marc Guyer's Avatar

    So what is the best way for to have a ex-paypal user sign up for a new service?

    I'm not sure what you mean here. New service? Aren't they already a customer?

    If inactive paypal user updates their account will it reactivate it?

    Yes, if the paypal preapproval process is reinitiated and the customer approves the new preapproval, the account will be reactivated. Assuming of course that any outstanding invoice is also successfully settled after the preapproval is accepted. In other words, if the outstanding invoice (if any) is declined again, the account will remain in a canceled state.

    If so Should I write code to reactivate their account first then immediately upgrade their account so it seems seamless to the user?

    You can do this but it's asynchronous. Again, due to the nature of PayPal. So, once you've confirmed that the PayPal preapproval is accepted and the account is reactivated, you could automatically perform the plan change. You could listen for the Subscription Reactivated webhook for this purpose.

  4. 4 Posted by Derreck Nassar on 05 Aug, 2013 06:07 PM

    Derreck Nassar's Avatar

    So paypal user approves the reactivation then I automatically update the profile to the new service? Does the customer have to go through the paypal preapproval process twice when reactivating and upgrading?

  5. Support Staff 5 Posted by Marc Guyer on 05 Aug, 2013 06:49 PM

    Marc Guyer's Avatar

    So paypal user approves the reactivation then I automatically update the profile to the new service?

    Right, when a customer has a subscription in good standing (has an accepted preapproval), you are free to make any change to the subscription that you need to.

    Does the customer have to go through the paypal preapproval process twice when reactivating and upgrading?

    No.

  6. 6 Posted by Derreck Nassar on 05 Aug, 2013 10:21 PM

    Derreck Nassar's Avatar

    What if a new user creates a subscription with PayPal and after some time they cancel. Then a few months later the same customer wants to setup a new subscription (different pricing plan) but this time they want to use a credit card and not paypal. Do I have to reactive the paypal subscription then change their payment type to credit card with the new CC info? Or can I simply update the customer with the new credit card info?

    Trying to work trough the programming logic.

  7. 7 Posted by Derreck Nassar on 06 Aug, 2013 12:19 PM

    Derreck Nassar's Avatar

    This is the most frustrating thing ever. I am considering taking PayPal off my site as an option all together. It is painful to put out a promotion, check in the morning to see how many people signed up and then see several people trying to give you money in exchange for a service and they can't.

    Last night I thought I worked through this by simply changing the customer code on ex-customers that used paypal the first go around. It seems that did not work. My database has the new customer code, but it looks like CG/PayPal still didn't like it because they used the same PayPal account?

    How do you reactivate a paypal customer? Is it a customer update? Is a pricing plan required to reactivate a paypal customer? After the pre-approval process is re-initiated then I would need to pass parameters back to my server in the returnURL to upgrade the account using my server and talking with CG?

  8. Support Staff 8 Posted by Marc Guyer on 06 Aug, 2013 12:39 PM

    Marc Guyer's Avatar

    Or can I simply update the customer with the new credit card info?

    This is correct.

    Last night I thought I worked through this by simply changing the customer code on ex-customers that used paypal the first go around. It seems that did not work. My database has the new customer code, but it looks like CG/PayPal still didn't like it because they used the same PayPal account?

    I'm not sure I understand what you're asking. Could you elaborate?

    How do you reactivate a paypal customer? Is it a customer update? Is a pricing plan required to reactivate a paypal customer?

    A call to customers/edit-subscription with the required params will reactivate the customer. A customer is always subscribed to a pricing plan in CG.

    After the pre-approval process is re-initiated then I would need to pass parameters back to my server in the returnURL to upgrade the account using my server and talking with CG?

    It is possible to pass parameters through the returnURL but I recommend instead polling CG for the latest account information when the customer is returned to your site. Keep in mind that the PayPal process is asynchronous meaning that once the customer accepts a preapproval, CG waits to receive an IPN from PayPal to confirm the result of the IPN. That can take several seconds and so the customer may return to your site before CG's records are updated according to the IPN information.

  9. 9 Posted by Derreck Nassar on 06 Aug, 2013 01:08 PM

    Derreck Nassar's Avatar

    "I'm not sure I understand what you're asking. Could you elaborate?"

    My thinking was instead of updating a ex customer who used PayPal I would instead create a new customer. Since I use email address as my customer code this would run into problems with CG since there is already a customer with that customer code. So my thinking was to simple create a new customer code for the user and sign them up like a new account. That did not work - I guess because the PayPal account is associated with the old customer code?

    "A call to customers/edit-subscription with the required params will reactivate the customer. A customer is always subscribed to a pricing plan in CG."

    What are the required params to reactivate a ex PayPal customer? The API is not clear here.

    Custmoer Code?
    subscription[method]?
    subscription[returnUrl]?
    subscription[cancelUrl]?

    So if a PayPal customer cancels and 2 months later they come back then all I need to do to reactivate them is pass the 4 params above to CG and they are reactivated? Once reactivated then then I can update the customer to the new product code?

    "I recommend instead polling CG for the latest account information"

    What get param should I look for? Is there a Active/Inactive param? The best I can find is the cancel date. If null then active, if not null then canceled. Will this work for someone who has already canceled in the past? Checking the number of invoices for the customer is not good if the customer is on a free trial (bill x days after sign up) because there are no invoices until after they are billed.

  10. Support Staff 10 Posted by Marc Guyer on 06 Aug, 2013 01:19 PM

    Marc Guyer's Avatar

    That did not work - I guess because the PayPal account is associated with the old customer code?

    Correct. If you create a new customer record, it is entirely unrelated to the old customer record. Each customer record must have it's own PayPal preapproval.

    What are the required params to reactivate a ex PayPal customer? The API is not clear here.

    Your params are correct. The PayPal-specific documentation on this is here:

    http://support.cheddargetter.com/kb/api-8/using-paypal-with-the-api...

    So if a PayPal customer cancels and 2 months later they come back then all I need to do to reactivate them is pass the 4 params above to CG and they are reactivated?

    This begins the reactivation process. The process is complete after the customer is redirected to PayPal, they accept the new preapproval, and CG receives the IPN confirming the acceptance of the preapproval.

    Once reactivated then then I can update the customer to the new product code?

    Correct.

    What get param should I look for? Is there a Active/Inactive param? The best I can find is the cancel date. If null then active, if not null then canceled. Will this work for someone who has already canceled in the past? Checking the number of invoices for the customer is not good if the customer is on a free trial (bill x days after sign up) because there are no invoices until after they are billed.

    The cancel date (on the first subscription node of the API response) reflects whether or not the customer is canceled. With paypal, there is a special type of canceled (paypal-wait). More on that here:

    http://support.cheddargetter.com/kb/api-8/using-paypal-with-the-api...

    Are you using an API wrapper? For reference, the PHP wrapper has some convenience methods for this stuff. Specifically, whether or not the customer is in paypal-wait state:

    https://github.com/marcguyer/cheddargetter-client-php/blob/master/R...

    And generally if the customer is considered active or not:

    https://github.com/marcguyer/cheddargetter-client-php/blob/master/R...

  11. 11 Posted by Derreck Nassar on 06 Aug, 2013 05:23 PM

    Derreck Nassar's Avatar

    To be clear - no two customers can share the same paypal account? for example customer code barak.obama.email.com and customer code barak_obama cannot register with the same paypal account?

  12. Support Staff 12 Posted by Marc Guyer on 06 Aug, 2013 06:21 PM

    Marc Guyer's Avatar

    To be clear - no two customers can share the same paypal account? for example customer code barak.obama.email.com and customer code barak_obama cannot register with the same paypal account?

    Incorrect. The same paypal account can be used as a payment method for any number of customer records in CG. Each subscription in CG maintains a separate paypal preapproval. Each PayPal account can have multiple preapprovals.

  13. Jess Pendley closed this discussion on 21 Nov, 2013 07:46 PM.

Discussions are closed to public comments.
If you need help with Cheddar please start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

28 Mar, 2024 10:45 PM
24 Jan, 2024 08:33 AM
11 Jan, 2024 07:13 AM
30 Nov, 2023 02:07 AM
22 Nov, 2023 08:41 AM