|
| 1 | +# CyberSource.Api.CaptureApi |
| 2 | + |
| 3 | +All URIs are relative to *https://apitest.cybersource.com* |
| 4 | + |
| 5 | +Method | HTTP request | Description |
| 6 | +------------- | ------------- | ------------- |
| 7 | +[**CapturePayment**](CaptureApi.md#capturepayment) | **POST** /pts/v2/payments/{id}/captures | Capture a Payment |
| 8 | + |
| 9 | + |
| 10 | +<a name="capturepayment"></a> |
| 11 | +# **CapturePayment** |
| 12 | +> PtsV2PaymentsCapturesPost201Response CapturePayment (CapturePaymentRequest capturePaymentRequest, string id) |
| 13 | +
|
| 14 | +Capture a Payment |
| 15 | + |
| 16 | +Include the payment ID in the POST request to capture the payment amount. |
| 17 | + |
| 18 | +### Example |
| 19 | +```csharp |
| 20 | +using System; |
| 21 | +using System.Diagnostics; |
| 22 | +using CyberSource.Api; |
| 23 | +using CyberSource.Client; |
| 24 | +using CyberSource.Model; |
| 25 | + |
| 26 | +namespace Example |
| 27 | +{ |
| 28 | + public class CapturePaymentExample |
| 29 | + { |
| 30 | + public void main() |
| 31 | + { |
| 32 | + var apiInstance = new CaptureApi(); |
| 33 | + var capturePaymentRequest = new CapturePaymentRequest(); // CapturePaymentRequest | |
| 34 | + var id = id_example; // string | The payment ID returned from a previous payment request. This ID links the capture to the payment. |
| 35 | +
|
| 36 | + try |
| 37 | + { |
| 38 | + // Capture a Payment |
| 39 | + PtsV2PaymentsCapturesPost201Response result = apiInstance.CapturePayment(capturePaymentRequest, id); |
| 40 | + Debug.WriteLine(result); |
| 41 | + } |
| 42 | + catch (Exception e) |
| 43 | + { |
| 44 | + Debug.Print("Exception when calling CaptureApi.CapturePayment: " + e.Message ); |
| 45 | + } |
| 46 | + } |
| 47 | + } |
| 48 | +} |
| 49 | +``` |
| 50 | + |
| 51 | +### Parameters |
| 52 | + |
| 53 | +Name | Type | Description | Notes |
| 54 | +------------- | ------------- | ------------- | ------------- |
| 55 | + **capturePaymentRequest** | [**CapturePaymentRequest**](CapturePaymentRequest.md)| | |
| 56 | + **id** | **string**| The payment ID returned from a previous payment request. This ID links the capture to the payment. | |
| 57 | + |
| 58 | +### Return type |
| 59 | + |
| 60 | +[**PtsV2PaymentsCapturesPost201Response**](PtsV2PaymentsCapturesPost201Response.md) |
| 61 | + |
| 62 | +### Authorization |
| 63 | + |
| 64 | +No authorization required |
| 65 | + |
| 66 | +### HTTP request headers |
| 67 | + |
| 68 | + - **Content-Type**: application/json;charset=utf-8 |
| 69 | + - **Accept**: application/json;charset=utf-8 |
| 70 | + |
| 71 | +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) |
| 72 | + |
0 commit comments