Incomplete methods to add initial (negative) charges

Dan Kamins's Avatar

Dan Kamins

13 Aug, 2010 07:27 PM

We have a promotion that gives first month of service for only $1. We tried to do this by applying a negative charge to the customer's account at signup time.

For users who have no CG record yet, we can use the charges[<user-defined>] params in:
https://cheddargetter.com/developers#add-customer

For users with an existing CG record with a valid CC, we can use the add charge API method directly:
https://cheddargetter.com/developers#add-charge

BUT if the customer HAS a CG record but no CC on file (e.g. free plan), neither of these works. The direct add-charge API method fails with error 401: "Cannot add a charge when the customer's subscribed plan is free and the subscription does not have current credit card information"
And the customer modification method (https://cheddargetter.com/developers#update-customer-subscription) seems to ignore the charges[<user-defined>] params.

Please help. We actually sent out this promo to all of our customers, and it's not really working at all! Whoops!

Two possible solutions we can think of:
CG allows add-charge API to apply to accounts without credit card if used with negative amounts.
or
CG allows update-customer-subscription to take charges params like add-customer does.

Thank you.

  1. Support Staff 1 Posted by Marc Guyer on 13 Aug, 2010 08:04 PM

    Marc Guyer's Avatar

    We're on it. We'll keep you posted.

  2. Support Staff 2 Posted by Marc Guyer on 13 Aug, 2010 09:02 PM

    Marc Guyer's Avatar

    We just deployed a patch that lifts the restriction of adding a charge when the customer does not have payment information. We determined this restriction was unnecessarily reducing functionality.

    Please let us know how this solution works for you.

  3. 3 Posted by Dan Kamins on 16 Aug, 2010 05:59 PM

    Dan Kamins's Avatar

    Hi Marc,

    Thanks for the quick patch. It seems to be partly working now. But with a customer coming from free plan to $99 plan , we see both a -$98 charge (which we expect) AS WELL as a questionable +$1 charge with the exact same code and description. So our $1 plan ends up costing people $2 and the bill is sort of confusing.

    This customer shows this:
    https://cheddargetter.com/admin/customers/get/id/5c81829a-faaf-102d...

    Is this residual debug code? Are we doing something wrong? Thanks for looking into this.

  4. Support Staff 4 Posted by Marc Guyer on 16 Aug, 2010 07:28 PM

    Marc Guyer's Avatar

    I get a 404 for that customer link. What's the customer's code?

  5. 5 Posted by Dan Kamins on 16 Aug, 2010 07:34 PM

    Dan Kamins's Avatar

    It's in our "(Test)" product, not our main product. Customer code "dk_144".

  6. Support Staff 6 Posted by Marc Guyer on 16 Aug, 2010 08:09 PM

    Marc Guyer's Avatar

    We don't have debug logging turned on for your test account so it's hard to tell where that charge originated. Can you replicate?

  7. Support Staff 7 Posted by Marc Guyer on 16 Aug, 2010 09:11 PM

    Marc Guyer's Avatar

    Some assumptions based on timestamps:

    • 2010-08-16T17:53:30+00:00 - Customer Created (PLAN_FREETRIAL)
    • 2010-08-16T17:53:30+00:00 - $1 Debit Created (COUPON_DISCOUNT)
    • 2010-08-16T17:54:06+00:00 - $98 Credit Created (COUPON_DISCOUNT)
    • 2010-08-16T17:54:08+00:00 - Subscription Change (PLAN_PREMIUM)

    So, it seems that the customer was created and the $1 custom charge was added in the same call (customers/new). 36 seconds later, the $98 custom credit was created (customers/add-charge). Then, the customer's subscription was immediately changed to a paid plan.

    Based on these assumptions, the problem is either a bug in customers/new or the $1 charge information was sent in the customers/new call. Does this happen every time?

  8. 8 Posted by Dan Kamins on 16 Aug, 2010 10:37 PM

    Dan Kamins's Avatar

    Yes it's 100% reproducible: Delete CG record. Sign up for free trial. Upgrade to paid plan with $1 coupon. Customer ends up with unexpected $1 charge applied immediately at creation timestamp. I re-ran this process with a $499 plan, so you can see similar results in the same customer now.

  9. Support Staff 9 Posted by Marc Guyer on 17 Aug, 2010 02:27 PM

    Marc Guyer's Avatar

    We've turned on debug logging on your test account. Could you replicate again and let us know?

  10. 10 Posted by Dan Kamins on 19 Aug, 2010 08:46 PM

    Dan Kamins's Avatar

    I tried it again with this customer:
    https://cheddargetter.com/admin/customers/get/id/12e271ec-fd22-102d...

    This time it worked properly (i.e. no extra $1 charge). Did you push a fix already, or is this just less than 100% reproducible now?

  11. Support Staff 11 Posted by Marc Guyer on 19 Aug, 2010 08:58 PM

    Marc Guyer's Avatar

    There have not been any updates to customers/new for quite some time. Is there a production customer that had this behavior?

  12. 12 Posted by Dan Kamins on 19 Aug, 2010 09:06 PM

    Dan Kamins's Avatar

    https://cheddargetter.com/admin/customers/get/code/u_585895 (production customer) used this coupon, and it worked correctly.

    Prior to this, several customers tried it but ran into the original problem of this thread ("Cannot add a charge when the customer's subscribed plan is free and the subscription does not have current credit card information").

    I just re-ran my test on the test account, and was able to reproduce the problem (extra $1 charge). See this test customer:
    https://cheddargetter.com/admin/customers/get/id/85a8f702-fd25-102d...

    Hopefully your logs should allow you to get to the bottom of this now.

  13. Support Staff 13 Posted by Marc Guyer on 19 Aug, 2010 09:54 PM

    Marc Guyer's Avatar

    Here's the raw post to customers/new at 2010-08-19 21:04:21 UTC:

    code=dk_144&firstName=dtest2060&subscription%5BplanCode%5D=PLAN_FREETRIAL&lastName=Free+Trial&charges%5BCOUPON_REBATE_CHARGE_PERIOD_1%5D%5BeachAmount%5D=1.00&metaData%5Bcoupon%5D=justabuck&charges%5BCOUPON_REBATE_CHARGE_PERIOD_1%5D%5BchargeCode%5D=COUPON_DISCOUNT&charges%5BCOUPON_REBATE_CHARGE_PERIOD_1%5D%5Bquantity%5D=1&metaData%5Btm_uid%5D=144&charges%5BCOUPON_REBATE_CHARGE_PERIOD_1%5D%5Bdescription%5D=One-time+1st+period+coupon+special+%28%241%29&email=dtest2060%40hotmail.com

    And a nicely formatted representation:

    [code] => dk_144
    [firstName] => dtest2060
    [subscription] => Array
        (
            [planCode] => PLAN_FREETRIAL
        )
    
    [lastName] => Free Trial
    [charges] => Array
        (
            [COUPON_REBATE_CHARGE_PERIOD_1] => Array
                (
                    [eachAmount] => 1.00
                    [chargeCode] => COUPON_DISCOUNT
                    [quantity] => 1
                    [description] => One-time 1st period coupon special ($1)
                )
    
        )
    
    [metaData] => Array
        (
            [coupon] => justabuck
            [tm_uid] => 144
        )
    
    [email] => [email blocked]
  14. 14 Posted by Dan Kamins on 23 Aug, 2010 05:37 PM

    Dan Kamins's Avatar

    Thank you Marc, that was very helpful.

    From this info it looks like this might actually be a side-effect of the workaround code we pushed to address the original issue (Cannot add a charge when the customer's subscribed plan is free)! Hopefully we'll be able to simply remove that code which is no longer needed, and this should go away. I'll update this thread with final results when we have them.

  15. 15 Posted by Dan Kamins on 31 Aug, 2010 11:41 PM

    Dan Kamins's Avatar

    This problem is solved. The thread can be resolved/closed. Thanks very much for your help, Marc.

  16. Marc Guyer closed this discussion on 01 Sep, 2010 01:08 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