bound_payment_id ) && 0 > $this->gross ); } /** * Checks if the payment was migrated from another platform. * * @author Vova Feldman (@svovaf) * @since 2.0.2 * * @return bool */ function is_migrated() { return ( 0 != $this->source ); } /** * Returns the gross in this format: * `{symbol}{amount | 2 decimal digits} {currency | uppercase}` * * Examples: £9.99 GBP, -£9.99 GBP. * * @author Leo Fajardo (@leorw) * @since 2.3.0 * * @return string */ function formatted_gross() { return ( ( $this->gross < 0 ? '-' : '' ) . $this->get_symbol() . number_format( abs( $this->gross ), 2, '.', ',' ) . ' ' . strtoupper( $this->currency ) ); } /** * A map between supported currencies with their symbols. * * @var array */ static $CURRENCY_2_SYMBOL; /** * @author Leo Fajardo (@leorw) * @since 2.3.0 * * @return string */ private function get_symbol() { if ( ! isset( self::$CURRENCY_2_SYMBOL ) ) { // Lazy load. self::$CURRENCY_2_SYMBOL = array( self::CURRENCY_USD => '$', self::CURRENCY_GBP => '£', self::CURRENCY_EUR => '€', ); } return self::$CURRENCY_2_SYMBOL[ $this->currency ]; } }