{
public int ErrorCode { get; set; }
public string ErrorText { get; set; }
public decimal Amount { get; set; }
public Guid TransactionId { get; set; }
}
public async Task
string apiKey, string vivaWalletToken)
{
var cl = new RestClient("http://demo.vivapayments.com/api/") {
Authenticator = new HttpBasicAuthenticator(merchantId, apiKey)
};
var request = new RestRequest("transactions", Method.POST) {
RequestFormat = DataFormat.Json
};
request.AddParameter("PaymentToken", vivaWalletToken);
var response = await cl.ExecuteTaskAsync
return response.ResponseStatus == ResponseStatus.Completed &&
response.StatusCode == System.Net.HttpStatusCode.OK ? response.Data : null;
}