Skip to content

Commit

Permalink
Merge pull request #149 from mundipagg/develop
Browse files Browse the repository at this point in the history
Merge Develop into Master
  • Loading branch information
GabrielDeveloper authored Feb 18, 2020
2 parents e592005 + 0d52fa4 commit 33e00a5
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "mundipagg/ecommerce-module-core",
"description": "Core component for Mundipagg e-commerce platforms modules.",
"license": "MIT",
"version": "1.12.1",
"version": "1.12.2",
"authors": [
{
"name": "MundiPagg Embeddables Team",
Expand Down
2 changes: 1 addition & 1 deletion src/Maintenance/Assets/integrityData

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/Webhook/Exceptions/UnprocessableWebhookException.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class UnprocessableWebhookException extends AbstractMundipaggCoreException
/**
* UnprocessableWebhookException constructor.
*/
public function __construct($message)
public function __construct($message, $code = 422)
{
parent::__construct($message, 422);
parent::__construct($message, $code);
}
}
2 changes: 2 additions & 0 deletions src/Webhook/Services/ChargeHandlerService.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Mundipagg\Core\Kernel\ValueObjects\OrderStatus;
use Mundipagg\Core\Kernel\ValueObjects\TransactionType;
use Mundipagg\Core\Webhook\Aggregates\Webhook;
use Mundipagg\Core\Webhook\Exceptions\UnprocessableWebhookException;

final class ChargeHandlerService extends AbstractHandlerService
{
Expand All @@ -27,6 +28,7 @@ final class ChargeHandlerService extends AbstractHandlerService
*/
protected function handlePaid(Webhook $webhook)
{

//magento\sales\model\order\payment\interceptor
$orderRepository = new OrderRepository();
$chargeRepository = new ChargeRepository();
Expand Down
3 changes: 2 additions & 1 deletion src/Webhook/Services/OrderHandlerService.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ private function canBePaid($order)
if ($canBePaid === false) {
$chargesStatuses = json_encode($chargesStatuses);
throw new UnprocessableWebhookException(
"One or more charges of the order are in a state that is not compatible with an paid order. Charge Statuses: $chargesStatuses"
"One or more charges of the order are in a state that is not compatible with an paid order. Charge Statuses: $chargesStatuses",
500
);
}
}
Expand Down

0 comments on commit 33e00a5

Please sign in to comment.