Download the PHP package offline/oc-cashier-plugin without Composer

On this page you can find all versions of the php package offline/oc-cashier-plugin. 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 oc-cashier-plugin

October Cashier Plugin

October CMS plugin to handle Stripe and Braintree payments using Laravel Cashier.

This plugin integrates Laravel Cashier with the help of Rainlab.User into October CMS. You can do "one-off" charges on your Rainlab users or subscribe them to your Stripe plans.

The plugin comes preloaded with simple Stripe Elements form and invoice list components. All features of Laravel Cashier are available. An easily customizable invoice view and some useful events have been added for this October CMS version of Cashier.

Breaking changes in v2.0.0

In version 2.0.0 of this plugin Laravel Cashier was updated to version 9.0. This makes the plugin compatible with Laravel 5 and Laravel 6 based October versions.

With this update, some architectural problems with the plugins have been solved that might introduce breaking changes depending on your setup:

Installation

In config/services.php replace the stripe configuration with the following:

Now add your STRIPE_KEY and STRIPE_SECRET to your .env file.

Make sure to include the October CMS framework extras if you want to use the StripeElementsForm component.

You're done!

Handle Stripe Webhooks

To receive Stripe webhooks configure Stripe to send them to https://<your-site>/stripe/webhook (you can change this URL via the services.stripe.webhook.url config entry).

Subscription cancellation on failed charges are handled by default by Laravel Cashier. If you wish to react to other webhooks listen for the generic offline.cashier::stripe.webhook.received event that is fired for all incomming webhooks or create a listener for a specific webhook event like offline.cashier::stripe.webhook.invoice.payment_succeeded (using the format offline.cashier::stripe.webhook.<stripe_webhook_type>). All event listeners receive a $payload and a $request variable.

Alternatively you can set your own webhook handler controller in the services.stripe.webhook.handler config entry and implement everything yourself.

Components

InvoicesList

This component lists all invoices of a specific user account.

Use your own number formatter

If you want to have complete control over the way the amounts are formatted in your invoices, you have the possibility to listen for the offline.cashier::format.amount event and format the amount yourself.

Customize the invoice template

The invoice template is stored in views/receipt.htm. You can copy this template and store it in your own plugin or theme. To load your own partial for the invoices set the new view path in the backend settings of Cashier.

You can pass additional data to the invoice using the repeater on the backend settings form. Each variable you specify will be available in the template. This is useful if you want to show a phone number or email address on your invoices.

Properties

userId

Specify the id of the user you want to load the invoices for. If you leave this blank the currently logged in user will be used.

includePending

Whether or not to include pending invoices in the list.

loadingText

For performance reasons the invoice list is loaded asynchronously. During the loading period this string is displayed to the user (defaults to Loading invoices...).

StripeElementsForm

This component provides you with a simple starting point to integrate Stripe Elements into your Website.

Simply add the component to your page and you will be presented with a simple credit card input form.

Token Handler Callback

To extend the default stripeTokenHandler function that receives the generated Stripe token, copy the plugins/offline/cashier/components/stripeelementsform/tokenHandler.htm to themes/<yourtheme>/partials/stripeElementsForms/tokenHandler.htm and modify as needed.

Handle form submission

When the user submits the form the offline.cashier::stripeElementForm.submit event is triggered. You can listen for this event in your own plugin and store the payment information for later use, charge your user or create a subscription.

Checkout the Laravel Cashier Documentation for more information on how to use the generated stripeToken to charge or subscribe a user.

For a working example see the code below:

Properties

includeStripeJs

This property includes the https://js.stripe.com/v3/ code into your page. If you have multiple instances of the component on one page make sure to enable this property only on one of them. If you include the code globally you can safely uncheck this property.

includeCss

This property includes the styles.htm partial from the component (which you can overwrite) with the component. If you defined your Stripe Elements styles gl

submitButtonLabel

This property specifies the submit button's label during the form submission.

NeedsSubscription

Place this component on any page that is only accessible by users with a valid subscription. Users without a valid subscription are redirected to the page you defined.

Extend the subscription logic

If you need to extend the subscription logic you can listen for the offline.cashier::subscription.check event. The event receives the user and the NeedsSubscription component instance.

If you return true from any event listener the user will be allowed to view the page. If you return false from any event listener the user will be redirected. Please be aware that any true value takes precedence. If you don't return any boolean value the check will fallback to Laravel Cashier's subscribed method.

Extend the subscription logic

If you need to extend the subscription logic you can listen for the offline.cashier::subscription.check event. The event receives the user and the NeedsSubscription component instance.

If you return true from any event listener the user will be allowed to view the page. If you return false from any event listener the user will be redirected. Please be aware that any true value takes precedence. If you don't return any boolean value the check will fallback to Laravel Cashier's subscribed method.

Properties

redirect

Unauthorized users are redirected to this route.

subscription

The name of the subscription a user needs to access the page. Default is main.


All versions of oc-cashier-plugin with dependencies

PHP Build Version
Package Version
Requires laravel/cashier Version ^13.0
composer/installers Version ~1.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 offline/oc-cashier-plugin contains the following files

Loading the files please wait ....