›
byrcsc/laravel-payrex · 1.x
Protect credentials, webhook endpoints, queues, and payment state in production.
Payment integrations cross trust boundaries and change financial state. Treat the API client, browser handoff, webhook endpoint, and queue as separate operational surfaces.
The secret key is server-side only. It is sent as the username of HTTP Basic authentication on every API request.
Only Payrex::publicKey() is intended for browser use.
The webhook signing secret is different from API credentials. Store the secret
returned when the endpoint is created and configure it as
PAYREX_WEBHOOK_SECRET.
The package verifies signatures with constant-time comparison and checks the timestamp against a 300-second tolerance by default. Keep system time synchronized and monitor signature failures.
The webhook route has no CSRF token by design. Do not place it behind session authentication. Add rate limiting when appropriate:
'webhooks' => [
// ...
'middleware' => ['throttle:60,1'],
],PayRex retries failed or slow webhook deliveries for up to three days with exponential backoff. A valid event can therefore arrive more than once.
ShouldQueue.The timestamp freshness window is not deduplication.
The client retries only safe GET requests. PayRex does not document
idempotency keys, so automatic retry of POST, PUT, or DELETE could create
duplicate financial operations.
After an ambiguous timeout:
All amounts are integers in the smallest currency unit. For PHP, 10_000 is
₱100.00. Never convert a user-entered decimal amount with floating-point
arithmetic at the API boundary. Parse and validate it into centavos using a
decimal-safe approach.
The package locally validates only the documented payment-intent range. Line-item totals, refund ceilings, account eligibility, and other business rules remain server-validated.
DTO $raw payloads can contain names, email addresses, billing details,
payment metadata, and other sensitive information. Sanitize them before
logging or attaching them to a public issue.
Do not log credentials, client secrets, full webhook headers, or unredacted payment-method details.
Useful signals include:
ApiConnectionException and timeout frequency;Payrex::lastResponse() exposes the most recent status and response headers.
PayRex does not guarantee specific header names, so treat any request or
rate-limit header as optional.
Use the package repository's security policy for package vulnerabilities. Report vulnerabilities in PayRex itself directly to PayRex.