For any convert request you have 15 second to approve because it's depended on spot rate. If the time is over, you will need to run this request.
Endpoints
POST /api/Payment/RefreshConvertRequest
Request
URI Parameters
Name | Type | Additional information |
---|---|---|
RequestId | globally unique identifier | ConvertRequesId from "Create Convert Request" |
Response
Name | Type | Additional information |
---|---|---|
Status | string | Show status of request |
RequestId | globally unique identifier | None. |
BuyAmount | decimal number | Buy amount |
ChargeAmount | decimal number | Charge amount |
Errors | String array | All the necessary files that you need to upload |
Example Request
public async Task<object> RefreshConvertRequest(string access_token, Guid RequestId)
{
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>
{
{ "RequestId", RequestId.ToString() },
};
var dictFormUrlEncoded = new FormUrlEncodedContent(queryParameters);
var queryString = await dictFormUrlEncoded.ReadAsStringAsync();
var url = root + "/api/Payment/RefreshConvertRequest";
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
{
"Status": "Refresh Convert Quote Successfully",
"convertRequest": {
"RequestId": "6287135b-ba0b-4c1d-8471-abd32433b6e0",
"BuyAmount": "100.00 EUR",
"ChargeAmount": "344.08 ILS",
"FinalQuote": "3.44084"
},
"Errors": null
}
Errors Index
Error Number | Description |
---|---|
607 | Request Not Found |
608 | Refresh Failed |
500 | Server error |
401 | Unauthorized (need to login) |
400 | Bad inputs |
404 | Url Request Not Found |