-
Notifications
You must be signed in to change notification settings - Fork 1
/
IPaymentGateway.cs
125 lines (89 loc) · 5.94 KB
/
IPaymentGateway.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
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
using System.Collections.Generic;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Threading.Tasks;
namespace Plexo
{
[ServiceContract]
public interface IPaymentGateway
{
#region Operations
[OperationContract]
[WebInvoke(UriTemplate = "Auth", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, Method = "POST")]
Task<ServerResponse<Session>> Authorize(Authorization authorization);
[OperationContract]
[WebInvoke(UriTemplate = "Operation/Purchase", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, Method = "POST")]
Task<ServerResponse<Transaction>> Purchase(PaymentRequest payment);
[OperationContract]
[WebInvoke(UriTemplate = "Operation/Cancel", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, Method = "POST")]
Task<ServerResponse<Transaction>> Cancel(CancelRequest payment);
[OperationContract]
[WebInvoke(UriTemplate = "Operation/Refund", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, Method = "POST")]
Task<ServerResponse<Transaction>> Refund(RefundRequest payment);
[OperationContract]
[WebInvoke(UriTemplate = "Operation/StartReserve", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, Method = "POST")]
Task<ServerResponse<Transaction>> StartReserve(ReserveRequest payment);
[OperationContract]
[WebInvoke(UriTemplate = "Operation/EndReserve", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, Method = "POST")]
Task<ServerResponse<Transaction>> EndReserve(Reserve reserve);
[OperationContract]
[WebInvoke(UriTemplate = "Operation/Status", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, Method = "POST")]
Task<ServerResponse<Transaction>> Status(Reference payment);
#endregion
#region Instruments
[OperationContract]
[WebInvoke(UriTemplate = "Instruments", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, Method = "POST")]
Task<ServerResponse<List<PaymentInstrument>>> GetInstruments(AuthorizationInfo info);
[OperationContract]
[WebInvoke(UriTemplate = "Instruments/Delete", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, Method = "POST")]
Task<ServerResponse> DeleteInstrument(DeleteInstrumentRequest info);
[OperationContract]
[WebInvoke(UriTemplate = "Instruments/Bank", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, Method = "POST")]
Task<ServerResponse<PaymentInstrument>> CreateBankInstrument(CreateBankInstrumentRequest request);
#endregion
#region Issuers
[OperationContract]
[WebGet(UriTemplate = "Issuer", ResponseFormat = WebMessageFormat.Json)]
Task<ServerResponse<List<IssuerInfo>>> GetSupportedIssuers();
#endregion
#region Commerces
[OperationContract]
[WebGet(UriTemplate = "Commerce", ResponseFormat = WebMessageFormat.Json)]
Task<ServerResponse<List<Commerce>>> GetCommerces();
[OperationContract]
[WebInvoke(UriTemplate = "Commerce/Add", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, Method = "POST")]
Task<ServerResponse<Commerce>> AddCommerce(CommerceRequest commerce);
[OperationContract]
[WebInvoke(UriTemplate = "Commerce/Modify", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, Method = "POST")]
Task<ServerResponse<Commerce>> ModifyCommerce(CommerceModifyRequest commerce);
[OperationContract]
[WebInvoke(UriTemplate = "Commerce/Delete", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, Method = "POST")]
Task<ServerResponse> DeleteCommerce(CommerceIdRequest commerce);
[OperationContract]
[WebInvoke(UriTemplate = "Commerce/SetDefault", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, Method = "POST")]
Task<ServerResponse> SetDefaultCommerce(CommerceIdRequest commerce);
[OperationContract]
[WebInvoke(UriTemplate = "Commerce/Issuer", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, Method = "POST")]
Task<ServerResponse<List<IssuerData>>> GetCommerceIssuers(CommerceIdRequest commerce);
[OperationContract]
[WebInvoke(UriTemplate = "Commerce/Issuer/Add", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, Method = "POST")]
Task<ServerResponse<IssuerData>> AddIssuerCommerce(IssuerData commerce);
[OperationContract]
[WebInvoke(UriTemplate = "Commerce/Issuer/Delete", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, Method = "POST")]
Task<ServerResponse> DeleteIssuerCommerce(CommerceIssuerIdRequest commerce);
#endregion
#region TransactionInfo
[OperationContract]
[WebInvoke(UriTemplate = "Transactions", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, Method = "POST")]
Task<ServerResponse<TransactionCursor>> ObtainTransactions(TransactionQuery query);
[OperationContract]
[WebInvoke(UriTemplate = "Transactions/CSV", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, Method = "POST")]
Task<ServerResponse<string>> ObtainCSVTransactions(TransactionQuery query);
#endregion
#region VerificationCodes
[OperationContract]
[WebInvoke(UriTemplate = "Code", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, Method = "POST")]
Task<ServerResponse<Transaction>> CodeAction(CodeRequest request);
#endregion
}
}