Skip to content

Instantly share code, notes, and snippets.

@novito
Created September 23, 2014 20:24
Show Gist options
  • Save novito/3c3bddba92c77015956e to your computer and use it in GitHub Desktop.
Save novito/3c3bddba92c77015956e to your computer and use it in GitHub Desktop.
def import_legacy_purchase_data(data)
purchase_list = legacy_data_parser.parse_purchase_records(data)
purchase_list.each do |purchase_record|
customer = customer_list.get_customer(purchase_record.email_address)
product = product_inventory.get_product(purchase_record.product_id)
customer.add_purchased_product(product)
customer.notify_of_files_available(product)
log_successful_import(purchase_record)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment