Submit a batch of donations to the service. The server matches the batch against the campaign's rulesets and returns every train that changed as a result — new trains it just created, plus existing trains whose window was extended.
Unwraps the { data: DonationTrain[] } envelope.
{ data: DonationTrain[] }
ProcessDonationsForTrainsParams.
Promise resolving to the trains updated by this batch.
Error when donationTrainApiUrl isn't configured, or when the response is non-2xx.
donationTrainApiUrl
const updated = await processDonationsForTrains({ donations }); Copy
const updated = await processDonationsForTrains({ donations });
ProcessDonationsForTrainsParams
Submit a batch of donations to the service. The server matches the batch against the campaign's rulesets and returns every train that changed as a result — new trains it just created, plus existing trains whose window was extended.
Unwraps the
{ data: DonationTrain[] }envelope.