Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create custom logger and save to /var/log/pagseguro.log #3

Merged
merged 1 commit into from
Nov 16, 2018

Conversation

conflicker
Copy link
Contributor

No description provided.

@@ -336,9 +338,9 @@ public function callApi($params, $payment, $type='transactions')
$params = $paramsObj->getParams();
$paramsString = $this->convertToCURLString($params);

//$this->writeLog('Parameters being sent to API (/'.$type.'): '. var_export($params, true));
$this->writeLog('Parameters being sent to API (/'.$type.'): '. var_export($params, true));
Copy link
Owner

@r-martins r-martins Nov 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm almost sure that you don't need the var_export, and $params can be passed as the second argument of writeLog method.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@r-martins there's only 1 parameter in writeLog function. var_export is needed since $param was concatenated into a string, Otherwise the log will look like this:

[2018-11-13 08:02:38] main.DEBUG: Parameters being sent to API (/transactions): [] []

@@ -360,7 +362,7 @@ public function callApi($params, $payment, $type='transactions')
}
curl_close($ch);

// $this->writeLog('Retorno PagSeguro (/'.$type.'): ' . var_export($response, true));
$this->writeLog('Retorno PagSeguro (/'.$type.'): ' . var_export($response, true));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

break;
case 'Forbidden':
//$this->writeLog('Unauthorized access to Api Pagseguro. Make sure you have permission to use this service. Return: ' . var_export($response, true)
// );
$this->writeLog('Unauthorized access to Api Pagseguro. Make sure you have permission to use this service. Return: ' . var_export($response, true)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here

Copy link
Owner

@r-martins r-martins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just make sure we need the var_export..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants