mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Fix psalm
This commit is contained in:
parent
ccb528ba2a
commit
bf05e08ed4
1 changed files with 7 additions and 1 deletions
|
@ -9,6 +9,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace WooCommerce\PayPalCommerce\ApiClient\Factory;
|
||||
|
||||
use WC_Product;
|
||||
use WooCommerce\PayPalCommerce\ApiClient\Entity\Item;
|
||||
use WooCommerce\PayPalCommerce\ApiClient\Entity\Money;
|
||||
use WooCommerce\PayPalCommerce\ApiClient\Exception\RuntimeException;
|
||||
|
@ -124,8 +125,13 @@ class ItemFactory {
|
|||
* @return Item
|
||||
*/
|
||||
private function from_wc_order_line_item( \WC_Order_Item_Product $item, \WC_Order $order ): Item {
|
||||
$currency = $order->get_currency();
|
||||
/**
|
||||
* The WooCommerce product.
|
||||
*
|
||||
* @var WC_Product $product
|
||||
*/
|
||||
$product = $item->get_product();
|
||||
$currency = $order->get_currency();
|
||||
$shipping_tax = round( (float) $order->get_shipping_tax(), 2 );
|
||||
$quantity = (int) $item->get_quantity();
|
||||
$price = (float) $order->get_item_subtotal( $item, true );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue