mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Ensure pay for order total is valid for pui
This commit is contained in:
parent
6ed616802d
commit
676f4a7a10
1 changed files with 5 additions and 0 deletions
|
@ -113,6 +113,11 @@ class PayUponInvoiceHelper {
|
|||
$order_id = absint( $wp->query_vars['order-pay'] );
|
||||
$order = wc_get_order( $order_id );
|
||||
if ( is_a( $order, WC_Order::class ) ) {
|
||||
$order_total = (float) $order->get_total();
|
||||
if ( $order_total < 5 || $order_total > 2500 ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach ( $order->get_items() as $item_id => $item ) {
|
||||
if ( is_a( $item, WC_Order_Item_Product::class ) ) {
|
||||
$product = wc_get_product( $item->get_product_id() );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue