Skip to content

Instantly share code, notes, and snippets.

@laspluviosillas
Last active December 30, 2015 03:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laspluviosillas/7772119 to your computer and use it in GitHub Desktop.
Save laspluviosillas/7772119 to your computer and use it in GitHub Desktop.
class ContentProviderCalculator
def calculate(commissionable)
olei = # find olei content provider
olec = # find olec content provider
content_amount = commissionable.subtotal * .2 # 20% goes to content providers
if commissionable.premium?
# create commission for olei of 66.7% of content_amount
# create commission for olec of 33.3% of content_amount
else
# create commission for olei for content_amount
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment