Creating test data

david.ells's Avatar

david.ells

30 Sep, 2009 08:06 PM

I understand there are a few options for testing functionality with CG. In the simplest case, CG isn't connected to a payment gateway at all, but still simulates the interaction and creates invoices, charges, etc. Then you can connect CG to a development Auth.net gateway account, and actually run transactions in a dev environment on the gateway right? (Presumably CG thinks these transactions are real and Auth.net just knows they're not?)

My question is: Is there any good way to create a fair amount of test data, possibly with dates in the past, in CG? I am working on some pages in our own portal to report to the user a billing summary showing past invoices, if they've been paid, and so on. I would like to have some generated data for that purpose, is there any way to create it?

As a side question, I'd also like my billing summary report to show upgrades/downgrades/cancellations that happened during the billing period for a customer. Is that data also available on demand from CG or do I need to keep records of those events in our own system? (I'm really hoping you'll say the former, of course :) )

  1. Support Staff 1 Posted by Marc Guyer on 30 Sep, 2009 10:55 PM

    Marc Guyer's Avatar

    ...there are a few options for testing functionality with CG. In the simplest case, CG isn't connected to a payment gateway at all, but still simulates the interaction and creates invoices, charges, etc.

    Correct

    you can connect CG to a development Auth.net gateway account, and actually run transactions in a dev environment on the gateway right? (Presumably CG thinks these transactions are real and Auth.net just knows they're not?)

    Correct.

    Is there any good way to create a fair amount of test data, possibly with dates in the past, in CG?

    Unfortunately, no. I have looked into the possibility of doing this extensively in the past but there is just too much to consider to make it worthwhile. In an ideal world, I'd love to be able to do that.

    I'd also like my billing summary report to show upgrades/downgrades/cancellations that happened during the billing period for a customer. Is that data also available on demand from CG or do I need to keep records of those events in our own system?

    Yes! I've attached a sample xml document that contains a single customer with one subscription and a couple of invoices with transactions. For multiple customers, there would be multiple customer nodes. If the customer had ever changed pricing plans, there would be multiple subscription nodes.

  2. 2 Posted by david.ells on 01 Oct, 2009 02:55 PM

    david.ells's Avatar

    Marc, Thanks a bunch this is just what I needed anyway. One question about the data though. I can see that the item elements within a plan (within a subscription) outline the rules associated with those tracked items (how many are included, the overages, etc). But what do the item elements that are direct children of a subscription element refer to?

  3. Support Staff 3 Posted by Marc Guyer on 02 Oct, 2009 10:17 PM

    Marc Guyer's Avatar

    These refer to the current item usage for the subscription.

    Over time, your customer "uses" an item and your app informs CG via the add-item-quantity method or the set-item-quantity method about that usage. This is how CG tracks the items for you and determines the overage for the current billing period.

  4. Marcela Poffald closed this discussion on 11 Apr, 2018 06:03 PM.

Comments are currently closed for this discussion. You can start a new one.

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