marqant-lab / marqant-pay-stripe
Stripe payment provider for marqant/marqant-pay package.
Installs: 371
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 0
Type:package
Requires
- spatie/laravel-stripe-webhooks: ^2.3
- stripe/stripe-php: ^7.29
- dev-master
- v0.1.0
- v0.0.23
- v0.0.22
- v0.0.21
- v0.0.20
- v0.0.19
- v0.0.18
- v0.0.17
- v0.0.16
- v0.0.15
- v0.0.14
- v0.0.13
- v0.0.12
- v0.0.11
- v0.0.10
- v0.0.9
- v0.0.8
- v0.0.7
- v0.0.6
- v0.0.5
- v0.0.4
- v0.0.3
- v0.0.2
- v0.0.1
- dev-development
- dev-feature/tjv/chargeable-subscriptions
- dev-feature/dsv/GRETA-851-webhook_payment_failed
- dev-feature/dsv/Github-billable-config
- dev-feature/tjv/manual-subscriptions
- dev-feature/dsv/GRETA-811-webhooks-tests
- dev-bugfix/tjv/fix-hasPaymentMethod-method
- dev-feature/dsv/GRETA-810-webhook-charges-subscriptions
- dev-feature/tjv/setup-pdf-invoices
- dev-feature/tjv/invoice-query
- dev-feature/tjv/3d-secure-and-additional-authentication
- dev-feature/tjv/add-subscriptions-graphql
- dev-feature/tjv/add-plans-and-subscriptions
- dev-feature/tjv/change-composer-vendor-name
This package is auto-updated.
Last update: 2025-02-19 21:28:07 UTC
README
This package makes the stripe payment provider available for the marqant/marqant-pay package.
Instalation
You can just require this package through composer as follows.
composer require marqant-lab/marqant-pay-stripe
Then you have to add the service infomration to the services.php
configuration file of Laravel. To do so, update
the configuration file as shown below.
return [ // other services // ... 'stripe' => [ 'key' => env('STRIPE_KEY'), 'secret' => env('STRIPE_SECRET'), ], ];
Next you have to add the environment variables. Go to your stripe dashboard and get your stripe key and secret, so
you can add it to your .env
file.
STRIPE_KEY=pk_test_iLokikJOvEuI2HlWgH4olf3P STRIPE_SECRET=sk_test_BQokikJOvBiI2HlWgH4olfQ2
Now go ahead and enable the payment provider in the marqant-pay.php
configuration file.
return [ /* |-------------------------------------------------------------------------- | Gateways |-------------------------------------------------------------------------- | | In this section you can define all payment gateways that you need for | your project. | */ 'gateways' => [ 'stripe' => \Marqant\MarqantPayStripe\StripePaymentGateway::class, ], ];
Next you will need to add the fields for stripe on the billables you setup in the marqant-pay
setup. So run the
following for each billable model that you have setup (or will setup).
php artisan marqant-pay:migrations:stripe
If you are using the marqant-lab/marqant-pay-subscriptions package to enable subscriptions, then you will need to add the --subscriptions
flag to the choosen command.
php artisan marqant-pay:migrations:stripe --subscriptions
Now you can run the migrations as usual.
php artisan migrate
And that's it, you should be good to go now.
###WebHooks:
We using spatie/laravel-stripe-webhooks
package for stripe webhooks.
#####Configuration:
Add STRIPE_WEBHOOK_SECRET
to your .env
You can find the secret used at the webhook configuration settings on the Stripe dashboard.
run $ php artisan migrate
if you don't do it before.
Go to your your_project/app/Http/Middleware/VerifyCsrfToken.php
and add this row:
/** * The URIs that should be excluded from CSRF verification. * * @var array */ protected $except = [ '/stripe/webhook' ];
Finally, take care of the routing:
At the Stripe dashboard you must configure at what url Stripe webhooks should hit your app.
You should set it up to '/stripe/webhook'.
Example of Endpoint URL:
http://your.awesome.site/stripe/webhook
Available stripe events:
- payment_intent.succeeded
- invoice.payment_succeeded
- payment_intent.payment_failed
- charge.failed (not completed)
For 'payment_intent.payment_failed' you should set configs
'marqant-pay.payment_urls.base_url'
and 'marqant-pay.payment_urls.payment_sub_url'
,
description at config file.
You need also look at 'marqant-pay.support_emails'
config.
You can also add to project/resources/lang these keys for translate:
- "Here"
- "Payment failed."
- "Requires payment method."
- "You needs to update your payment method in the"
Don't forget: it should be json file.
Example resources/lang/en.json:
{ "Payment failed.": "Payment failed translation." }
They are used at emails for 'payment_intent.payment_failed'
event
That's all you need