Function __global->get_transaction_fee
Definitions
sources/ecommerce.php
- Find a transaction fee from a transaction amount. Regular fees aren't taken into account.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: float
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $amount | REAL | No | No | required parameter | N/A | N/A | A total transaction amount |
| $type_code | ID_TEXT | No | No | required parameter | N/A | N/A | A transaction type code |
| $payment_gateway | ID_TEXT | No | No | required parameter | N/A | N/A | The payment gateway the payment went via |
| $fail_ok | boolean | No | No | False | N/A | N/A | Return 0.00 if an error occurred instead of exiting |
Returns
- The fee
- Type: REAL
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Find a transaction fee from a transaction amount. Regular fees aren't taken into account.
*
* @param REAL $amount A total transaction amount
* @param ID_TEXT $type_code A transaction type code
* @param ID_TEXT $payment_gateway The payment gateway the payment went via
* @param boolean $fail_ok Return 0.00 if an error occurred instead of exiting
* @return REAL The fee
*/
function get_transaction_fee(float $amount, string $type_code, string $payment_gateway, bool $fail_ok = false) : float
* Find a transaction fee from a transaction amount. Regular fees aren't taken into account.
*
* @param REAL $amount A total transaction amount
* @param ID_TEXT $type_code A transaction type code
* @param ID_TEXT $payment_gateway The payment gateway the payment went via
* @param boolean $fail_ok Return 0.00 if an error occurred instead of exiting
* @return REAL The fee
*/
function get_transaction_fee(float $amount, string $type_code, string $payment_gateway, bool $fail_ok = false) : float
