forked from jbillimoria/JavaScriptButtons
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathform.js
More file actions
31 lines (20 loc) · 704 Bytes
/
Copy pathform.js
File metadata and controls
31 lines (20 loc) · 704 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
'use strict';
var constants = require('./constants'),
template = require('./util/template'),
button = require('./button');
module.exports = function form(type, data, config) {
var model, btn, url, locale, target;
btn = button(type, data, config);
locale = data.get('lc') || constants.DEFAULT_LOCALE;
url = constants.PAYPAL_URL;
url = url.replace('{host}', config.host || constants.DEFAULT_HOST);
target = config.target || constants.DEFAULT_TARGET
model = {
data: data.items,
button: btn,
url: url,
content: constants.STRINGS[locale],
target: target
};
return template(constants.TEMPLATES.form, model);
};