Function __global->points_transaction_reverse

Definitions

sources/points2.php

  • Fully reverse a points transaction.This creates a new transaction that reverses the old one (e.g. refunding points), links the two transactions, and locks them.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: array

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$id AUTO_LINK No No required parameter N/A N/A The ID of the transaction ledger to reverse
$send_notifications ?boolean No No True N/A N/A Whether to send notifications for this transaction (false: only the staff get it) (true: both the member and staff get it) (null: neither the member nor staff get it)
$fail_ok boolean No No False N/A N/A Whether having a missing resource or condition preventing transaction reversal should not warn_exit

Returns

  • Tuple; the ID of the new transaction reversing, a boolean whether an escrow was also cancelled during the reversal, and an array of additional point transactions that were reversed because they had a reverse_link to this one (null: the transaction was not reversed and $fail_ok was true)
  • Type: ?array
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Fully reverse a points transaction.This creates a new transaction that reverses the old one (e.g. refunding points), links the two transactions, and locks them.
 *
 * @param  AUTO_LINK $id The ID of the transaction ledger to reverse
 * @param  ?boolean $send_notifications Whether to send notifications for this transaction (false: only the staff get it) (true: both the member and staff get it) (null: neither the member nor staff get it)
 * @param  boolean $fail_ok Whether having a missing resource or condition preventing transaction reversal should not warn_exit
 * @return ?array Tuple; the ID of the new transaction reversing, a boolean whether an escrow was also cancelled during the reversal, and an array of additional point transactions that were reversed because they had a reverse_link to this one (null: the transaction was not reversed and $fail_ok was true)
 */

function points_transaction_reverse(int $id, ?bool $send_notifications = true, bool $fail_ok = false) : ?array