public/wordpress/wp-content/plugins/wp-courseware/includes/gateways/gateway-stripe.php
/**
	 * Format Balance Fee.
	 *
	 * Stripe uses smallest denomination in currencies such as cents.
	 * We need to format the returned currency from Stripe into human readable form.
	 * The amount is not used in any calculations so returning string is sufficient.
	 *
	 * @since 4.3.0
	 *
	 * @param object $balance_transaction
	 * @param string $type
	 *
	 * @return string|void
	 */
Format Balance Fee.
Stripe uses smallest denomination in currencies such as cents.
We need to format the returned currency from Stripe into human readable form.
The amount is not used in any calculations so returning string is sufficient.



@param object $balance_transaction
@param string $type

@return string|void
Format Balance Fee . Stripe uses smallest denomination in currencies such as cents . We need to format the returned currency from Stripe into human readable form . The amount is not used in any calculations so returning string is sufficient . @param object $balance_transaction @param string $type @return string|void
public function format_balance_fee( $balance_transaction, $type = 'fee' ) {
		if ( ! is_object( $balance_transaction ) ) {
			return;
		}
		if ( in_array( strtolower( $balance_transaction->currency ), $this->get_no_decimal_currencies() ) ) {
			if ( 'fee' === $type ) {
				return $balance_transaction->fee;
			}
			if ( 'amount' === $type ) {
				return $balance_transaction->amount;
			}
			return $balance_transaction->net;
		}
		if ( 'fee' === $type ) {
			return number_format( $balance_transaction->fee / 100, 2, '.', '' );
		}
		if ( 'amount' === $type ) {
			return number_format( $balance_transaction->amount / 100, 2, '.', '' );
		}
		return number_format( $balance_transaction->net / 100, 2, '.', '' );
	}
public function format_balance_fee ( $ balance_transaction , $ type = 'fee' ) { if ( ! is_object ( $ balance_transaction ) ) { return ; } if ( in_array ( strtolower ( $ balance_transaction -> currency ) , $ this -> get_no_decimal_currencies ( ) ) ) { if ( 'fee' === $ type ) { return $ balance_transaction -> fee ; } if ( 'amount' === $ type ) { return $ balance_transaction -> amount ; } return $ balance_transaction -> net ; } if ( 'fee' === $ type ) { return number_format ( $ balance_transaction -> fee / 100 , 2 , '.' , '' ) ; } if ( 'amount' === $ type ) { return number_format ( $ balance_transaction -> amount / 100 , 2 , '.' , '' ) ; } return number_format ( $ balance_transaction -> net / 100 , 2 , '.' , '' ) ; }
Format Balance Fee.
Format Balance Fee .