company_gateway->getConfigField('publicApiKey'); } public function convertToCheckoutAmount($amount, $currency) { $cases = [ 'option_1' => ['BIF', 'DJF', 'GNF', 'ISK', 'KMF', 'XAF', 'CLF', 'XPF', 'JPY', 'PYG', 'RWF', 'KRW', 'VUV', 'VND', 'XOF'], 'option_2' => ['BHD', 'IQD', 'JOD', 'KWD', 'LYD', 'OMR', 'TND'], ]; // https://docs.checkout.com/resources/calculating-the-value#Calculatingthevalue-Option1:Thefullvaluefullvalue if (in_array($currency, $cases['option_1'])) { return round($amount); } // https://docs.checkout.com/resources/calculating-the-value#Calculatingthevalue-Option2:Thevaluedividedby1000valuediv1000 if (in_array($currency, $cases['option_2'])) { return round($amount * 1000); } // https://docs.checkout.com/resources/calculating-the-value#Calculatingthevalue-Option3:Thevaluedividedby100valuediv100 return round($amount * 100); } }