.. _/api/v2/capture/: /api/v2/capture ################################ .. contents:: :local: .. role:: ex .. role:: code Introduction ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Capture is initiated through :code:`HTTPS POST` request to the :ref:`URLs` and the :ref:`parameters` specified below. Use :ref:`SHA-1` for authentication. Capture may only be initiated when Preauth have final success status. See :ref:`statuses`. .. _api_v2_capture_request_url: API URLs ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. note:: | The path in API URL should not be hardcoded, as it may be changed in future. .. list-table:: :widths: 50, 50 :header-rows: 1 :class: longtable * - Integration - Production * - :ex:`https://sandbox.payneteasy.com/paynet/api/v2/capture/ENDPOINTID` - :ex:`https://gate.payneteasy.com/paynet/api/v2/capture/ENDPOINTID` * - :ex:`https://sandbox.payneteasy.com/paynet/api/v2/capture/group/ENDPOINTGROUPID` - :ex:`https://gate.payneteasy.com/paynet/api/v2/capture/group/ENDPOINTGROUPID` .. _api_v2_capture_request_parameters: Request Parameters ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. note:: | Request must have content-type=application/x-www-form-urlencoded. .. list-table:: :widths: 25, 75 :header-rows: 1 :class: longtable * - Request Parameter - Description * - :code:`login` - Connecting Party login name. * - :code:`client_orderid` - Connecting Party order identifier of the transaction for which the status is requested. * - :code:`orderid` - Order id assigned to the order by Payneteasy * - :code:`currency` - Currency the transaction is charged in (See: :ref:`Currency codes`). Sample values are: :ex:`USD` for US Dollar :ex:`EUR` for European Euro. This parameter may or may not be sent. * - :code:`amount` - Amount to be charged. The amount has to be specified in the highest units with :ex:`.` delimiter. For instance, :ex:`10.5` for USD means 10 US Dollars and 50 Cents. This parameter may or may not be sent. * - :code:`control` - | Checksum generated by :ref:`SHA-1`. Control string is represented as concatenation of the following parameters: | 1. Request parameter: :ex:`login`. | 2. Request parameter: :ex:`merchant-order-id`. | 3. Request parameter: :ex:`paynet-order-id`. | 4. Request parameter: :ex:`amount` in minor units (if sent). | 5. request parameter: :ex:`currency` (if amount sent) | 6. :ex:`merchant_control` (Control key assigned to Connecting Party account in the Payneteasy gateway system). Response Parameters ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. note:: | Response has Content-Type: text/html;charset=utf-8 header. All fields are x-www-form-urlencoded, with (0xA) character at the end of each parameter’s value. .. list-table:: :widths: 25, 75 :header-rows: 1 :class: longtable * - Response Parameter - Description * - :code:`type` - The type of response. May be :ex:`async-response`, :ex:`validation-error`, :ex:`error`. If type equals :ex:`validation-error` or :ex:`error`, :ex:`error-message` and :ex:`error-code` parameters contain error details. * - :code:`paynet-order-id` - Order id assigned to the order by Payneteasy. * - :code:`merchant-order-id` - Connecting Party order id. * - :code:`serial-number` - Unique number assigned by Payneteasy server to particular request from the Connecting Party. * - :code:`error-message` - If status is :ex:`error` this parameter contains the reason for decline or error details. * - :code:`error-code` - The error code is case of :ex:`error` status. * - :code:`end-point-id` - Endpoint id used for the transaction. Request Example ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: guess POST /paynet/api/v2/capture/39914 HTTP/1.1 Host: sandbox.payneteasy.com User-Agent: curl/7.83.0 Accept: */* Content-Length: 119 Content-Type: application/x-www-form-urlencoded Connection: close login=TestMerchant &client_orderid=902B4FF5 &orderid=6863088 &amount=345 ¤cy=USD &control=da832c0fcff0105728e26465d5f99e6f83179a45 Success Response Example ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: javascript HTTP/1.1 200 OK Server: server Date: Mon, 22 Aug 2022 13:15:19 GMT Content-Type: text/html;charset=utf-8 Connection: close Vary: Accept-Encoding X-XSS-Protection: 1 X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000 Content-Language: en-US Strict-Transport-Security: max-age=31536000 Content-Length: 140 type=async-response &serial-number=00000000-0000-0000-0000-000002ddb06a &merchant-order-id=902B4FF5 &paynet-order-id=6863088 &end-point-id=37211 Fail Response Example ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: javascript HTTP/1.1 200 OK Server: server Date: Mon, 22 Aug 2022 12:59:09 GMT Content-Type: text/html;charset=utf-8 Connection: close Vary: Accept-Encoding X-XSS-Protection: 1 X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=31536000 Content-Language: en-US Strict-Transport-Security: max-age=31536000 Content-Length: 154 pe=validation-error &serial-number=00000000-0000-0000-0000-000002ddb06b &error-message=Can+not+make+capture+for+order+state+AUTH_3D_VALIDATING &error-code=27 Postman Collection ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. raw:: html :file: ../_static/Postman/Postman_preauth.html Request Builder ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. raw:: html :file: ../_static/examples/capture_transaction_Request_Debug.html