Function __global->paid_amount_matches
Definitions
sources/ecommerce.php
- See if the transaction is for the correct amount.We cannot check for transaction fee because we cannot reliably predict it.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: bool
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $price | REAL | No | No | required parameter | N/A | N/A | Transaction price (this should exclude tax, shipping, and fees) |
| $tax | REAL | No | No | required parameter | N/A | N/A | Transaction tax amount |
| $shipping | REAL | No | No | required parameter | N/A | N/A | Transaction shipping amount |
| $expected_price | REAL | No | No | required parameter | N/A | N/A | Transaction price expected (this should exclude tax and shipping) |
| $expected_tax | REAL | No | No | required parameter | N/A | N/A | Transaction tax amount expected |
| $expected_shipping | REAL | No | No | required parameter | N/A | N/A | Transaction shipping amount expected |
Returns
- Whether it is
- Type: boolean
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* See if the transaction is for the correct amount.We cannot check for transaction fee because we cannot reliably predict it.
*
* @param REAL $price Transaction price (this should exclude tax, shipping, and fees)
* @param REAL $tax Transaction tax amount
* @param REAL $shipping Transaction shipping amount
* @param REAL $expected_price Transaction price expected (this should exclude tax and shipping)
* @param REAL $expected_tax Transaction tax amount expected
* @param REAL $expected_shipping Transaction shipping amount expected
* @return boolean Whether it is
*/
function paid_amount_matches(float $price, float $tax, float $shipping, float $expected_price, float $expected_tax, float $expected_shipping) : bool
* See if the transaction is for the correct amount.We cannot check for transaction fee because we cannot reliably predict it.
*
* @param REAL $price Transaction price (this should exclude tax, shipping, and fees)
* @param REAL $tax Transaction tax amount
* @param REAL $shipping Transaction shipping amount
* @param REAL $expected_price Transaction price expected (this should exclude tax and shipping)
* @param REAL $expected_tax Transaction tax amount expected
* @param REAL $expected_shipping Transaction shipping amount expected
* @return boolean Whether it is
*/
function paid_amount_matches(float $price, float $tax, float $shipping, float $expected_price, float $expected_tax, float $expected_shipping) : bool

