This commit is contained in:
parent
33c68c2f44
commit
749f525f83
44 changed files with 5380 additions and 3532 deletions
|
|
@ -269,12 +269,9 @@ private:
|
|||
|
||||
} // namespace
|
||||
|
||||
// The roster has one home, here; the CoinGate constructor is declared by its
|
||||
// own unit. An unrecognised mode is "off" rather than an error, and the caller
|
||||
// (main) is what refuses to start on a mode it did not expect — a rail that
|
||||
// silently half-exists would be worse than either.
|
||||
std::unique_ptr<PaymentRail> MakeCoingateRail(const RailConfig& config);
|
||||
|
||||
// The roster has one home, here. An unrecognised mode is "off" rather than an
|
||||
// error, and the caller (main) is what refuses to start on a mode it did not
|
||||
// expect — a rail that silently half-exists would be worse than either.
|
||||
std::unique_ptr<PaymentRail> MakeRail(const RailConfig& config) {
|
||||
// The fake rail keeps the slot's own name so the ledger, the startup line
|
||||
// and the logs still say which half of the checkout ran in a test.
|
||||
|
|
@ -284,8 +281,12 @@ std::unique_ptr<PaymentRail> MakeRail(const RailConfig& config) {
|
|||
if (config.mode == "fake-crypto") {
|
||||
return std::make_unique<FakeRail>(config.statePath, "fake-crypto");
|
||||
}
|
||||
if (config.mode == "mollie") return std::make_unique<MollieRail>(config);
|
||||
if (config.mode == "coingate") return MakeCoingateRail(config);
|
||||
if (config.mode == "mollie") return std::make_unique<MollieRail>(config);
|
||||
// "eurc" is the one mode that can fail to construct for a reason other than
|
||||
// a typo: its chains file or address pool may not load. It returns nullptr
|
||||
// there, which main reports as an unknown rail — see the note in main about
|
||||
// why that message names the files.
|
||||
if (config.mode == "eurc") return MakeEurcRail(config);
|
||||
return nullptr; // "off"
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue