Are we talking about a new bike? Or a used, as is kind of deal?
Confirm that you have a good connection from the battery to the charger. Assuming the battery has some volts, after you plug in the charger, you should be able to detect that battery voltage on the wires where they are soldered to the board in the charger.
Of course, this requires opening the case of the charger. If you have battery voltage at the charger, then your wires and connectors are good. A wire defect is that common, so eliminate that possiblily.
Go to the dealer as Neil advised, if he is in your town.
What kind of battery? Lead, or lithium. You could have a bms issue if lithium. If lead, bad connections at the battery termianls are notoriously common.
If it's lead, those lead chargers are incredibly cheap on ebay. And have incredibly high failure rate. Since a spare charger is really smart to have, you might consider just buying a spare, and if it works, then ram the old charger down that dealers throat for a refund or replacement.
What is the voltage of this battery? I mean, measure it, and tell us what it is, and what it's supposed to be. Some chargers will not turn on if a battery is too low voltage for safe charging.