Skip to content

Commit

Permalink
fix: Correct ideal capability check
Browse files Browse the repository at this point in the history
  • Loading branch information
cyl3x committed Jan 16, 2025
1 parent 004516c commit a5d7284
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/Util/Lifecycle/Method/IdealMethodData.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

use Shopware\Core\Framework\Log\Package;
use Swag\PayPal\RestApi\V1\Api\MerchantIntegrations;
use Swag\PayPal\RestApi\V1\Api\MerchantIntegrations\Capability;
use Swag\PayPal\Util\Availability\AvailabilityContext;

/**
Expand Down Expand Up @@ -62,6 +63,16 @@ public function getMediaFileName(): ?string

public function validateCapability(MerchantIntegrations $merchantIntegrations): string
{
return self::CAPABILITY_ACTIVE;
$capability = $merchantIntegrations->getSpecificCapability('IDEAL');

if ($capability === null) {
return self::CAPABILITY_INACTIVE;
}

if ($capability->getStatus() === Capability::STATUS_ACTIVE) {
return self::CAPABILITY_ACTIVE;
}

return self::CAPABILITY_INELIGIBLE;
}
}

0 comments on commit a5d7284

Please sign in to comment.