Skip to content

Instantly share code, notes, and snippets.

@xenda
Created August 5, 2010 16:40
Show Gist options
  • Save xenda/509989 to your computer and use it in GitHub Desktop.
Save xenda/509989 to your computer and use it in GitHub Desktop.
# Antiguo
logger.info "Sending shares for project #{project.api_name}"
logger.info API_URL + "/shareholders/#{self.email}/shares/transferFromProject"
password = user.email.split("@").first
logger.info "amount=#{amount}&shareholderPassword=#{password}&projectName=#{URI.escape(project.api_name)}chapterName=#URI.escape(project.current_chapter.api_name)}&receivingUserName=#{receiver.email}"
res = Net::HTTP.post_form(URI.parse(API_URL + "/shareholders/#{self.email}/shares/transferFromProject"),'amount'=>amount,'shareholderPassword'=>password,'projectName'=>project.api_name,'chapterName'=>project.current_chapter.api_name,'receivingUserName'=>receiver.email})
logger.info res
logger.info res.inspect
# Nuevo
API::post("/projects/#{project.api_name}", {'shareholderPassword'=>project.user.api_password,'projectName'=>project.api_name, 'chapterName'=>project.current_chapter.api_name })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment