Before Payment need refresh quote
Endpoint
POST /api/Payment/RefreshQuote
Request
URI Parameters
Name | Type | Additional information |
---|---|---|
quoteId | globally unique identifier | Quote Id from "Create Quote Response" |
Response
Name | Type | Additional information |
---|---|---|
QuoteId | globally unique identifier | None |
Spot | decimal number | None |
Charge | string | Charge amount from your wallet |
Send | string | Send amount to beneficiary |
CostList | Collection of Pair of string [key] and decimal number [value] | Show cost you create, Empty if not choose yet |
NecessaryFiles | Collection of string | Return null |
Example Request
public async Task<object> RefreshQuote(string access_token, Guid quoteId)
{
using (var client = new HttpClient())
{
try
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
client.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", access_token);
var queryParameters = new Dictionary<string, string>
{
{ "quoteID", quoteId.ToString() },
};
var dictFormUrlEncoded = new FormUrlEncodedContent(queryParameters);
var queryString = await dictFormUrlEncoded.ReadAsStringAsync();
var url = root + "/api/Payment/RefreshQuote";
var response = client.PostAsync(url + $"?{queryString}", null).Result;
if (response.IsSuccessStatusCode)
{
string result = await response.Content.ReadAsStringAsync();
JObject jObject = JObject.Parse(result);
return jObject;
}
else return response.StatusCode;
}
catch (Exception e)
{
return "Exception: " + e.Message;
}
}
}
Example Response
{
"QuoteId": "8e08cc76-1111-4c51-bc7f-d56bd9fc0ae1",
"Spot": 3.66648,
"Charge": "183.32 ILS",
"Send": "50.0000 CHF",
"CostList": [
{
"Key": "2",
"Value": 87.22
}
],
"NecessaryFiles": null
}