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

On this page you can find all versions of the php package quellabs/canvas-payments-stripe. 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-stripe

Stripe Payment Provider

A Stripe payment provider for the Canvas framework. Part of the Canvas payments ecosystem. Implements the Stripe Checkout Sessions and Payment Intents APIs with webhook-based payment notifications.

Installation

Architecture

This package sits between the Stripe 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 Stripe 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/stripe.php in your Canvas application:

Key Required Description
test_mode Yes Set to true for test mode, false for production
secret_key Yes Secret API key from the Stripe Dashboard — sk_test_* for test, sk_live_* for production
publishable_key No Publishable API key — only needed if your frontend interacts with Stripe.js directly
webhook_secret Yes Webhook signing secret (whsec_*) from your Stripe webhook endpoint — required for signature verification
verify_ssl No Whether to verify Stripe's SSL certificate. Always true in production. Defaults to true
brand_name No Used as the payment statement descriptor (max 22 characters). Full branding is set in the Stripe Dashboard
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 Stripe
webhook_url Yes Full URL Stripe POSTs webhook events to — must match the URL registered in your Stripe webhook settings

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

Stripe-specific quirks

Two transaction identifiers

Stripe uses two different identifiers across the payment lifecycle:

Webhooks vs. return URL

Stripe 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 Stripe Dashboard under Developers → Webhooks → Add endpoint. Subscribe at minimum to these event types:

After creating the endpoint, reveal the signing secret (whsec_*) and copy it into your config/stripe.php as webhook_secret. Without it, all webhook notifications will be rejected.

For local development, use the Stripe CLI to forward events to your local server:

The CLI prints a temporary signing secret — use it as webhook_secret during development.

Refund reason mapping

Stripe accepts only three refund reason values: duplicate, fraudulent, and requested_by_customer. The driver maps the description field of RefundRequest automatically — descriptions containing the word "duplicate" or "dubbel" map to duplicate, descriptions containing "fraud" or "fraude" map to fraudulent, and everything else maps to requested_by_customer. Pass amount: null for a full refund; the driver omits the amount field, which causes Stripe to refund the full captured amount internally.

3DS and additional authentication

When a payment requires Strong Customer Authentication (SCA), exchange() returns a PaymentStatus::Redirect state with the next-action URL in $state->metadata['redirectUrl']. The controller handles this automatically by redirecting the buyer back to Stripe's authentication page. After the buyer completes authentication, Stripe redirects them back to your return_url and also sends a payment_intent.succeeded webhook.

License

MIT


All versions of canvas-payments-stripe 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-stripe contains the following files

Loading the files please wait ...