Giter Site home page Giter Site logo

filament-stripe-payment-link's Introduction

Filament Stripe Payment Link

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Provides an action to generate a Stripe payment link.

Installation

You can install the package via composer:

composer require andreia/filament-stripe-payment-link

You can publish the config using:

php artisan vendor:publish --tag="filament-stripe-payment-link-config"

or run the install command:

php artisan andreia/filament-stripe-payment-link:install

This is the contents of the published config file:

return [

    'action' => [
        'icon' => 'heroicon-m-link',
        'requires-confirmation' => false,
    ],

    'payment-link-key-location' => 'services.stripe.payment-link-key',

];

Requirements

Setup

Stripe

On Stripe dashboard, create a restricted API key:

  1. Add a descriptive name for your key on "Key name" field
  2. Add write permission to Products, Prices, and Payment Links
  3. Click on "Create key" button

Stripe Dashboard restricted API key

On the redirected page, in "Restricted keys" section, locate the name of your key. Click to reveal the secret key and copy it. It will be used to connect to Stripe.

Laravel Project

In your Laravel application, add the following on your config/services.php file:

'stripe' => [
    'payment-link-key' => env('STRIPE_PAYMENT_LINK_KEY')
],

And on your .env file, add the secret key generated on Stripe dashboard:

STRIPE_PAYMENT_LINK_KEY="your key here"

Usage

Add the Stripe payment link action to a Filament form input field:

use Andreia\FilamentStripePaymentLink\GenerateStripeLinkAction;

public static function form(Form $form): Form
{
    return $form
        ->schema([
            TextInput::make('stripe_payment_link')
                ->required()
                ->suffixAction(GenerateStripeLinkAction::make('stripe_payment_link')),
        ]);
}

This is how the action will look like:

Form field with Stripe Payment link action

When the user clicks on the link icon, a modal will be shown with the product name, amount, and currency fields:

Modal with required fields to generate Stripe payment link

After filling the form data and submitting, the payment link will be added to the form field:

Stripe payment link

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

filament-stripe-payment-link's People

Contributors

andreia avatar dependabot[bot] avatar github-actions[bot] avatar

Stargazers

 avatar  avatar Alessandro Ribeiro avatar Spacetum Co avatar MEHDI avatar LURQUIN Michaël avatar Knight avatar Njuguna Mwangi avatar  avatar Crăciun Petrișor avatar

Watchers

 avatar

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.