-
Notifications
You must be signed in to change notification settings - Fork 57
/
BasePayPalService.cs
55 lines (47 loc) · 1.38 KB
/
BasePayPalService.cs
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
namespace PayPal
{
public abstract class BasePayPalService
{
private string accessToken;
private string accessTokenSecret;
private string lastRequest;
private string lastResponse;
public BasePayPalService() { }
public void setAccessToken(string accessToken)
{
this.accessToken = accessToken;
}
public void setAccessTokenSecret(string accessTokenSecret)
{
this.accessTokenSecret = accessTokenSecret;
}
public string getAccessToken()
{
return this.accessToken;
}
public string getAccessTokenSecret()
{
return this.accessTokenSecret;
}
public string getLastRequest()
{
return this.lastRequest;
}
public string getLastResponse()
{
return this.lastResponse;
}
/// <summary>
/// Call method exposed to user
/// </summary>
/// <param name="apiCallHandler"></param>
/// <returns></returns>
public string Call(IAPICallPreHandler apiCallHandler)
{
APIService apiServ = new APIService();
this.lastRequest = apiCallHandler.GetPayLoad();
this.lastResponse = apiServ.MakeRequestUsing(apiCallHandler);
return this.lastResponse;
}
}
}