Created
March 25, 2015 15:20
-
-
Save esilvajr/a851d4109caf1abfc473 to your computer and use it in GitHub Desktop.
This file contains 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
// Configuração | |
// Método 1 | |
// Você pode definir suas credenciais de acesso, entre outras configurações, editando o arquivo | |
// PagSeguroLibrary/config/PagSeguroConfig.php | |
$PagSeguroConfig = array(); | |
$PagSeguroConfig['environment'] = "production"; // production, sandbox | |
$PagSeguroConfig['credentials'] = array(); | |
$PagSeguroConfig['credentials']['email'] = "your_pagseguro_email"; | |
$PagSeguroConfig['credentials']['token']['production'] = "your_production_pagseguro_token"; | |
$PagSeguroConfig['credentials']['token']['sandbox'] = "your_sandbox_pagseguro_token"; | |
$PagSeguroConfig['credentials']['appId']['production'] = "your__production_pagseguro_application_id"; | |
$PagSeguroConfig['credentials']['appId']['sandbox'] = "your_sandbox_pagseguro_application_id"; | |
$PagSeguroConfig['credentials']['appKey']['production'] = "your_production_application_key"; | |
$PagSeguroConfig['credentials']['appKey']['sandbox'] = "your_sandbox_application_key"; | |
$PagSeguroConfig['application'] = array(); | |
$PagSeguroConfig['application']['charset'] = "UTF-8"; // UTF-8, ISO-8859-1 | |
$PagSeguroConfig['log'] = array(); | |
$PagSeguroConfig['log']['active'] = false; | |
// Informe o path completo (relativo ao path da lib) para o arquivo, ex.: ../PagSeguroLibrary/logs.txt | |
$PagSeguroConfig['log']['fileLocation'] = ""; | |
return $PagSeguroConfig; | |
// Metódo 2: | |
// Você pode definir suas credenciais de acesso, entre outras configurações, criando uma classe chamada PagSeguroConfigWrapper | |
// com uma função publica e estática getConfig() | |
class PagSeguroConfigWrapper | |
{ | |
public static function getConfig() | |
{ | |
$PagSeguroConfig = array(); | |
$PagSeguroConfig['environment'] = "production"; // production, sandbox | |
$PagSeguroConfig['credentials'] = array(); | |
$PagSeguroConfig['credentials']['email'] = "your_pagseguro_email"; | |
$PagSeguroConfig['credentials']['token']['production'] = "your_production_pagseguro_token"; | |
$PagSeguroConfig['credentials']['token']['sandbox'] = "your_sandbox_pagseguro_token"; | |
$PagSeguroConfig['credentials']['appId']['production'] = "your__production_pagseguro_application_id"; | |
$PagSeguroConfig['credentials']['appId']['sandbox'] = "your_sandbox_pagseguro_application_id"; | |
$PagSeguroConfig['credentials']['appKey']['production'] = "your_production_application_key"; | |
$PagSeguroConfig['credentials']['appKey']['sandbox'] = "your_sandbox_application_key"; | |
$PagSeguroConfig['application'] = array(); | |
$PagSeguroConfig['application']['charset'] = "UTF-8"; // UTF-8, ISO-8859-1 | |
$PagSeguroConfig['log'] = array(); | |
$PagSeguroConfig['log']['active'] = false; | |
// Informe o path completo (relativo ao path da lib) para o arquivo, ex.: ../PagSeguroLibrary/logs.txt | |
$PagSeguroConfig['log']['fileLocation'] = ""; | |
return $PagSeguroConfig; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment