Created
September 22, 2009 22:59
-
-
Save warlley/191525 to your computer and use it in GitHub Desktop.
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
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