flowframe / laravel-gumroad
Perform actions on Gumroad sales like inviting customers to GitHub repositories, or creating licenses
Fund package maintenance!
larsklopstra
Requires
- php: ^8.0
- guzzlehttp/guzzle: ^7.0.1
- http-interop/http-factory-guzzle: ^1.0
- illuminate/contracts: ^8.37
- knplabs/github-api: ^3.0
- moneyphp/money: ^4.0
- spatie/laravel-package-tools: ^1.4.3
Requires (Dev)
- brianium/paratest: ^6.2
- nunomaduro/collision: ^5.3
- orchestra/testbench: ^6.15
- phpunit/phpunit: ^9.3
- spatie/laravel-ray: ^1.23
- vimeo/psalm: ^4.8
This package is auto-updated.
Last update: 2023-03-10 12:38:20 UTC
README
Perform actions on Gumroad sales like inviting customers to GitHub repositories, or creating licenses.
Support us
Like our work? You can support us by purchasing one of our products.
Installation
You can install the package via composer:
composer require flowframe/laravel-gumroad
You can easily publish the config like so:
php artisan vendor:publish --tag=gumroad-config
Usage
Once you've installed the package you'll have to publish the config and exclude the /gumroad/webhook
path from your App\Http\Middleware\VerifyCsrfToken
middleware.
When you've published your config you can add products, their actions, and additional data:
<?php use Flowframe\Gumroad\Actions\InviteUserToGitHubRepository; return [ 'products' => [ [ 'short_product_id' => 'xyz', // The ID of your Gumroad product 'actions' => [ // The action(s) you want to perform InviteUserToGitHubRepository::class, ], 'data' => [ // Additional data you can pass to your action 'github_repository_owner' => 'flowframe', 'github_repository_name' => 'laravel-gumroad', ], ] ] ];
By default we provide an InviteUserToGitHubRepository
action, more about that later.
Actions
You can create an action via the CLI like so: php artisan gumroad:make-action ActionName
. You'll see that the action implements the Actionable
interface and has a constructor with 2 parameters:
GumroadPing $gumroadPing, array $data
The $gumroadPing
is a fully typed webhook request.
The $data
array is the data from the product's config.
InviteUserToGitHubRepository
Action
We provide an InviteUserToGitHubRepository
action out of the box. To use this, add a personal access token from GitHub to your services.github.token
config:
<?php return [ // ... 'mailgun' => [...], 'postmark' => [...], 'ses' => [...], 'github' => [ 'token' => 'your_access_token', ], ];
Now that's set, you'll have to pass along the github_repository_owner
and github_repository_name
inside the product's data array.
When you create a product on Gumroad you'll have to add a custom field named: GitHub Username
, this field will be used to invite a user to your repository.
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.