Download the PHP package stetodd/stripe-gateway-bundle without Composer

On this page you can find all versions of the php package stetodd/stripe-gateway-bundle. 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 stripe-gateway-bundle

stetodd/stripe-gateway-bundle

Stripe implementation of stetodd/payment-gateway as a Symfony bundle.

Install

Register in config/bundles.php:

The bundle binds Stetodd\PaymentGateway\PaymentGatewayInterface to StripePaymentGateway. Override the alias in your own services config to swap implementations (e.g. the Simulator in tests).

Configuration

Defaults read from env vars — set these and you need no bundle config at all:

Or configure explicitly in config/packages/stetodd_stripe_gateway.yaml:

Checkout success/cancel URLs are per-request data: pass absolute URLs on CreateCheckoutSessionRequest (successUrl, cancelUrl), the same way the customer portal takes its returnUrl. The gateway appends session_id={CHECKOUT_SESSION_ID} to the success URL, joining with & when the URL already carries a query string.

Webhooks

Route Stripe webhooks to the bundled parser in config/packages/webhook.yaml:

Consume events with a #[AsRemoteEventConsumer('stripe')] consumer in your app — that part is application-specific. Stetodd\StripeGatewayBundle\Webhook\WebhookEvent hydrates typed Stripe objects from the payload.

One-off holds (v0.4)

createPaymentHoldSession() opens a Checkout Session in payment mode with payment_intent_data[capture_method]=manual, so the amount is authorised but not captured. The checkout.session.completed webhook's session carries the payment_intent id; capture it with capturePayment() on fulfilment or release it with cancelPayment(). Card authorisations last seven days.

Refunds and checkout text (v0.5)

refundPayment() refunds a captured payment, all of it or a partial amount in minor units. Repeated partial refunds are allowed up to the amount captured. It refunds against the PaymentIntent (pi_…), or against the charge when given a ch_… id. If Stripe refuses up front (more than is left, a disputed or already-refunded charge), it throws RefundFailedException. A missing payment throws PaymentNotFoundException. Network errors propagate. A refund Stripe accepts can still fail later (charge.refund.updated), so read Refund::$status.

Give the request an idempotencyKey and it pays at most once (v0.7.2). The key is written into the refund's metadata as idempotency_key. Before creating anything, the gateway lists the payment's refunds and returns a pending or succeeded one that carries the key, with that refund's amount. The key is also sent as Stripe's Idempotency-Key header, which only helps two requests racing each other, because Stripe forgets it after 24 hours.

findLatestSubscriptionPayment() returns the subscription's most recent paid invoice as a SubscriptionPayment: the payment id to refund, amount paid, when it was paid, and the service period it bought. On Stripe API basil and later, the payment lives on invoice payments rather than invoice.payment_intent, so this makes two calls. An invoice paid entirely from credit balance returns null, because there's nothing to refund.

CreateCheckoutSessionRequest and CreatePaymentHoldRequest take an optional CustomText (submit, afterSubmit), sent as Checkout's custom_text.

Tests: composer install && vendor/bin/phpunit. Stripe is faked at the HTTP client, and nothing leaves the machine.

Listing for reconciliation (v0.8)

Implements the payment-gateway v0.8 list methods over Stripe's list endpoints. Each reads one page, newest first, filtered on created[gte] (and created[lt] when before is set), 100 at a time by default; nextCursor is the last object id of the page Stripe sent and goes back as starting_after.

capturePayment() and getPayment() now expand the latest charge, so the returned Payment carries cardBrand and cardLast4 for a receipt.

A hold's statementDescriptorSuffix is sent as payment_intent_data[statement_descriptor_suffix].


All versions of stripe-gateway-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=8.4
psr/log Version ^3.0
stetodd/payment-gateway Version ^0.8
stripe/stripe-php Version ^20.2
symfony/config Version ^7.2|^8.0
symfony/dependency-injection Version ^7.2|^8.0
symfony/http-foundation Version ^7.2|^8.0
symfony/http-kernel Version ^7.2|^8.0
symfony/serializer Version ^7.2|^8.0
symfony/webhook Version ^7.2|^8.0
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 stetodd/stripe-gateway-bundle contains the following files

Loading the files please wait ...