After creating a payment request and upload all necessary files you can create the payment.
Endpoint
POST /api/Payment/DeliveryPayment
Request
URI Parameters
Name | Type | Additional information |
---|---|---|
paymentRequestId | globally unique identifier | PaymentRequesId Id from "Create Payment Request" |
Response
Name | Type | Additional information |
---|---|---|
paymentView | object | Payment object with all payment data |
Details | object array[] | Show errors list if the payment failed |
Status | boolean | Show status of request |
Example Request
public async Task<object> DeliveryPayment(string access_token, Guid paymentRequestId)
{
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>
{
{ "paymentRequestId", paymentRequestId.ToString() },
};
var dictFormUrlEncoded = new FormUrlEncodedContent(queryParameters);
var queryString = await dictFormUrlEncoded.ReadAsStringAsync();
var url = root + "/api/Payment/DeliveryPayment";
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": "Payment created successfully",
"details": []
}