Download the PHP package lunarphp/stripe without Composer

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

This addon enables Stripe payments on your Lunar storefront.

Alpha Release

This addon is currently in Alpha, whilst every step is taken to ensure this is working as intended, it will not be considered out of Alpha until more tests have been added and proved.

Tests required:

Minimum Requirements

Optional Requirements

Installation

Require the composer package

Publish the configuration

This will publish the configuration under config/lunar/stripe.php.

Publish the views (optional)

Lunar Stripe comes with some helper components for you to use on your checkout, if you intend to edit the views they provide, you can publish them.

Enable the driver

Set the driver in config/lunar/payments.php

Add your Stripe credentials

Make sure you have the Stripe credentials set in config/services.php

Keys can be found in your Stripe account https://dashboard.stripe.com/apikeys

Configuration

Below is a list of the available configuration options this package uses in config/lunar/stripe.php

Key Default Description
policy automatic Determines the policy for taking payments and whether you wish to capture the payment manually later or take payment straight away. Available options manual or automatic
sync_addresses true When enabled, the Stripe addon will attempt to sync the billing and shipping addresses which have been stored against the payment intent on Stripe.

Backend Usage

Create a PaymentIntent

This method will create a Stripe PaymentIntent from a Cart and add the resulting ID to the meta for retrieval later. If a PaymentIntent already exists for a cart this will fetch it from Stripe and return that instead to avoid duplicate PaymentIntents being created.

You can pass any additional parameters you need, by default the following are sent:

Fetch an existing PaymentIntent

Syncing an existing intent

If a payment intent has been created and there are changes to the cart, you will want to update the intent so it has the correct totals.

Update an existing intent

For when you want to update certain properties on the PaymentIntent, without needing to recalculate the cart.

See https://docs.stripe.com/api/payment_intents/update

Cancel an existing intent

If you need to cancel a PaymentIntent, you can do so. You will need to provide a valid reason, those of which can be found in the Stripe docs: https://docs.stripe.com/api/payment_intents/cancel.

Lunar Stripe includes a PHP Enum to make this easier for you:

Update the address on Stripe

So you don't have to manually specify all the shipping address fields you can use the helper function to do it for you.

Charges

Retrieve a specific charge

Get all charges for a payment intent

Webhooks

The add-on provides an optional webhook you may add to Stripe. You can read the guide on how to do this on the Stripe website https://stripe.com/docs/webhooks/quickstart.

The events you should listen to are payment_intent.payment_failed, payment_intent.succeeded.

The path to the webhook will be http:://yoursite.com/stripe/webhook.

You can customise the path for the webhook in config/lunar/stripe.php.

You will also need to add the webhook signing secret to the services.php config file:

If you do not wish to use the webhook, or would like to manually process an order as well, you are able to do so.

Storefront Examples

First we need to set up the backend API call to fetch or create the intent, this isn't Vue specific but will likely be different if you're using Livewire.

Vuejs

This is just using Stripe's payment elements, for more information check out the Stripe guides

Payment component


Contributing

Contributions are welcome, if you are thinking of adding a feature, please submit an issue first so we can determine whether it should be included.

Testing

A MockClient class is used to mock responses the Stripe API will return.


All versions of stripe with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
lunarphp/core Version self.version
stripe/stripe-php Version ^14.4
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 lunarphp/stripe contains the following files

Loading the files please wait ....