Payments
Payments
A payment is the money actually collected once a payment intent succeeds or a checkout is paid. The package cannot create one directly: pay a payment intent in the Payment intents scenario, or complete a Guest checkout, and its payment appears here.
Every demonstration here makes a real PayMongo API call in test mode. Nothing is simulated, and no real money moves.
Retrieve payment
Fetch a payment made in the Playground, with its fee, net amount, and the payment intent it settled.
PHP
use Luigel\Paymongo\Facades\Paymongo;
$payment = Paymongo::payments()->retrieve(
id: '{payment id}',
);
List payments
Fetch one cursor page of payments. The package returns a CursorPage you can walk with lazy() to fetch every page.
Test mode: PayMongo lists every payment on the account. The Playground shows only the ones made through it, so a page may show fewer than the limit, or none.
PHP
use Luigel\Paymongo\Facades\Paymongo;
$payment = Paymongo::payments()->list(
params: [
'limit' => 20,
],
);