Skip to content

Instantly share code, notes, and snippets.

@warlley
Created September 22, 2009 22:59
Show Gist options
  • Save warlley/191525 to your computer and use it in GitHub Desktop.
Save warlley/191525 to your computer and use it in GitHub Desktop.
class GatewayPagLw
VALID_PAG_TYPES = {:boleto => 'BOLETOLOCAWEB', :visa => nil, :redecard => nil}
VALID_ENVIRONMENT = {:producao => 'PRODUCAO', :teste => 'TESTE'}
def initialize(pag_type, environment, identification)
raise "Payment type #{pag_type} unknown" unless VALID_PAG_TYPES.include? pag_type
raise "Environment type #{environment} unknown" unless VALID_ENVIRONMENT.include? environment
@pag_type = pag_type
@identification = identification
@environment = environment
@params = {
:identificacao => @identification,
:ambiente => VALID_ENVIRONMENT[@environment],
:modulo => VALID_PAG_TYPES[@pag_type]
}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment