Skip to content

Instantly share code, notes, and snippets.

View rinaldifonseca's full-sized avatar

Rinaldi Fonseca rinaldifonseca

View GitHub Profile
1 |autorizado | Pagamento já foi realizado porém ainda não foi creditado na Carteira MoIP recebedora (devido ao floating da forma de pagamento)
2 | iniciado | Pagamento está sendo realizado ou janela do navegador foi fechada (pagamento abandonado)
3 |boleto impresso | Boleto foi impresso e ainda não foi pago
4 | concluido | Pagamento já foi realizado e dinheiro já foi creditado na Carteira MoIP recebedora
5 | cancelado | Pagamento foi cancelado pelo pagador, instituição de pagamento, MoIP ou recebedor antes de ser concluído
6 | em análise | Pagamento foi realizado com cartão de crédito e autorizado, porém está em análise pela Equipe MoIP. Não existe garantia de que será concluído
7 | estornado | Pagamento foi estornado pelo pagador, recebedor, instituição de pagamento ou MoIP
8 | em revisão | Pagamento está em revisão pela equipe de Disputa ou por Chargeback
9 | reeembolsado | Pagamento foi reembolsado diretamente para a carteira MoIP do pagador pelo recebedor do pagamento ou pelo MoIP
STATUS = {
"1" => :authorized,
"2" => :started,
"4" => :completed
}
Com apenas isso eu evitei usar CASE ou apelar para polimorfismo =)
<?xml version="1.0" encoding="UTF-8"?>
<EnviarInstrucao>
<InstrucaoUnica>
<Razao>Pagamento</Razao>
<Valores>
<Valor moeda="BRL">10.90</Valor>
</Valores>
<IdProprio>148</IdProprio>
<PagamentoDireto>
<Forma>BoletoBancario</Forma>
@rinaldifonseca
rinaldifonseca / mysql
Created October 10, 2011 23:50 — forked from dcrec1/centos
ubuntu nginx
gzip on;
gzip_types text/plain text/xml text/css application/javascript application/x-javascript;
charset utf-8;
location ~* \.(ico|css|js|gif|jp?g|png|swf)(\?[0-9]+)?$ {
expires max;
}
location ~* \.(eot|ttf|woff)$ {
require 'spec_helper'
require 'integration/helpers'
feature "Access control", %q{
In secure the project
As an admin
I want control access to the site
} do
before :each do
@rinaldifonseca
rinaldifonseca / resque_web.rb
Created September 14, 2011 01:06 — forked from grosser/resque_web.rb
Mountable resque-web for rails 3+ apps
# https://gist.github.com/1214052
require 'sinatra/base'
class ResqueWeb < Sinatra::Base
require 'resque/server'
use Rack::ShowExceptions
if CFG[:user].present? and CFG[:password].present?
Resque::Server.use Rack::Auth::Basic do |user, password|
user == CFG[:user] && password == CFG[:password]
@rinaldifonseca
rinaldifonseca / default.vcl.pl
Created August 29, 2011 20:31 — forked from bmarini/default.vcl.pl
A good varnish config for a Rails app
# https://www.varnish-cache.org/docs/2.1/tutorial/vcl.html
# https://www.varnish-cache.org/trac/wiki/VCLExamples
# Summary
# 1. Varnish will poll the backend at /health_check to make sure it is
# healthy. If the backend goes down, varnish will server stale content
# from the cache for up to 1 hour.
# 2. Varnish will pass X-Forwarded-For headers through to the backend
# 3. Varnish will remove cookies from urls that match static content file
# extensions (jpg, gif, ...)
@rinaldifonseca
rinaldifonseca / ruby_quiz
Created August 10, 2011 16:39
Quiz: Por qual motivo o código abaixo não funciona??
class Foo
def bar
self.test
end
private
def test
puts "hello"
end
end
@rinaldifonseca
rinaldifonseca / rails_3_1_rc4_changes.md
Created August 8, 2011 05:09 — forked from ryanb/rails_3_1_rc4_changes.md
The Changelogs for Rails 3.1 Beta 1

Railties 3.1 RC4

  • The new rake task assets:clean removes precompiled assets. [fxn]

  • Application and plugin generation run bundle install unless --skip-gemfile or --skip-bundle. [fxn]

  • Fixed database tasks for jdbc* adapters #jruby [Rashmi Yadav]

  • Template generation for jdbcpostgresql #jruby [Vishnu Atrai]

@rinaldifonseca
rinaldifonseca / _yerb.rb
Created August 5, 2011 17:50 — forked from josevalim/_yerb.rb
Who needs HAML when you have YAML + ERB?
# = YERB
#
# Who needs HAML when you have YAML + ERB? ;)
#
# See example.yaml below for an example. You can run this code
# by cloning this gist and then `ruby _yerb.rb example.yaml`.
#
# Notice that you need Ruby 1.9 so the hash order is preserved.
# Obviously, this is just for fun. Definitely slow as hell.
#