Skip to content

Commit

Permalink
Merge pull request #111 from Thiago-Medeiros/master
Browse files Browse the repository at this point in the history
fix: content-type and accept from http requests
  • Loading branch information
s2it-moscou authored Jan 30, 2018
2 parents 800b9ff + 879a875 commit b6e0718
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion source/Services/DirectPreApproval/AccessionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static function create(Credentials $credentials, Accession $directPreAppr
Logger::info("Begin", ['service' => 'DirectPreApproval']);
try {
$connection = new Connection\Data($credentials);
$http = new Http('json');
$http = new Http('Content-Type: application/json;', 'Accept: application/vnd.pagseguro.com.br.v3+json;charset=ISO-8859-1');
Logger::info(sprintf("POST: %s", self::request($connection)), ['service' => 'DirectPreApproval']);
Logger::info(
sprintf(
Expand Down
2 changes: 1 addition & 1 deletion source/Services/DirectPreApproval/CancelService.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static function create(Credentials $credentials, Cancel $cancel)
Logger::info("Begin", ['service' => 'DirectPreApproval']);
try {
$connection = new Connection\Data($credentials);
$http = new Http('json');
$http = new Http('Content-Type: application/json;', 'Accept: application/vnd.pagseguro.com.br.v3+json;charset=ISO-8859-1');
Logger::info(sprintf("POST: %s", self::request($connection, CancelParser::getPreApprovalCode($cancel))),
['service' => 'DirectPreApproval']);
Logger::info(
Expand Down
2 changes: 1 addition & 1 deletion source/Services/DirectPreApproval/ChangePaymentService.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static function create(Credentials $credentials, ChangePayment $changePay
Logger::info("Begin", ['service' => 'DirectPreApproval']);
try {
$connection = new Connection\Data($credentials);
$http = new Http('json');
$http = new Http('Content-Type: application/json;', 'Accept: application/vnd.pagseguro.com.br.v3+json;charset=ISO-8859-1');
Logger::info(sprintf("POST: %s",
self::request($connection, ChangePaymentParser::getPreApprovalCode($changePayment))),
['service' => 'DirectPreApproval']);
Expand Down
2 changes: 1 addition & 1 deletion source/Services/DirectPreApproval/DiscountService.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static function create(Credentials $credentials, Discount $discount)
Logger::info("Begin", ['service' => 'DirectPreApproval']);
try {
$connection = new Connection\Data($credentials);
$http = new Http('json');
$http = new Http('Content-Type: application/json;', 'Accept: application/vnd.pagseguro.com.br.v3+json;charset=ISO-8859-1');
Logger::info(sprintf("PUT: %s", self::request($connection, DiscountParser::getPreApprovalCode($discount))),
['service' => 'DirectPreApproval']);
Logger::info(
Expand Down
2 changes: 1 addition & 1 deletion source/Services/DirectPreApproval/EditPlanService.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static function edit(Credentials $credentials, EditPlan $editPlan)
Logger::info("Begin", ['service' => 'DirectPreApproval']);
try {
$connection = new Connection\Data($credentials);
$http = new Http('json');
$http = new Http('Content-Type: application/json;', 'Accept: application/vnd.pagseguro.com.br.v3+json;charset=ISO-8859-1');

Logger::info(sprintf("PUT: %s",
self::request($connection, EditPlanParser::getPreApprovalRequestCode($editPlan))),
Expand Down
2 changes: 1 addition & 1 deletion source/Services/DirectPreApproval/PaymentService.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static function create(Credentials $credentials, Payment $payment)
Logger::info("Begin", ['service' => 'DirectPreApproval']);
try {
$connection = new Connection\Data($credentials);
$http = new Http('json');
$http = new Http('Content-Type: application/json;', 'Accept: application/vnd.pagseguro.com.br.v3+json;charset=ISO-8859-1');
Logger::info(sprintf("POST: %s", self::request($connection)), ['service' => 'DirectPreApproval']);
Logger::info(
sprintf(
Expand Down
2 changes: 1 addition & 1 deletion source/Services/DirectPreApproval/PlanService.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static function create(Credentials $credentials, $data)
Logger::info("Begin", ['service' => 'DirectPreApproval']);
try {
$connection = new Connection\Data($credentials);
$http = new Http('json');
$http = new Http('Content-Type: application/json;', 'Accept: application/vnd.pagseguro.com.br.v3+json;charset=ISO-8859-1');
Logger::info(sprintf("POST: %s", self::request($connection)), ['service' => 'DirectPreApproval']);
Logger::info(
sprintf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static function create(Credentials $credentials, QueryNotification $query
Logger::info("Begin", ['service' => 'DirectPreApproval']);
try {
$connection = new Connection\Data($credentials);
$http = new Http('json');
$http = new Http('Content-Type: application/json;', 'Accept: application/vnd.pagseguro.com.br.v3+json;charset=ISO-8859-1');
Logger::info(sprintf("GET: %s", self::request($connection, QueryNotificationParser::getData($queryNotification),
QueryNotificationParser::getNotificationCode($queryNotification))), ['service' => 'DirectPreApproval']);
Logger::info(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static function create(Credentials $credentials, QueryPaymentOrder $query
Logger::info("Begin", ['service' => 'DirectPreApproval']);
try {
$connection = new Connection\Data($credentials);
$http = new Http('json');
$http = new Http('Content-Type: application/json;', 'Accept: application/vnd.pagseguro.com.br.v3+json;charset=ISO-8859-1');
Logger::info(sprintf("POST: %s", self::request($connection, QueryPaymentOrderParsers::getPreApprovalCode($queryPaymentOrder))), ['service' => 'DirectPreApproval']);
Logger::info(
sprintf(
Expand Down
2 changes: 1 addition & 1 deletion source/Services/DirectPreApproval/QueryService.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static function create(Credentials $credentials, Query $directPreApproval
Logger::info("Begin", ['service' => 'DirectPreApproval']);
try {
$connection = new Connection\Data($credentials);
$http = new Http('json');
$http = new Http('Content-Type: application/json;', 'Accept: application/vnd.pagseguro.com.br.v3+json;charset=ISO-8859-1');
Logger::info(sprintf("POST: %s", self::request($connection)), ['service' => 'DirectPreApproval']);
Logger::info(
sprintf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static function create(Credentials $credentials, RetryPaymentOrder $retry
Logger::info("Begin", ['service' => 'DirectPreApproval']);
try {
$connection = new Connection\Data($credentials);
$http = new Http('json');
$http = new Http('Content-Type: application/json;', 'Accept: application/vnd.pagseguro.com.br.v3+json;charset=ISO-8859-1');
Logger::info(sprintf("POST: %s", self::request($connection,
RetryPaymentOrderParser::getData($retryPaymentOrder))), ['service' => 'DirectPreApproval']);
Logger::info(
Expand Down
2 changes: 1 addition & 1 deletion source/Services/DirectPreApproval/StatusService.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static function create(Credentials $credentials, Status $status)
Logger::info("Begin", ['service' => 'DirectPreApproval']);
try {
$connection = new Connection\Data($credentials);
$http = new Http('json');
$http = new Http('Content-Type: application/json;', 'Accept: application/vnd.pagseguro.com.br.v3+json;charset=ISO-8859-1');
Logger::info(sprintf("PUT: %s", self::request($connection, StatusParser::getPreApprovalCode($status))),
['service' => 'DirectPreApproval']);
Logger::info(
Expand Down

0 comments on commit b6e0718

Please sign in to comment.