Skip to main content

Posts

Showing posts from June, 2016

Sending Mobile SMS in Ruby on Rails using twilio

Sending Mobile SMS in Ruby on Rails using twilio?gem install twilio-rubyIn ControllerU need to add the  require 'twilio-ruby'@account_sid = 'AC3ddc5567a441ea2fdf0a460452599aa6' @auth_token = '9aefac893c9c9214770046ecb796d6c8'@client = Twilio::REST::Client.new(@account_sid, @auth_token)p @client.account@client.account.messages.create(from: '+12019044303', to: '+919538947694',body: 'Hello koteshwarrao welcome to my blog') Notes: From number is nothing but twillo numberTo Number is from whom u need to send the messageUse Only Live credentials only@account_sid is twilio account id@auth_token is twilio auth tokenBefore Sending any message to mobile the mobile number need to be verified to twilio account.

PayUMoney Integration in Ruby on Rails

PayUMoney Integration in Ruby on Rails


Generating Cheksum in Payu
   Hash or Checksum
= sha512(key|txnid|amount|productinfo|firstname|email|u
df1|udf2|udf3|udf4|udf5||||||salt)



Controller Code Will be
def payumoney
  @key = "gtKFFx"
  @salt =  "eCwWELxi"
  val = "#{key|txnid|amount|productinfo|firstname|email|u
df1|udf2|udf3|udf4|udf5||||||#{@salt}"
 @checksum = Digest::SHA512.hexdigest("#{val}")
end

<form action="https://test.payu.in/_payment" method='post' id='sub'  >
    <input type="hidden" name="key" value="<%=@key%>">
    <input type="hidden" name="hash" value="<%=@checksum%>">
    <input type="hidden" name="txnid" value="TXN1234">
    <input type="hidden" name="amount" value="200">
    <input type="hidden" name="firstname" value=&quo…

Document Preview in Rails?

Document Preview in Rails?
Display the doc preview  in iframe?
<iframe src='https://docs.google.com/viewer?url=www.google.com/doc/kotesh.docx&embedded=true' frameborder='0'></iframe>
Display the doc preview  in new page?
<a href= "https://docs.google.com/viewerng/viewer?url=url=www.google.com/doc/kotesh.docx&embedded=true" target= "_blank">Doc PreView</a>