Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/adcpd/symfony-stripe-integration
How to accept payments with Stripe in Symfony project
https://github.com/adcpd/symfony-stripe-integration
Last synced: about 6 hours ago
JSON representation
How to accept payments with Stripe in Symfony project
- Host: GitHub
- URL: https://github.com/adcpd/symfony-stripe-integration
- Owner: ADCPD
- Created: 2020-11-24T14:33:41.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2020-11-26T16:17:37.000Z (about 4 years ago)
- Last Synced: 2024-11-12T00:34:55.224Z (2 months ago)
- Language: PHP
- Size: 7.21 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SYMFONY STRIPE INTEGRATION
This repository is a small tutorial which explains how to integrate stripe using Symfony 5 project
and how to accept payments with Stripe##### CREATE DATABASE IF EXIST
```
php app/console doctrine:database:create --if-not-exists
php app/console doctrine:schema:update --force
php app/console doctrine:fixtures:load
```##### INSTALL STRIPE composant
STRIPE DASHBOARD DEBUG : https://dashboard.stripe.com/test/logs
```
composer require stripe/stripe-php
```STRIPE DOC : https://stripe.com/docs/payments/accept-a-payment?integration=elements
Expose root :```PHP
/**
* @Route(
* "/create-checkout-session",
* name="stripe-create-checkout-session",
* options={"expose"=true},
* methods={"GET","POST"}
* )
*/
public function create(
StripeService $stripeService
): Response
{
#your code here
}
```
Next you have to generate js Route```
bin/console fos:js-routing:dump --format=json --target=public/bundles/js/fos_js_routes.json
```MAPPING :
CHECKOUT PROCESS into [StripeController](./src/Controller/StripeController.php) and [StripeService](./src/Services/StripeService.php)
CHECKOUT JS PROCESS into [checkout.html.twig](./templates/default/checkout.html.twig)