Skip to content
This repository has been archived by the owner on Jun 12, 2018. It is now read-only.

billing dispatcher to handle credit cutoff #1214

Conversation

rudigiesler
Copy link

The billing dispatcher should handle the the parameter set in #1210 appropriately.

@rudigiesler
Copy link
Author

Ready for review.

@@ -251,8 +261,10 @@ def process_outbound(self, config, msg, connector_name):
log.info(
"Not billing for outbound message: %r" % msg.to_json())
else:
yield self.create_transaction_for_outbound(msg)
transaction = yield self.create_transaction_for_outbound(msg)
msg_mdh.set_paid()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we only call msg.set_paid() if transaction is not None?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

transaction is probably a bad name for the result because the transaction data is not only one part of the result?

@hodgestar
Copy link
Contributor

Left a few comments but this turned out a lot cleaner than I feared it might. Woot!

session_event='new'
)

published_msg = self.ri_helper.get_dispatched_inbound()[0]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be self.ro_helper.get... (and the same for the other inbound test)`

@rudigiesler
Copy link
Author

Ready for re-review

@hodgestar
Copy link
Contributor

I've realised that we should send back nacks for messages that aren't sent because of the cutoff. Maybe that should happen in a separate PR though.


self.assertEqual(len(self.ri_helper.get_dispatched_outbound()), 0)


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too many blank lines?

@hodgestar
Copy link
Contributor

👍 once the extra blank line is removed.

Let's leave the nack for a separate PR. I'm happy with us deploying this today and leaving activating it for Monday if everyone else is.

@rudigiesler
Copy link
Author

#1219 created for sending back nacks.

@hodgestar
Copy link
Contributor

👍

rudigiesler pushed a commit that referenced this pull request Mar 6, 2015
…patcher-to-handle-credit-cutoff

billing dispatcher to handle credit cutoff
@rudigiesler rudigiesler merged commit 817837c into develop Mar 6, 2015
@rudigiesler rudigiesler deleted the feature/issue-1214-billing-dispatcher-to-handle-credit-cutoff branch March 6, 2015 14:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants