-
Notifications
You must be signed in to change notification settings - Fork 2
/
bear.js
84 lines (83 loc) · 9.95 KB
/
bear.js
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*
^https:\/\/buy\.itunes\.apple\.com\/verifyReceipt url script-response-body JS/bear.js
buy.itunes.apple.com
*/
var obj = JSON.parse($response.body);
var bundle_id = obj.receipt["bundle_id"];
if (bundle_id == "net.shinyfrog.bear-iOS") {
obj = {
status: 0,
environment: "Production",
receipt: {
receipt_type: "Production",
adam_id: 1016366447,
app_item_id: 1016366447,
bundle_id: "net.shinyfrog.bear-iOS",
application_version: "7133",
download_id: 92018757521008,
version_external_identifier: 831147846,
receipt_creation_date: "2019-08-10 23:17:58 Etc/GMT",
receipt_creation_date_ms: "1565479078000",
receipt_creation_date_pst: "2019-08-10 16:17:58 America/Los_Angeles",
request_date: "2019-08-10 23:18:04 Etc/GMT",
request_date_ms: "1565479084140",
request_date_pst: "2019-08-10 16:18:04 America/Los_Angeles",
original_purchase_date: "2016-11-05 07:20:24 Etc/GMT",
original_purchase_date_ms: "1478330424000",
original_purchase_date_pst: "2016-11-05 00:20:24 America/Los_Angeles",
original_application_version: "3562",
in_app: [
{
quantity: "1",
product_id: "net.shinyfrog.bear_iOS.pro_yearly_subscription_bis",
transaction_id: "520000469131745",
original_transaction_id: "520000469131745",
purchase_date: "2019-08-10 23:17:57 Etc/GMT",
purchase_date_ms: "1565479077000",
purchase_date_pst: "2019-08-10 16:17:57 America/Los_Angeles",
original_purchase_date: "2019-08-10 23:17:57 Etc/GMT",
original_purchase_date_ms: "1565479077000",
original_purchase_date_pst: "2019-08-10 16:17:57 America/Los_Angeles",
expires_date: "2099-09-10 23:17:57 Etc/GMT",
expires_date_ms: "4092736677000",
expires_date_pst: "2099-09-10 16:17:57 America/Los_Angeles",
web_order_line_item_id: "520000150747696",
is_trial_period: "true",
is_in_intro_offer_period: "false"
}
]
},
latest_receipt_info: [
{
quantity: "1",
product_id: "net.shinyfrog.bear_iOS.pro_yearly_subscription_bis",
transaction_id: "520000469131745",
original_transaction_id: "520000469131745",
purchase_date: "2019-08-10 23:17:57 Etc/GMT",
purchase_date_ms: "1565479077000",
purchase_date_pst: "2019-08-10 16:17:57 America/Los_Angeles",
original_purchase_date: "2019-08-10 23:17:57 Etc/GMT",
original_purchase_date_ms: "1565479077000",
original_purchase_date_pst: "2019-08-10 16:17:57 America/Los_Angeles",
expires_date: "2099-09-10 23:17:57 Etc/GMT",
expires_date_ms: "4092736677000",
expires_date_pst: "2099-09-10 16:17:57 America/Los_Angeles",
web_order_line_item_id: "520000150747696",
is_trial_period: "true",
is_in_intro_offer_period: "false"
}
],
latest_receipt:
"MIIUGAYJKoZIhvcNAQcCoIIUCTCCFAUCAQExCzAJBgUrDgMCGgUAMIIDuQYJKoZIhvcNAQcBoIIDqgSCA6YxggOiMAoCARQCAQEEAgwAMAsCARkCAQEEAwIBAzAMAgEKAgEBBAQWAjQrMAwCAQ4CAQEEBAICAMIwDQIBCwIBAQQFAgMTL50wDQIBDQIBAQQFAgMB1MEwDgIBAQIBAQQGAgQ8lIVvMA4CAQMCAQEEBgwENzEzMzAOAgEJAgEBBAYCBFAyNTMwDgIBEAIBAQQGAgQxik9GMA4CARMCAQEEBgwEMzU2MjAQAgEPAgEBBAgCBlOwyVrOcDAUAgEAAgEBBAwMClByb2R1Y3Rpb24wGAIBBAIBAgQQoAVFe9D7gtBndiwGNLstWDAcAgEFAgEBBBS69dQhR4e35beLaTsq+zo0KfidCzAeAgEIAgEBBBYWFDIwMTktMDgtMTBUMjM6MTc6NThaMB4CAQwCAQEEFhYUMjAxOS0wOC0xMFQyMzoxODowNFowHgIBEgIBAQQWFhQyMDE2LTExLTA1VDA3OjIwOjI0WjAgAgECAgE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EBAFw2mUwteLftjJvc83eb8nbSdzBPwR+Fg4UbmT1HN/Kpm0COLNSxkBLYvvRzm+7SZA/LeU802KI++Xj/a8gH7H05g4tTINM4xLG/mk8Ka/8r/FmnBQl8F0BWER5007eLIztHo9VvJOLr0bdw3w9F4SfK8W147ee1Fxeo3H4iNcol1dkP1mvUoiQjEfehrI9zgWDGG1sJL5Ky+ERI8GA4nhX1PSZnIIozavcNgs/e66Mv+VNqW2TAYzN39zoHLFbr2g8hDtq6cxlPtdk2f8GHVdmnmbkyQvvY1XGefqFStxu9k0IkEirHDx22TZxeY8hLgBdQqorV2uT80AkHN7B1dSExggHLMIIBxwIBATCBozCBljELMAkGA1UEBhMCVVMxEzARBgNVBAoMCkFwcGxlIEluYy4xLDAqBgNVBAsMI0FwcGxlIFdvcmxkd2lkZSBEZXZlbG9wZXIgUmVsYXRpb25zMUQwQgYDVQQDDDtBcHBsZSBXb3JsZHdpZGUgRGV2ZWxvcGVyIFJlbGF0aW9ucyBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eQIIDutXh+eeCY0wCQYFKw4DAhoFADANBgkqhkiG9w0BAQEFAASCAQAGnds5bKgzAn+4Vl3DYVVef5HBJrzS9hEJJFYWAhBa45+TLoWfPKVU6moQImllWPuJrtFZmpFt1bvIGdCR/70uMXuhpuxsWHKgV//L29OVT43shzlcODLOrEvht24BeaRKn0SR2AvjjCX34v9MZ05gV0KiQZhEPYykUbmNqShJMO7UsXcKRXENChmYFdOHKvjMvABxUZX05khgXWzUPFjoglSkjf18l+GidU16b1g6ukbGAOl5dEaxWOUatmVb+hpfQy5GWUp1xubN1HfWYv2sNcZA04JHeIGqJfJKGjcUKkP93XfheQYzINGUDQU/DjKa5tJKsvEG2i/d2qrmWBEI",
pending_renewal_info: [
{
auto_renew_product_id:
"net.shinyfrog.bear_iOS.pro_yearly_subscription_bis",
original_transaction_id: "520000469131745",
product_id: "net.shinyfrog.bear_iOS.pro_yearly_subscription_bis",
auto_renew_status: "1"
}
]
};
}
$done({body:JSON.stringify(obj)});