/** * When setting shortcode */ protected function setShortcodeAttribute($value) { // Extract numerics only $shortcode = Utilities::extractNumerics($value); // If shortcode doesn't begin with 29290 if (substr($shortcode, 0, 5) != '29290') { // Throw error throw new InvalidConfig('Shortcode must start with `29290`. `' . $shortcode . '` is given'); } // Set shortcode return $shortcode; }
/** * Cleanup number */ protected function cleanAmount($amount) { // Extract amount return (double) Utilities::extractNumerics($amount, ['.']); }