forked from AuthorizeNet/accept-sample-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconversion.js
More file actions
31 lines (26 loc) · 767 Bytes
/
conversion.js
File metadata and controls
31 lines (26 loc) · 767 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
30
31
/**
* HTML Id's for conversion to pick values off the HTML page to send to the conversion tracker API
*
*/
var conversionHtmlIds = {
amount: 'amountPA',
submitButton: 'submitButton'
};
/**
* Initalize conversion.js
*
* When the page loads we should
*/
$(function () {
try {
// Make sure the Conversion namespace is available before we set anything up
if ('Conversion' in window) {
// Documentation Step 2 - Optional configuration to enable logging to developer console
Conversion.configure({ logging: { level: 'verbose' } });
} else {
console.error('Conversion namespace is not available. Please check the script Url.');
}
} catch (error) {
console.error('Conversion failed during startup', error);
}
});