DynamoMTL / spree_chimpy

Spree/MailChimp Integration
BSD 3-Clause "New" or "Revised" License
35 stars 123 forks source link

Make sure an order is only synced once #43

Closed bryanmtl closed 10 years ago

bryanmtl commented 10 years ago

Removing an order only removes it (seemingly) from the campaign stats, but not the total order count. As such, calling remove and then add, as we do in the sync method, can cause inflated numbers in MailChimp.

cc: @joshnuss

braidn commented 10 years ago

Bryan,

That’s the plan! The old sync ability doesn’t even work with the new API so this will change. -- 

On July 3, 2014 at 3:39:14 PM, Bryan Mahoney (notifications@github.com) wrote:

Removing an order only removes it (seemingly) from the campaign stats, but not the total order count. As such, calling remove and then add, as we do in the sync method, can cause inflated numbers in MailChimp.

bryanmtl commented 10 years ago

:+1:

braidn commented 10 years ago

Bryan,

This is my first whirl. Since there is no way to "sync" an order we need to rely on these two methods (add/delete). This alleviates our blanket use of delete but, will it still cause inflated numbers?

      def sync(order)
        add(order)
      rescue Mailchimp::InvalidEcommOrderError
        remove(order)
        add(order)
bryanmtl commented 10 years ago

@braidn - That is worth a try. Is sync only called once though?

braidn commented 10 years ago

It will be called when an order is updated or created.

On Jul 4, 2014, at 7:35, Bryan Mahoney notifications@github.com wrote:

@braidn - That is worth a try. Is sync only called once though?

— Reply to this email directly or view it on GitHub.

bryanmtl commented 10 years ago

I think our best bet is to just call it when it transitions to complete.

braidn commented 10 years ago

Sounds good

On Jul 4, 2014, at 7:43, Bryan Mahoney notifications@github.com wrote:

I think our best bet is to just call it when it transitions to complete.

— Reply to this email directly or view it on GitHub.