›
byrcsc/laravel-payrex · 1.x
List the transactions included in a PayRex bank payout.
Payouts represent transfers of settled funds to the merchant's bank account. Only the transaction-list endpoint is exposed, because that is the only payout endpoint PayRex's own SDK implements.
use ByRcsc\LaravelPayrex\Facades\Payrex;
$transactions = Payrex::payouts()->listTransactions(
id: 'po_...',
limit: 100,
);
foreach ($transactions as $transaction) {
$transaction->id;
$transaction->amount;
$transaction->netAmount;
$transaction->transactionType;
$transaction->transactionId;
}The complete signature is:
listTransactions(
string $id,
?int $limit = null,
?string $before = null,
?string $after = null,
array $options = [],
): ListingPayoutTransactionType can be Payment, Refund, or Adjustment.
transactionId identifies the underlying record represented by the line.
The payout transaction endpoint returns a Listing<PayoutTransaction>:
$page = Payrex::payouts()->listTransactions(
id: $payoutId,
limit: 100,
after: $lastTransactionId,
);
if ($page->hasMore) {
// Request the next page using the last transaction ID.
}There is no payout-specific autoPaging() or paginate() method in version
1.x.
The package maps:
payout.created to PayoutCreated; andpayout.deposited to PayoutDeposited.The event's resource() method hydrates a Payout containing id, amount,
netAmount, status, destination, livemode, timestamps, and raw.
use ByRcsc\LaravelPayrex\Data\Payout;
use ByRcsc\LaravelPayrex\Events\PayoutDeposited;
public function handle(PayoutDeposited $event): void
{
$payout = $event->event->resource();
if (! $payout instanceof Payout) {
return;
}
// Reconcile the deposit by $payout->id.
}The package intentionally does not guess payout routes that PayRex has not confirmed. If PayRex documents a new route before the package models it, use a low-level client call only after verifying the endpoint:
$payload = Payrex::get('/payouts/po_...');