mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-30 05:00:51 +08:00
Refactor the service name, variable names to use the new class
This commit is contained in:
parent
0a0d7e9c49
commit
96895aba51
8 changed files with 46 additions and 177 deletions
|
@ -75,8 +75,8 @@ class StatusReportModule implements ServiceModule, ExtendingModule, ExecutableMo
|
|||
$last_webhook_storage = $c->get( 'webhook.last-webhook-storage' );
|
||||
assert( $last_webhook_storage instanceof WebhookEventStorage );
|
||||
|
||||
$billing_agreements_endpoint = $c->get( 'api.endpoint.billing-agreements' );
|
||||
assert( $billing_agreements_endpoint instanceof ReferenceTransactionStatus );
|
||||
$reference_transaction_status = $c->get( 'api.reference-transaction-status' );
|
||||
assert( $reference_transaction_status instanceof ReferenceTransactionStatus );
|
||||
|
||||
/* @var Renderer $renderer The renderer. */
|
||||
$renderer = $c->get( 'status-report.renderer' );
|
||||
|
@ -170,7 +170,7 @@ class StatusReportModule implements ServiceModule, ExtendingModule, ExecutableMo
|
|||
'exported_label' => 'Reference Transactions',
|
||||
'description' => esc_html__( 'Whether Reference Transactions are enabled for the connected account', 'woocommerce-paypal-payments' ),
|
||||
'value' => $this->bool_to_html(
|
||||
$this->reference_transaction_enabled( $billing_agreements_endpoint )
|
||||
$reference_transaction_status->reference_transaction_enabled()
|
||||
),
|
||||
),
|
||||
array(
|
||||
|
@ -275,19 +275,6 @@ class StatusReportModule implements ServiceModule, ExtendingModule, ExecutableMo
|
|||
return $field_settings['options'][ $subscriptions_mode ] ?? $subscriptions_mode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if reference transactions are enabled in account.
|
||||
*
|
||||
* @param ReferenceTransactionStatus $billing_agreements_endpoint The endpoint.
|
||||
*/
|
||||
private function reference_transaction_enabled( ReferenceTransactionStatus $billing_agreements_endpoint ): bool {
|
||||
try {
|
||||
return $billing_agreements_endpoint->reference_transaction_enabled();
|
||||
} catch ( RuntimeException $exception ) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts the bool value to "yes" icon or dash.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue