-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathendpoints.go
More file actions
71 lines (68 loc) · 2.84 KB
/
Copy pathendpoints.go
File metadata and controls
71 lines (68 loc) · 2.84 KB
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
package edeka
// offersEndpoints holds the REST URLs for the offers API. Grouped separately
// from the SOAP mappers because they carry no template/action and follow a
// different auth model (bearer token via client_credentials).
type offersEndpoints struct {
tokenURL string
dataURL string
}
// endpoints bundles every per-request URL/template the library hits. Instance-
// scoped so tests can swap URLs without mutating package globals.
type endpoints struct {
registerAnonymously templateActionMapper
checkin templateActionMapper
bearerLogin templateActionMapper
checkRegistration templateActionMapper
getReceipts templateActionMapper
getReceipt templateActionMapper
findMarkets templateActionMapper
offers offersEndpoints
}
var defaultEndpoints = endpoints{
registerAnonymously: templateActionMapper{
name: "RegisterAnonymously",
template: mustParseTemplate("RegisterAnonymously", registerAnonTemplate),
action: "registerMobileApplicationForAnonymousUser",
baseURL: "https://www.myvaluephone.com/vpserver/ws/mobile/OpenMobileDeviceRegistrationManager",
},
checkin: templateActionMapper{
name: "Checkin",
template: mustParseTemplate("Checkin", checkinTemplate),
action: "notifyPostLogin",
baseURL: "https://www.myvaluephone.com/vpserver/ws/mobile/MobileUserManager",
},
bearerLogin: templateActionMapper{
name: "BearerLogin",
template: mustParseTemplate("BearerLogin", bearerToLoginTemplate),
action: "login",
baseURL: "https://www.myvaluephone.com/vpserver/ws/mobile/MobileSSOServiceManager",
},
checkRegistration: templateActionMapper{
name: "CheckRegistration",
template: mustParseTemplate("CheckRegistration", checkRegistrationTemplate),
action: "checkMobileApplicationRegistrationLogin",
baseURL: "https://www.myvaluephone.com/vpserver/ws/mobile/OpenMobileDeviceRegistrationManager",
},
getReceipts: templateActionMapper{
name: "GetReceipts",
template: mustParseTemplate("GetReceipts", getReceiptsTemplate),
action: "getAllReceiptsByApp",
baseURL: "https://www.myvaluephone.com/vpserver/ws/mobile/MobileReceiptServiceManager",
},
getReceipt: templateActionMapper{
name: "GetReceipt",
template: mustParseTemplate("GetReceipt", getReceiptTemplate),
action: "getFormattedReceipt",
baseURL: "https://www.myvaluephone.com/vpserver/ws/mobile/MobileReceiptServiceManager",
},
findMarkets: templateActionMapper{
name: "FindMarkets",
template: mustParseTemplate("FindMarkets", findMarketsTemplate),
action: "findRetailerShopsMultipleCountries",
baseURL: "https://www.myvaluephone.com/vpserver/ws/mobile/MobileRetailerServiceManager",
},
offers: offersEndpoints{
tokenURL: "https://b2b-login.api.edeka/auth/realms/b2b/protocol/openid-connect/token",
dataURL: "https://b2c-gw.api.edeka/v2/offers/mobile",
},
}