mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-08 21:52:55 +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;
|
namespace WooCommerce\PayPalCommerce\ApiClient\Factory;
|
||||||
|
|
||||||
|
use WC_Product;
|
||||||
use WooCommerce\PayPalCommerce\ApiClient\Entity\Item;
|
use WooCommerce\PayPalCommerce\ApiClient\Entity\Item;
|
||||||
use WooCommerce\PayPalCommerce\ApiClient\Entity\Money;
|
use WooCommerce\PayPalCommerce\ApiClient\Entity\Money;
|
||||||
use WooCommerce\PayPalCommerce\ApiClient\Exception\RuntimeException;
|
use WooCommerce\PayPalCommerce\ApiClient\Exception\RuntimeException;
|
||||||
|
@ -124,8 +125,13 @@ class ItemFactory {
|
||||||
* @return Item
|
* @return Item
|
||||||
*/
|
*/
|
||||||
private function from_wc_order_line_item( \WC_Order_Item_Product $item, \WC_Order $order ): 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();
|
$product = $item->get_product();
|
||||||
|
$currency = $order->get_currency();
|
||||||
$shipping_tax = round( (float) $order->get_shipping_tax(), 2 );
|
$shipping_tax = round( (float) $order->get_shipping_tax(), 2 );
|
||||||
$quantity = (int) $item->get_quantity();
|
$quantity = (int) $item->get_quantity();
|
||||||
$price = (float) $order->get_item_subtotal( $item, true );
|
$price = (float) $order->get_item_subtotal( $item, true );
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue