Refactor/rename the reference transaction enabled checking class.

This commit is contained in:
Narek Zakarian 2025-06-30 16:08:36 +04:00
parent 40a95202ec
commit 0a0d7e9c49
No known key found for this signature in database
GPG key ID: 07AFD7E7A9C164A7
10 changed files with 26 additions and 26 deletions

View file

@ -11,7 +11,7 @@ namespace WooCommerce\PayPalCommerce\StatusReport;
use WooCommerce\PayPalCommerce\ApiClient\Authentication\Bearer;
use WooCommerce\PayPalCommerce\ApiClient\Exception\RuntimeException;
use WooCommerce\PayPalCommerce\ApiClient\Helper\BillingAgreementsEndpoint;
use WooCommerce\PayPalCommerce\ApiClient\Helper\ReferenceTransactionStatus;
use WooCommerce\PayPalCommerce\ApiClient\Helper\DccApplies;
use WooCommerce\PayPalCommerce\Button\Helper\MessagesApply;
use WooCommerce\PayPalCommerce\Compat\PPEC\PPECHelper;
@ -76,7 +76,7 @@ class StatusReportModule implements ServiceModule, ExtendingModule, ExecutableMo
assert( $last_webhook_storage instanceof WebhookEventStorage );
$billing_agreements_endpoint = $c->get( 'api.endpoint.billing-agreements' );
assert( $billing_agreements_endpoint instanceof BillingAgreementsEndpoint );
assert( $billing_agreements_endpoint instanceof ReferenceTransactionStatus );
/* @var Renderer $renderer The renderer. */
$renderer = $c->get( 'status-report.renderer' );
@ -278,9 +278,9 @@ class StatusReportModule implements ServiceModule, ExtendingModule, ExecutableMo
/**
* Checks if reference transactions are enabled in account.
*
* @param BillingAgreementsEndpoint $billing_agreements_endpoint The endpoint.
* @param ReferenceTransactionStatus $billing_agreements_endpoint The endpoint.
*/
private function reference_transaction_enabled( BillingAgreementsEndpoint $billing_agreements_endpoint ): bool {
private function reference_transaction_enabled( ReferenceTransactionStatus $billing_agreements_endpoint ): bool {
try {
return $billing_agreements_endpoint->reference_transaction_enabled();
} catch ( RuntimeException $exception ) {