›
›
›
  1. docs
  2. ›
  3. byrcsc/laravel-payrex
1.x
Browse documentationOpenClose

Getting started

  • Introduction
  • Installation and setup
  • Quick start

Core concepts

  • Client and resources
  • Data objects and enums
  • Errors and retries
  • Pagination

Accepting payments

  • Payment intents
  • Checkout sessions
  • Setup intents
  • Payments and refunds

Customers and billing

  • Customers
  • Eloquent customers
  • Billing statements
  • Payouts

Webhooks

  • Receiving webhooks
  • Events and listeners
  • Managing endpoints

Advanced usage

  • Testing
  • Security and operations
  • Troubleshooting

Getting started

  • Introduction
  • Installation and setup
  • Quick start

Core concepts

  • Client and resources
  • Data objects and enums
  • Errors and retries
  • Pagination

Accepting payments

  • Payment intents
  • Checkout sessions
  • Setup intents
  • Payments and refunds

Customers and billing

  • Customers
  • Eloquent customers
  • Billing statements
  • Payouts

Webhooks

  • Receiving webhooks
  • Events and listeners
  • Managing endpoints

Advanced usage

  • Testing
  • Security and operations
  • Troubleshooting

byrcsc/laravel-payrex · 1.x

Payouts.

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.

List payout transactions

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 = [],
): Listing

PayoutTransactionType can be Payment, Refund, or Adjustment. transactionId identifies the underlying record represented by the line.

Manual pagination

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.

Payout events

The package maps:

  • payout.created to PayoutCreated; and
  • payout.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.
}

Other payout operations

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_...');

What to read next

  • Data objects and enums for payout transaction properties and status enums.
  • Pagination to handle transaction list cursors.
  • Security and operations to build reconciliation and monitoring around payouts.
PreviousBilling statementsNextReceiving webhooks

Laravel PayRex is an unofficial community SDK and is not affiliated with PayRex.

View source

On this page

  1. List payout transactions
  2. Manual pagination
  3. Payout events
  4. Other payout operations
  5. What to read next