Function Hook_payment_gateway_authorize->get_transaction_fee

Definitions

sources/hooks/systems/payment_gateway/authorize.php

  • Calculate the transaction fee for this payment gateway in the currency of the store.This is only used if the payment gateway does not return the fee and transaction fee config options are not set.
  • 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 float No No required parameter N/A N/A The total transaction amount
$type_code ID_TEXT No No required parameter N/A N/A The transaction type code

Returns

  • The fee
  • Type: float
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Calculate the transaction fee for this payment gateway in the currency of the store.This is only used if the payment gateway does not return the fee and transaction fee config options are not set.
 *
 * @param  float $amount The total transaction amount
 * @param  ID_TEXT $type_code The transaction type code
 * @return float The fee
 */

public function get_transaction_fee(float $amount, string $type_code) : float