This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bash < <(curl -s https://rvm.beginrescueend.com/install/rvm) | |
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bash_profile | |
source .bash_profile | |
rvm install 1.9.2 | |
rvm gemset create r3 | |
rvm use 1.9.2@r3 --default | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Paypal.sandbox! | |
r = Paypal::NVP::Request.new(:username => PAYPAL[:username], :password => PAYPAL[:password], :signature => PAYPAL[:signature]) | |
r.request('RefundTransaction', {'TRANSACTIONID' => '2VV74337KH776410C', 'REFUNDTYPE' => 'Full'}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def parse_signed_request(request) | |
# Facebook's signed requests come in two parts -- the signature and the data payload | |
# see http://developers.facebook.com/docs/authentication/canvas | |
return {} if request.blank? | |
encoded_sig, payload = request.split(".") | |
sig = base64_url_decode(encoded_sig) | |
# if the signature matches, return the data, decoded and parsed as JSON | |
if OpenSSL::HMAC.digest("sha256", FB[:secret_key], payload) == sig |
NewerOlder