forked from benlcollins/apps_script_apis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcode.gs
46 lines (39 loc) · 1.07 KB
/
code.gs
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Ejunkie can send an HTTP POST data to a common notification url
// Apps Script can receive the POST request and output data to sheet
// Read more here: http://www.e-junkie.com/ej/help.integration.htm
function doPost(e) {
var ss= SpreadsheetApp.openById("<Sheet ID>");
var sheet = ss.getSheetByName("Sheet1");
var outputArray = [];
if(typeof e !== 'undefined') {
var data = e.parameter;
outputArray.push(
data.ej_txn_id,
data.invoice,
data.payment_date,
data.item_name,
data.from_email,
data.receiver_email,
data.discount_codes,
data.mc_gross,
data.payment_type,
data.payer_id,
data.payer_email,
data.first_name,
data.last_name,
data.residence_country,
data.payer_status,
data.payment_status,
data.payment_gross,
data.buyer_ip,
data.affiliate_id,
data.item_affiliate_fee_total,
data.receiver_id,
data.mc_currency,
data.payer_business_name,
data.payment_fee
);
sheet.appendRow(outputArray);
}
return;
}