Code Monkey home page Code Monkey logo

spark-aurelius-mollie's Introduction

Laravel Spark, Mollie edition

spark.laravel.com | mollie.com

Support

If you'd like to have a chat, join us on the dedicated Discord channel.

Bugs and feature requests will be tracked here in the repository. Feel free to open a ticket.

Installation

Create a new Laravel project using the Laravel installer:

laravel new my-project

Next, add the following repository to your composer.json file:

"repositories":[
    {
        "type": "vcs",
        "url": "[email protected]:laravel/spark-aurelius-mollie.git"
    }
]

You should also add the following dependency to your composer.json file's require section:

"laravel/spark-aurelius-mollie": "^2.0"

Note: Spark's installer will wire up everything for you, including Cashier and the VAT calculator. No need to follow their installation instructions.

Next, run the composer update command. You may be prompted for a GitHub token in order to install the private Spark repository. Composer will provide a link where you can create this token.

Once the dependencies are installed, add the following service providers to your app.php configuration file:

Laravel\Spark\Providers\SparkServiceProvider::class,
Laravel\Cashier\CashierServiceProvider::class,

Next, run the install command:

php artisan spark:install --force --mollie

or for team billing:

php artisan spark:install --force --mollie --team-billing

Set the MOLLIE_KEY and database settings in the .env file. You can obtain test and live keys in the Mollie dashboard.

Once Spark is installed, add the following provider to your app.php configuration file:

App\Providers\SparkServiceProvider::class,

Finally, you are ready to run the npm install, npm run dev, and php artisan migrate commands. Once these commands have completed, you are ready to enjoy Spark!

Linking The Storage Directory

Once Spark is installed, you should link the public/storage directory to your storage/app/public directory. Otherwise, user profile photos stored on the local disk will not be available:

php artisan storage:link

Schedule Cashier

Schedule a periodic job in \App\Console\Kernel to execute Cashier::run().

    /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        $schedule->command('cashier:run')
            ->daily() // run as often as you like (Daily, monthly, every minute, ...)
            ->withoutOverlapping(); // make sure to include this
    }

Configuring billing plans

  1. Set up your subscription plans as described in the Laravel Cashier Mollie v2 documentation.
  2. Then configure the SparkServiceProvider as described in the Spark documentation.

Upgrading to Spark Mollie v2

Spark Mollie v2 provides compatibility with Laravel 8.

Upgrading from v1 only takes five minutes.

Start with updating composer.json to use Spark Mollie v2:

"spark-aurelius-mollie": "^2.0

Then, move the Team and User models into the App\Models namespace. Alternatively, if you would like to keep your model classes in the App namespace, you may use the useUserModel and useTeamModel methods in the register method of your SparkServiceProvider:

Spark::useUserModel('App\User');

Spark::useTeamModel('App\Team');

Finally, in App\Providers\SparkServiceProvider, rename the booted method into boot and call the parent method:

    public function boot()
    {
        parent::boot(); // Don't forget to call the parent boot method

        Spark::useMollie()
            ->trialDays(10)
            ->defaultBillableCountry('NL')
            ->collectEuropeanVat('NL');

        Spark::freePlan()
            ->features([
                'First', 'Second', 'Third'
            ]);

        Spark::plan('Basic', 'example-1')
            ->price(10)
            ->features([
                'First', 'Second', 'Third'
            ]);
    }

Local testing

You can use valet share (a ngrok wrapper) to make your local setup reachable for Mollie's webhook calls.

Make sure to use the ngrok generated url both in your .env file (APP_URL) and in your browser.

Note on mandated payments in test mode

A mandate for subsequent payments is obtained from the first payment (where the customer proceeds through Mollie's checkout).

The subsequent mandated payments are triggered by Spark. Once the payment has status paid, Spark's webhook will be called and an invoice will become available. Depending on how long the clearance takes, this takes anywhere between 1 second and 48 hours.

In production, Spark's webhook will be called once the payment has been paid (or has failed).

In test mode this is not the case. The payment status will not get updated automatically. You can do so manually in your browser using:

$url = mollie()->payments()->get("the_payment_id_here")->_links->changePaymentState->href;

More information is available in the Mollie docs.

Running on Laravel Vapor

Running on Vapor requires you to override:

  1. the profile picture upload features (for both teams and users)
  2. the invoice pdf generation and download

Here's an easy package to get you started: sandervanhooft/vaporize-spark-mollie.

spark-aurelius-mollie's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spark-aurelius-mollie's Issues

Redirect Error

I get "We had trouble validating your card. It's possible your card provider is preventing us from charging the card. Please contact your card provider or customer support." using the default installation when clicking the suscribe button (is not redirecting)

Support Jetstream

I saw on Twitter that you were going to add support for Jetstream. This issue can be used to keep track.

Questions though: is it possible to import the jetstream files in the future, if the project is initiated now?

Laravel 8 compatibility

Hi,

it seems that this package is not compatible with Laravel 8 because of the Guzzle dependency.

Just after installing Laravel 8 and adding this repository/package as a dependency:

$ composer update

Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for laravel/spark-aurelius-mollie ^1.0 -> satisfiable by laravel/spark-aurelius-mollie[v1.1.1, v1.1.0, v1.0.1, v1.0.0, v1.x-dev].
    - Can only install one of: guzzlehttp/guzzle[6.5.x-dev, 7.0.1].
    - Can only install one of: guzzlehttp/guzzle[7.0.1, 6.5.x-dev].
    - Can only install one of: guzzlehttp/guzzle[7.0.x-dev, 6.5.x-dev].
    - Can only install one of: guzzlehttp/guzzle[7.1.x-dev, 6.5.x-dev].
    - Conclusion: install guzzlehttp/guzzle 6.5.x-dev
    - Installation request for guzzlehttp/guzzle ^7.0.1 -> satisfiable by guzzlehttp/guzzle[7.0.1, 7.0.x-dev, 7.1.x-dev].

Thanks!

Change Repo and questions

Sorry for asking it here

  1. How to update/change existing Application on Laravel Spark to switch to mollie?
  2. Can our customers subscribe to SEPA and money be billed automatically from their european accounts?

Send invoice automatically to another email address

I have 2 customers who would like to have the invoice sent automatically to an email address other than the email address which they registered with.

is it possible to add this feature?

There has to be an invoice email field added to the billing informatie section, an event has to be dispatched when a invoice is created, and a listenere has to be send the email.

Payment Method Configuration

image

Seems Card Icon is broken. No Errors in the console. What I did wrong? How can I add also SEPA mandate as an option?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.