Home / APIs / WC_Tests_Paypal_Gateway_Request::check_shipping_tax() – Check if the shipping tax is included in the total according to $shipping_tax_included.

You appear to be a bot. Output may be restricted

Description

Check if the shipping tax is included in the total according to $shipping_tax_included.

Usage

WC_Tests_Paypal_Gateway_Request::check_shipping_tax( $query_array, $shipping_tax_included );

Parameters

$query_array
( array ) required – Request URL parsed into associative array.
$shipping_tax_included
( bool ) required – Whether the shipping tax should be included or not.

Returns

void

Source

File name: woocommerce/tests/unit-tests/gateways/paypal/request.php


Lines: 1 to 13 of 13

  protected function check_shipping_tax( $query_array, $shipping_tax_included ) {
    $shipping_total = $this->order->get_shipping_total();
    if ( $shipping_tax_included ) {
      $shipping_total += $this->order->get_shipping_tax();
    }
    $epsilon = 0.01;
    $this->assertTrue(
      abs( $shipping_total - floatval( $query_array['shipping_1'] ) ) < $epsilon,
      'Shipping tax mismatch: shipping total=' . $shipping_total . ' vs request shipping=' . $query_array['shipping_1']
    );

  }
 

 View on GitHub View on Trac

Published: 28th May 2018 | Last updated: 11th January 2019

Information

Function name: WC_Tests_Paypal_Gateway_Request::check_shipping_tax
Class ref: WC_Tests_Paypal_Gateway_Request
Plugin ref: WooCommerce
Version: 3.6.0-dev
Sourcefile: tests/unit-tests/gateways/paypal/request.php
File ref: tests/unit-tests/gateways/paypal/request.php
Deprecated?: No
API Letters: G,P,R,T,W

  • Plugins
  • Themes
  • Shortcodes
  • APIs
  • Files
  • Hooks
  • Classes
  • Sites
  • Sitemap
  • Blog
WooCommerce a2z WooCommerce a2z
WooCommerce

Site:  woocommerce.wp-a2z.org
© Copyright WooCommerce a2z 2014-2019. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins