houdini/client/js/donations/create_offline.js
Bradley M. Kuhn fc77ee76d6 Relicense Javascript code in accordance with project's new license
The primary license of the project is changing to:
  AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later

The Additional Permission is designed to permit publicly distributed
Javascript code to be relicensed under LGPL-3.0-or-later, but not server-side
Javascript code.  As such, we've relicensed here static Javscript files under
LGPL-3.0-or-later, and those that run as part of build and/or server side
under AGPL-3.0-or-later.

Note that in future, Javascript files may be updated to be stronger copyleft
license with the Additional Permission, particularly if they adapted to run
on server side and/or turned into templates.  Of course, we'd seek public
discussion with the contributor community about such changes.

This commit is one of the many steps to relicense the entire codebase.

Documentation granting permission for this relicensing (from all past
contributors who hold copyrights) is on file with Software Freedom
Conservancy, Inc.
2018-03-25 15:10:40 -04:00

24 lines
653 B
JavaScript

// License: LGPL-3.0-or-later
var request = require('../common/super-agent-promise')
var format = require('../common/format')
module.exports = create_offsite_donation
function create_offsite_donation(data, ui) {
ui.start()
if(data.dollars) {
data.amount = format.dollarsToCents(data.dollars)
delete data.dollars
}
if(data.date) data.date = format.date.toStandard(data.date)
return request.post('/nonprofits/' + app.nonprofit_id + '/donations/create_offsite')
.send({donation: data}).perform()
.then(function(resp) {
ui.success(resp)
return resp
})
.catch(function(resp) {
ui.fail(resp)
throw new Error(resp)
})
}