BillingTransactionReversedPayload billing.transaction.reversed@1
Generated at from
openvibe-contracts v0.33.0 and
openvibe-sdk v0.5.0.
- Version
- 1.0.0
- Owner
- billing
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Decision
- ADR-012
- Schema
https://openvibe.network/contracts/events/payloads/billing.transaction.reversed.v1.json
billing.transaction.reversed v1 (OpenVibe.Billing server/ops/reversals.js reverseReceipt, transfers.js refund, cashouts.js deny). A transaction reversing an earlier one was posted: a provider refund or chargeback, a donation refund, a denied cash-out. Envelope: subject { type: transaction, id: txn_… (the reversing transaction) }, visibility internal, priority important, actor service:billing.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
transaction_id | string | yes |
| |
type | enum | yes |
| |
test | boolean | yes | Test money: never counted. | |
from_subject | string | null | yes | Subject id (usr_…) value moved from, null for provider money. | |
to_subject | string | null | yes | Subject id (usr_…) value moved to. | |
provider | string | null | yes | stripe, paypal, powerchat…; null for credit movements. | |
metadata | object | yes | Transaction metadata as posted (amount_bits, paid_cents, value_cents, target EntityRef, intent_id, message, donor_name, rates…). Its keys depend on the transaction type. | |
reverses_txn | string | yes | The transaction this one reverses. |
|
review | enum | Provider reversals only: required when Billing kept value it could not recover (staff review). |
| |
entitlements_revoked | integer | Provider reversals only: subscription periods revoked. |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: chargeback
{
"transaction_id": "txn_01JAB3C4D5E6F7G8H9J0K1MNQ3",
"type": "chargeback",
"test": false,
"from_subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"to_subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR",
"provider": "stripe",
"metadata": {
"cents": 500,
"original_paid_cents": 500,
"reason": "charge.dispute.created",
"review": "required"
},
"reverses_txn": "txn_01JAB3C4D5E6F7G8H9J0K1MNQ1",
"review": "required",
"entitlements_revoked": 0
}Valid: donation-refund
{
"transaction_id": "txn_01JAB3C4D5E6F7G8H9J0K1MNQ3",
"type": "refund",
"test": false,
"from_subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"to_subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR",
"provider": null,
"metadata": {
"amount_bits": 500,
"target": {
"service": "tips",
"type": "interaction",
"id": "tint_01JAB3C4D5E6F7G8H9J0K1MNPQ"
},
"message": "gg"
},
"reverses_txn": "txn_01JAB3C4D5E6F7G8H9J0K1MNQ1"
}Rejected: no-original
{
"transaction_id": "txn_01JAB3C4D5E6F7G8H9J0K1MNQ1",
"type": "refund",
"test": false,
"from_subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPR",
"to_subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"provider": null,
"metadata": {
"amount_bits": 500,
"target": {
"service": "tips",
"type": "interaction",
"id": "tint_01JAB3C4D5E6F7G8H9J0K1MNPQ"
},
"message": "gg"
}
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('billing.transaction.reversed@1', value); // { valid, errors: [{ path, message }] }