Download the PHP package quellabs/canvas-payments-paypal without Composer

On this page you can find all versions of the php package quellabs/canvas-payments-paypal. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package canvas-payments-paypal

PayPal Payment Provider

A PayPal payment provider for the Canvas framework. Part of the Canvas payments ecosystem. Implements the modern PayPal Orders v2 REST API with webhook-based payment notifications.

Installation

Architecture

This package sits between the PayPal REST API and your application. Your application only ever touches the contracts layer — it never depends on this package directly. PaymentRouter (from quellabs/canvas-payments) discovers this package automatically via composer metadata and routes payment calls to it.

Webhook processing is decoupled from your application via signals. When PayPal sends a webhook notification, the package emits a payment_exchange signal carrying a PaymentState. Your application listens for that signal and handles it. The buyer return URL works the same way — both the return and cancel cases are handled by the same route and emit the same signal, so your application does not need to distinguish between them at the routing level.

Configuration

Create config/paypal.php in your Canvas application:

Key Required Description
test_mode Yes Set to true for sandbox, false for production
client_id Yes REST API client ID from the PayPal Developer Dashboard
client_secret Yes REST API client secret from the PayPal Developer Dashboard
webhook_id Yes Webhook ID from your PayPal app settings — required for signature verification
verify_ssl No Whether to verify PayPal's SSL certificate. Always true in production. Defaults to true
account_optional No When true, buyers can check out as a guest without a PayPal account. Defaults to true
brand_name No Your store name shown on the PayPal checkout page. Leave empty to use your PayPal account name
return_url Yes URL the customer is redirected to after a completed payment
cancel_return_url Yes URL the customer is redirected to after cancelling at PayPal
webhook_url Yes Full URL PayPal POSTs webhook notifications to — must match the URL registered in your PayPal app

Usage

Initiating a payment

Inject PaymentInterface via Canvas DI and call initiate():

Handling refunds

Pass amount: null for a full refund, or a minor-unit integer for a partial refund.

When your payment_exchange listener receives a PaymentStatus::Paid state, store $state->metadata['paymentReference'] — you'll need it as RefundRequest::$paymentReference.

Listening for payment state changes

PayPal-specific quirks

Two transaction identifiers

PayPal uses two different identifiers across the payment lifecycle:

Webhooks vs. return URL

PayPal notifies your application of payment state changes in two independent ways:

Both routes call exchange() and emit the payment_exchange signal. Your application should be idempotent when handling this signal, as it may fire twice for the same transaction.

Webhook setup

Register your webhook_url in the PayPal Developer Dashboard under Apps & Credentials → your app → Webhooks. Subscribe at minimum to these event types:

Copy the resulting Webhook ID into your config/paypal.php as webhook_id. Without it, all webhook notifications will be rejected.

Refund type determination

Pass amount: null to RefundRequest for a full refund. The driver omits the amount field from the API request, which causes PayPal to refund the full captured amount internally. Pass a minor-unit integer for a partial refund. Do not attempt to calculate the refundable amount yourself and pass it as a full refund — use null instead.

License

MIT


All versions of canvas-payments-paypal with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
symfony/http-client Version ^7.0 || ^8.0
quellabs/support Version *
quellabs/contracts Version *
quellabs/canvas-payments-contracts Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package quellabs/canvas-payments-paypal contains the following files

Loading the files please wait ...