mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 10:55:00 +08:00
Fix psalm
This commit is contained in:
parent
6f2a47dddb
commit
353ba42cbc
2 changed files with 3 additions and 2 deletions
|
@ -94,7 +94,7 @@ class PaymentSaleCompleted implements RequestHandler {
|
||||||
foreach ( $subscriptions as $subscription ) {
|
foreach ( $subscriptions as $subscription ) {
|
||||||
$parent_order = wc_get_order( $subscription->get_parent() );
|
$parent_order = wc_get_order( $subscription->get_parent() );
|
||||||
$transaction_id = wc_clean( wp_unslash( $request['resource']['id'] ?? '' ) );
|
$transaction_id = wc_clean( wp_unslash( $request['resource']['id'] ?? '' ) );
|
||||||
if ( $transaction_id && is_a( $parent_order, WC_Order::class ) ) {
|
if ( $transaction_id && is_string( $transaction_id ) && is_a( $parent_order, WC_Order::class ) ) {
|
||||||
$this->update_transaction_id( $transaction_id, $parent_order, $this->logger );
|
$this->update_transaction_id( $transaction_id, $parent_order, $this->logger );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@ namespace WooCommerce\PayPalCommerce\Webhooks\Handler;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
use WooCommerce\PayPalCommerce\WcGateway\Processor\RefundMetaTrait;
|
use WooCommerce\PayPalCommerce\WcGateway\Processor\RefundMetaTrait;
|
||||||
use WooCommerce\PayPalCommerce\WcGateway\Processor\TransactionIdHandlingTrait;
|
use WooCommerce\PayPalCommerce\WcGateway\Processor\TransactionIdHandlingTrait;
|
||||||
|
use WP_Error;
|
||||||
use WP_REST_Request;
|
use WP_REST_Request;
|
||||||
use WP_REST_Response;
|
use WP_REST_Response;
|
||||||
|
|
||||||
|
@ -100,7 +101,7 @@ class PaymentSaleRefunded implements RequestHandler {
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
if ( is_wp_error( $refund ) ) {
|
if ( $refund instanceof WP_Error ) {
|
||||||
$this->logger->warning(
|
$this->logger->warning(
|
||||||
sprintf(
|
sprintf(
|
||||||
// translators: %s is the order id.
|
// translators: %s is the order id.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue