Pular para o conteúdo

Fail payment

Requisição

Fails a payment. Fail payment is a deliberate action that permanently stops the payment and puts it into a non-recoverable state.

An institution rejects a payment to solicit changes to user_info; it fails a payment to stop it altogether. After a payment has been created by an Accept quote request, you can fail the payment if it is your institution's turn to take an action on the payment.

The originating institution can fail a payment in states LOCKED and LOCK_DECLINED. The beneficiary and intermediary institutions can fail a payment in the ACCEPTED state. Beneficiary institutions can also fail a payment in the EXECUTED state. The general use case for failing an executed payment is to Create quote to return payment to the originating institution.

Payments in states PREPARED and SETTLEMENT_DECLINED can fail automatically—PREPARED when the crypto-transaction expires and SETTLEMENT_DECLINED when the payment expires.

Segurança
Bearer
Caminho
payment_idstring, (uuid)obrigatório

Unique identifier of the payment to fail.

Corpoapplication/jsonobrigatório
reasonsobjectobrigatório

Provide one or more arbitrary key/value pairs.

Exemplo:
{ "type": "RECEIVER_DATA_VALIDATION", "code": "AC03", "reason": "Creditor account number invalid or missing" }
curl -i -X POST \
  'https://docs.ripple.com/_mock/pt-br/products/payments-odl/api-docs/ripplenet/reference/openapi/payments/{payment_id}/fail' \
  -H 'Authorization: YOUR_API_KEY_HERE' \
  -H 'Content-Type: application/json' \
  -d '{
    "reasons": {
      "type": "RECEIVER_DATA_VALIDATION",
      "code": "AC03",
      "reason": "Creditor account number invalid or missing"
    }
  }'

Respostas

Successfully failed a payment.

Corpoapplication/json
payment_idstring, (uuid)obrigatório

Unique identifier of a payment.

Exemplo:"d485f100-2af7-4e48-9ab1-3c7e28775691"
contract_hashstringobrigatório

Hash of all values in the Contract object used to ensure immutability. Once a payment transitions to the LOCKED state, the values in this object cannot change.

Exemplo:"ccb23bd87f13cc13b9d616a9723f76e112aeac8628b2082e0f8bf3b8c670b103"
payment_statestringobrigatório

State of the payment. For details about payment states, see Payment States in the RippleNet Developer Guide.

Enum:"ACCEPTED""AWAITING_COLLECTION""COMPLETED""EXECUTED""FAILED""FORWARDED""LOCK_DECLINED""LOCKED""PREPARED""RETURNED"
Exemplo:"COMPLETED"
modified_atstring, (date-time)obrigatório

Date and time at which the payment was last modified, as an ISO-8601 timestamp in UTC.

Exemplo:"2019-10-01T18:25:47.347Z"
contractobjectobrigatório

Represents all immutable parts of a payment agreed upon by all participants as a part of the Lock payment flow. Once a payment transitions to the LOCKED state, the values in this object cannot change.

ripplenet_infoArray of objects

Application-provided data explaining actions taken by RippleNet applications.

execution_conditionstringobrigatório

A Base64-encoded execution condition for this payment, the fulfillment of which will be presented to the validator to complete this payment. This value must match the execution_condition in the associated crypto transaction.

Exemplo:"PrefixSha256Condition{subtypes=[ED25519-SHA-256], type=PREFIX-SHA-256, fingerprint=sfGGHCrkyaMsLQNB62w_4zarlPChHKm47JkXVQbs1z0, cost=132360}"
crypto_transaction_idstringobrigatório

Unique identifier of the crypto transaction associated with this payment.

Exemplo:"4e05da26-7872-4a1f-b9b7-db7604757c37"
validatorstringobrigatório

Address of the validator that validated the payment.

Exemplo:"rn.us.ca.san_francisco"
payment_typestringobrigatório

Payment type.

Enum:"REGULAR""RETURN"
Exemplo:"REGULAR"
returns_payment_with_idstring, (uuid)obrigatório

If the payment_type is RETURN, provides the payment ID of the original payment that this payment returns. Otherwise, this field value is set to null.

returned_by_payment_with_idstring, (uuid)obrigatório

If the payment_type is REGULAR and the payment has an associated return payment, provides the payment ID of the return payment. Otherwise, this field value is set to null.

execution_resultsArray of objectsobrigatório

Represents the actual movement of funds in a payment. Each execution result corresponds to a quote element and represents its execution in a payment.

liquidation_execution_resultsArray of objects

Represents the actual movement of funds in a payment as part of liquidation of a Wallet Receive payment.

liquidation_detailsobject

Contains details of liquidation if applicable.

push_forward_execution_resultsArray of objects

Represents the movement of funds after an On-Demand Liquidity payment fails at intermediary transfer or destination exchange.

accepted_atstring, (date-time)obrigatório

Date and time at which the payment was last accepted, as an ISO-8601 timestamp in UTC.

Exemplo:"2019-10-01T18:25:47.347Z"
locked_atstring, (date-time)

Date and time at which the payment was last locked, as an ISO-8601 timestamp in UTC.

Exemplo:"2019-10-01T18:25:47.347Z"
executed_atstring, (date-time)

Date and time at which the payment was last executed, as an ISO-8601 timestamp in UTC.

Exemplo:"2019-10-01T18:25:47.347Z"
completed_atstring, (date-time)

Date and time at which the payment was last completed, as an ISO-8601 timestamp in UTC.

Exemplo:"2019-10-01T18:25:47.347Z"
returned_atstring, (date-time)

Date and time at which the payment was returned, as an ISO-8601 timestamp in UTC.

Exemplo:"2019-10-01T18:25:47.347Z"
internal_infoobjectobrigatório

JSON object containing information that only the RippleNet instance that set it can view. This value can be set by the sender when accepting a payment and by an intermediary or receiver when locking the payment.

user_infoArray of objectsobrigatório

User-provided data with arbitrary key/value pairs.

Resposta
{ "payment_id": "d485f100-2af7-4e48-9ab1-3c7e28775691", "contract_hash": "ccb23bd87f13cc13b9d616a9723f76e112aeac8628b2082e0f8bf3b8c670b103", "payment_state": "COMPLETED", "modified_at": "2019-10-01T18:25:47.347Z", "contract": { "sender_end_to_end_id": "string", "created_at": "2019-10-01T18:18:13.665Z", "expires_at": "2019-10-01T18:55:22.824Z", "quote": { … }, "fee_info": { … } }, "ripplenet_info": [ { … } ], "execution_condition": "PrefixSha256Condition{subtypes=[ED25519-SHA-256], type=PREFIX-SHA-256, fingerprint=sfGGHCrkyaMsLQNB62w_4zarlPChHKm47JkXVQbs1z0, cost=132360}", "crypto_transaction_id": "4e05da26-7872-4a1f-b9b7-db7604757c37", "validator": "rn.us.ca.san_francisco", "payment_type": "REGULAR", "returns_payment_with_id": "a69b322f-faa4-4531-bcff-897e5839c130", "returned_by_payment_with_id": "c929a87b-81b8-4878-b21c-1aeaa4fe9276", "execution_results": [ { … } ], "liquidation_execution_results": [ { … } ], "liquidation_details": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "status": "string", "failure_reason": "string", "failure_count": 0 }, "push_forward_execution_results": [ { … } ], "accepted_at": "2019-10-01T18:25:47.347Z", "locked_at": "2019-10-01T18:25:47.347Z", "executed_at": "2019-10-01T18:25:47.347Z", "completed_at": "2019-10-01T18:25:47.347Z", "returned_at": "2019-10-01T18:25:47.347Z", "internal_info": { "connector_role": "RECEIVING", "labels": [ … ], "internal_id": "string" }, "user_info": [ { … } ] }