Before Create Payment, you need to create a payment request with Beneficiary id from beneficiaries list.
Endpoints
POST /api/Payment/CreatePaymentRequest
Request
URI Parameters
Name | Type | Additional information |
---|---|---|
beneficiaryId | globally unique identifier | Beneficiary id from beneficiaries list |
amount | decimal number | The amount you want to send it's depended on beneficiary currency |
costType | int | Cost Type Key CostList from "Create Quote Response" 1-Regular, 2-Our |
Response
Name | Type | Additional information |
---|---|---|
PaymentRequesId | globally unique identifier | None. |
Amount | decimal number | Send amount to beneficiary |
CostType | int | Cost Type you Chosen |
CostAmount | decimal number | Cost Amount for cost type |
NecessaryFiles | String array | All the necessary files that you need to upload |
Example Request
public async Task<object> CreatePaymentRequest(string access_token, Guid beneficeryId,decimal amount,int costType)
{
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>
{
{ "beneficiaryId", beneficeryId.ToString() },
{ "amount", amount.ToString() },
{ "costType", costType.ToString() },
};
var dictFormUrlEncoded = new FormUrlEncodedContent(queryParameters);
var queryString = await dictFormUrlEncoded.ReadAsStringAsync();
var url = "http://localhost:65405/api/Payment/CreatePaymentRequest";
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
{
"PaymentRequesId": "0ae84124-0000-4b1a-8836-b0e395ca28a6",
"Amount": 500.0,
"CostType": 2,
"CostAmount": 25.0,
"NecessaryFiles": [
"Sign File Needed for 'Green route declaration'.",
"Stamp file exist but if you have new one you need to upload the file.",
"Upload a transaction invoice file."
]
}