Download the PHP package neuron-php/payments without Composer

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

Neuron Payments

Gateway-agnostic payment processing for the Neuron PHP framework, with a hosted-checkout Stripe driver.

The component never touches raw card data: donors/customers enter payment details on the provider's hosted page and are returned to your success/cancel URLs. Completed payments are confirmed asynchronously via signed webhooks.

Installation

This pulls in stripe/stripe-php.

Usage

Cart / multi-item checkout

For a shopping-cart purchase, pass lineItems instead of relying on the single amount. Each LineItem has a name, a unit price, and a quantity, and the gateway charges them as separate lines on one hosted checkout. Cart checkout is always one-time ( any recurring frequency is ignored when line items are present ).

Webhooks

verifyWebhook() returns a gateway-agnostic WebhookEvent that covers the full lifecycle of one-time payments and recurring subscriptions:

WebhookEvent accessors are shape-tolerant across event types: metadata(), sessionId(), invoiceId(), subscriptionId(), paymentIntentId(), amountTotal(), amountPaid(), customerEmail(), subscriptionStatus(), currentPeriodEnd(), billingReason(), isRenewal().

Managing subscriptions

Recurring cadence

Frequency maps human cadences to Stripe subscription intervals:

Frequency Stripe interval interval_count
OneTime (payment mode) -
Monthly month 1
Quarterly month 3
SemiAnnual month 6
Annual year 1

Configuration reference

GatewayFactory::create() accepts:

Key Required Description
provider yes Gateway driver. Currently stripe.
secret_key yes Provider API secret (sk_live_... / sk_test_...).
webhook_secret yes* Signing secret (whsec_...); required to verify webhooks.
currency no ISO 4217 code; defaults to usd.

Keep secret_key and webhook_secret out of source control — load them from an encrypted secrets store or environment, never a committed config file.

Using with Neuron CMS

neuron-php/cms ships an optional payments feature that uses this package. A single engine handles every payment type — donations, memberships, dues — as one-time payments or recurring subscriptions, with each renewal recorded and the subscription lifecycle driven by the webhook. A payment's purpose (default donation) tags what it is for. The feature is gated behind class_exists() + config, so the CMS runs unchanged when the package is absent.

1. Install

2. Configure (config/neuron.yaml)

Put the real secret_key / webhook_secret in config/secrets.yml.enc under a payments: section — not in neuron.yaml.

A legacy top-level donations: section (same keys) is still honored for backward compatibility when payments has no forms.

3. Migrate

4. Embed the form

Add the shortcode to any page's content (in a paragraph block — Raw HTML blocks are not shortcode-parsed). [payment] is the generic shortcode; [donation] is a friendly alias:

5. Register the Stripe webhook

In the Stripe dashboard add an endpoint pointing at your site and subscribe to these events:

The webhook is the source of truth: it verifies the signature, persists state, and triggers receipt + internal notification emails. The success page is informational only. (/donations/webhook and the other /donations/* routes remain as aliases.)

CMS routes: POST /payments/checkout, GET /payments/success, GET /payments/cancel, GET /payments/token, POST /payments/webhook (each also available under /donations/*). Admin screens live at /admin/payments and /admin/subscriptions (the latter can cancel an active subscription).

Testing


All versions of payments with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
ext-json Version *
stripe/stripe-php Version ^20.2
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 neuron-php/payments contains the following files

Loading the files please wait ...