omnitrade / paypal
Omnitrade PayPal: orders approved on PayPal's page and captured on return, authorizations, refunds and webhook events, over the v2 REST API.
Requires
- php: >=8.2
- glitchr/omnitrade: ^1.0@dev
- symfony/http-client-contracts: ^3.0
Requires (Dev)
- phpunit/phpunit: ^11.0
- symfony/http-client: ^6.4|^7.0|^8.0
Suggests
- symfony/http-client: The HTTP client the gateway talks through
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-02 01:58:25 UTC
README
PayPal for glitchr/omnitrade: orders approved on PayPal's page and captured when the buyer comes back, authorizations, refunds, and the webhook's events - PayPal's v2 REST API, over the application's HTTP client.
omnitrade: gateways: paypal: factory: paypal options: client_id: '%env(PAYPAL_CLIENT_ID)%' secret: '%env(PAYPAL_SECRET)%' sandbox: true # sandbox API and credentials webhook_id: '%env(PAYPAL_WEBHOOK_ID)%' # for notify(): PayPal verifies the signature itself
purchase() creates an order (intent CAPTURE) and answers PENDING with PayPal's page; PayPal
brings the buyer back to returnUrl?token=<order id>, and capture($orderId) takes the money -
twice is fine, an order already captured is answered as it is. authorize() does the same with
intent AUTHORIZE: capture() then takes the money, void() lets it go. refund() pays back on
the order's capture; fetch() reads the order; notify() reads CHECKOUT.ORDER.* and
PAYMENT.CAPTURE.* events. The idempotency key goes in PayPal-Request-Id.
Credentials: a REST app in the Developer Dashboard (its client id and secret, sandbox and live
are separate), and a webhook on it for CHECKOUT.ORDER.APPROVED, PAYMENT.CAPTURE.COMPLETED,
PAYMENT.CAPTURE.DENIED, PAYMENT.CAPTURE.REFUNDED - its id is webhook_id.
License: LGPL-3.0-or-later.