JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr{ gilour

File "FormatsMoney.php"

Full Path: /home/markqprx/iniasli.pro/common-20260222054824/Billing/Gateways/Stripe/FormatsMoney.php
File size: 701 bytes
MIME-type: text/x-php
Charset: utf-8

<?php

namespace Common\Billing\Gateways\Stripe;

use Common\Billing\Models\Price;
use Money\Currencies\ISOCurrencies;
use Money\Currency;
use Money\Parser\IntlLocalizedDecimalParser;
use NumberFormatter;

trait FormatsMoney
{
    protected function priceToCents(Price $price): string
    {
        $currencies = new ISOCurrencies();
        $numberFormatter = new NumberFormatter('en', NumberFormatter::DECIMAL);
        $moneyParser = new IntlLocalizedDecimalParser(
            $numberFormatter,
            $currencies,
        );
        $money = $moneyParser->parse(
            $price->amount,
            new Currency($price->currency),
        );

        return $money->getAmount();
    }
}