Flag of Ukraine
SymfonyCasts stands united with the people of Ukraine
This course is archived!
This tutorial uses an older version of Symfony of the stripe-php SDK. The majority of the concepts are still valid, though there *are* differences. We've done our best to add notes & comments that describe these changes.

Your Stripe Dashboard

Video not working?

It looks like your browser may not support the H264 codec. If you're using Linux, try a different browser or try installing the gstreamer0.10-ffmpeg gstreamer0.10-plugins-good packages.

Thanks! This saves us from needing to use Flash or encode videos in multiple formats. And that let's us get back to making more videos :). But as always, please feel free to message us.

So you want to handle payment on the web? You brave, foolish soul :).

Nah, it's fine - these days, handling credit card payments is a blast. Especially with Stripe - an awesome service we've used on KnpU for years.

But let's be real: you're dealing with people's money, so don't muck it up! If you screw up or do something insecure, there could be real consequences. You will at least have an angry customer. So I guess this tutorial is all about accepting money and having happy customers.

So let's build a real-life, robust payment system so that when things go wrong - because they will - we fail gracefully, avoid surprises and make happy customers.

Code Along with Me. Do it!

As always, I beg you, I implore you, to code along with me! To do that, download the course code on this page, unzip it, and move into the start/ directory. That will give you the same code I have here.

This is a Symfony project, but we'll avoid going too deep into that stuff because I want to focus on Stripe. Inside, open the README.md file and follow the setup details to get the project running. The last step is to open your favorite console app, move into the directory, and run:

php bin/console server:run

to start up the built-in web server.

Our Great Idea: Sheep Shear Club

But before you start collecting any money, you need to come up with that next, huge idea. And here at KnpUniversity, we're convinced we've uncovered the next tech unicorn.

Ready to find out what it is? Open your browser, and go to:

http://localhost:8000

That's right: welcome to The Sheep Shear Club, your one-stop shop for artisanal shearing accessories for the most dapper of sheep. Purchase cutting-edge individual products - like one of our After-Shear scents - or have products delivered directly to your farm with a monthly subscription.

Gosh, it's shear luck that we got to this idea first. Once we finish coding the checkout, our competition will be feeling sheepish.

But the site is pretty simple: we have a login page - the password is breakingbaad. After you login, you can add items to your cart and they'll show up on the checkout page. But notice, there is no checkout form yet. That's our job.

Getting to Know your Stripe Dashboard

The first step towards that is to sign up with a fancy new account on Stripe. Once you're in, you'll see this: your new e-commerce best friend: the Stripe dashboard.

There is a lot here, but right now I want you to notice that there are two environments: "test" and "live". These are like two totally separate databases full of orders, customers and more, and you can just switch between them to see your data.

Also, once you login, when you read the Stripe documentation, it will actually pre-fill your account's API keys into code examples.

Let's use those docs to put in our checkout form!

Leave a comment!

52
Login or Register to join the conversation
Yukako Avatar

Oh one more thing..
no matter if you update this course to save my life or not.. This plattform is worth every penny !!
big thank to all of you ! 🙏🏼

1 Reply

We're glad to hear that you're liking our content :)

Reply
Miles Avatar

Thanks for the course. It definitely helps with understanding some of the concepts but it seems quite out of date now. There doesn't seem to be anywhere else that provides a tutorial on how to integrate stripe with Symfony 5. It's frustrating trying to figure out what goes where in which file.

Are there any updates on when the course might be updated?

Reply

Hey Miles,

Thank you for your interest in SymfonyCasts tutorials! We are definitely going to update this course with latest Stripe API, but unfortunately we still don't have any estimations when it might happen. We really want to do it this year, but there's many upcoming tutorials we're working on that will be released first.

Thank you for your patience and understanding!

Meanwhile, except the new 3D Secure authorization which this tutorial does not cover, other concepts should be still relevant. I see the problem, the course is based on an older version of Symfony 3 that is not maintained anymore. If you don't know Symfony 5 yet, I'd recommend you to follow our Symfony 5 track first: https://symfonycasts.com/tr... . If you do, probably would be easier to start a new Symfony 5 project from scratch and try to apply the Stripe integration we're showing in this course.

As always, if you will be blocked somewhere in the middle of the course following it on a newer version of Symfony - please, let us know in the comments and we will try to help!

I hope this helps, sorry for any inconvenience!

Cheers!

Reply
Yukako Avatar

Dear Ryan,
pleaaase please please update this course 🙏🙏🙏
I am desperate because I do not see through.
I am losing an important job on which my existence depends. 😩😩

Don't leave me down, please.

I extend my membership of Symfonycasts to 3021 😜

🙏🙏🙏🙏

Reply

Hey Yukako!

Thank you for your interest in SymfonyCasts tutorials! I see, Ecommerce is complex and always evolves. But still, most of the concepts that we're explaining in this tutorial are still valid for today, though I agree, this tutorials requires upgrade. Unfortunately, we haven't planned this course update yet. Right now we're working on a few other tutorials that we want to release soon. I count our voice to push up this tutorial upgrade, but can't say much when it might happen, sorry.

Thank you for your patience!

P.S. Did you finish this course? Or are you blocked at some point when following it? Please, feel free to ask questions below the video where you are stuck. And if you have some ideas about what exactly is outdated in this tutorial and why exactly you think this course should be upgraded, like what topics are missed, etc. - please, share with us! It is definitely useful when we will plan its update.

Cheers!

Reply

Hello Ryan, Thank you for your great courses !
I have to do a work with symfony 4 and the latest stripe version 3 with SCA (needed in Europe).
Can you suggest us a GitHub repo with a working example for the new way?
Will you update this course?
Because it has changed a lot.
Please let us know.
Thank you

Reply

Hey @seyedev!

I'm not sure if I'll update this course or not - it indeed has gotten out of date. There are various comments and notes throughout the tutorial to help with any changes, but the course is definitely showing its age. And, unfortunately, if we *do* update it, it won't be too soon. If you have specific questions while you go through the tutorial, I would happy to do my best to answer them :).

Cheers!

Reply
Kiuega Avatar

Hello ! Actually the code is out of date today. The majority of people prefer Symfony 4/5. If you are interested, I completely redid the initial projects with Symfony 4 using best practices, notably integrating NodeJs and Webpack-encore. And I reorganized the files at best.

The problem is mainly in relation to Javascript since we are in Stripe V3, the way of proceeding seems completely different therefore the way of writing the form and the javascripts scripts are no longer the same. I had to keep the basic form proposed by Stripe and I didn't touch anything. An update should be done at this level so that we can obtain the same form but with current practices

PS: Sorry for my english, I'm French

Reply

Hey Kiuega !

Yea, this code is written in Symfony 3 - so the structure of the project *will* indeed be different than a Symfony 4 / 5 project.

> If you are interested, I completely redid the initial projects with Symfony 4 using best practices, notably integrating NodeJs and Webpack-encore. And I reorganized the files at best

If you're willing to share this code with others, that would be awesome :). I'd be super happy to have a link to that GitHub repository.

> The problem is mainly in relation to Javascript since we are in Stripe V3, the way of proceeding seems completely different therefore the way of writing the form and the javascripts scripts are no longer the same. I had to keep the basic form proposed by Stripe and I didn't touch anything. An update should be done at this level so that we can obtain the same form but with current practices

Yea, this is the biggest change with Stripe: they prefer you to use their pre-built forms (Stripe elements) instead of building your own form and JavaScript handling. It actually makes life easier (less for us as developers to build), which is nice. And, unfortunately, they released that system shortly after our tutorial :p. We're investigating what we want to do for updating this tutorial right now. I appreciate your comments and questions!

Cheers!

Reply
Kiuega Avatar

No problem for repositories. I will post them when I finish the training. But for the moment I am stuck in : https://symfonycasts.com/sc...
I put a comment elsewhere. There are big problems with the tests. I see errors in my logs but I can't fix them. I hope to get there soon to move forward

Reply

I just replied over there to see if we can keep you moving :)

Reply
Imad L. Avatar
Imad L. Avatar Imad L. | posted 3 years ago

old tutorial and old source code and besides the files are not same as yours,
please update,
Im using Symfony 5x
I think it is better to ask for refund.

Reply

Hey Imad,

I'm sorry if you're experiencing any issues with this course. If you have any questions or stuck somewhere - please, ask us and we would try to help you figuring out the problem.

What exactly is different? Did you download the course code and started from the start/ directory? Or did you start a new separate project? We do recommend you to download the course code on any video page - see "Download" -> "Course Code" buttons - and start coding with us from start/ directory. This way your files will exactly match the files and code in our videos. Or you can cheat and look into finish/ directory that contains the "finish" code of this course.

I hope this helps! In case this course is not something you're looking for - sure, we could refund your payment. Please, write to us directly using our contact form or email us directly.

Cheers!

Reply
Imad L. Avatar

Hi,

the tutorial was made using Symfony 3 which no one uses this anymore, it is not compatible with my project Symfony 5
if you can update please reupload the tutorial

Reply

Hey Imad,

According to the Symfony releases, version 3.4 is LTS version and will be supported until November 2020 (and security fixes even until November 2021): https://symfony.com/release... . But yeah, I see your point! Unfortunately, we do not have in plans release a new tutorial about Stripe in particular on Symfony 5 in the nearest future, there're a lot of good things we would like to release first on Symfony 5.

Therefore, I could suggest you to follow the tutorial by downloading the course code and start from the start/ folder on Symfony 3.This is still enough to understand the Stripe API and Ecommerce concepts. Actually, Symfony in this course is just an additional tool that helps to show the Stripe API and its concepts to users and nothing much. After followed this course on Symfony 3 you would be able to apply knowledge on any framework you know the best.So, after deal with Stripe concepts in this tutorial, I bet you would be able to apply all the knowledge you got on Symfony 5 project, or any other framework actually. This is the best workflow we recommend our customers to follow our tutorials.

In case you still want to follow this course on your own project, like on Symfony 5 project for example - then we will do our best to help you solving any issues you faced during following this course. Just ask questions below videos where you stuck and we will reply to you as soon as we can.

I hope this helps you!

Cheers!

Reply
Imad L. Avatar

Hi Victor,

I just done upgrading your source code to Symfony 5 instead of v3 and Stripe API to v3 instead of v2 scripts which is deprecated and the stripe costume form you made which is not acceptable by stripe anymore for security reasons.

it toke me a lot of time, I don't need to tell you that we are using Symfony to save time not to waste it.

Thanks for your reply anyway.

Reply

Hey Imad L.!

Yea, this tutorial has gotten old - we're having a conversation internally and making that more obvious so people can choose to look at the information or not. Nice job doing all the upgrades - I'm really happy you got them working :).

Cheers!

Reply
Default user avatar
Default user avatar Céline Ollagnier | posted 5 years ago

Hi KNP' teachs!

I've done the installation as said and can see the site mehhh. Composer told me that the lock file is outdated so I need updates after. Why not? But at the end of the update I've got...

[Symfony\Component\Config\Definition\Exception\InvalidConfigurationException]
The child node "from_email" at path "fos_user" must be configured.

And I can't access the site, my sheeps are in the wildddddd.
So... can I work without the updates for the course? If I start again with the "old" files it will work but if you've got an answer with the updated one I'm also OK with it.

Thanks!

Reply

Hey Céline Ollagnier, it's good to see you again! :)

Look's like FOSUserBundle has made some changes since this tutorial was released, but it's easy to fix :)
Just add this to your config.yml:


# config.yml
fos_user:
    ...
    from_email:
        address: '%mailer_sender_address%' # whatever email you want to use for this tutorial
        sender_name: '%mailer_sender_name%'

Cheers!

Reply
Default user avatar
Default user avatar Céline Ollagnier | MolloKhan | posted 5 years ago | edited

Good to "see" you gain MolloKhan
I need to learn Symfony + Stripe so... Thanks for the congif it's working :)
¡ Gracias todavía por tu ayuda Diego! Merci encore pour ton aide Diego !

Reply

I'm happy to help you, also, we have fixed our problem in our base code, if for any reason you have to download it again, you won't face this problem :)

Que tengas un buen día!

Reply
Default user avatar
Default user avatar Paolo Mazzanti | posted 5 years ago

Hello,
I experienced several errors during the initial set up of the project.

When I executed composer install I had the following error messages:

[Twig_Error_Runtime]
The "core" extension is not enabled.

Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-install-cmd event terminated with an exception

[RuntimeException]
An error occurred when executing the "'cache:clear --no-warmup'" command:

[Twig_Error_Runtime]
The "core" extension is not enabled.
.

I executed 'composer info twig/twig' as suggested in one conversation
name : twig/twig
descrip. : Twig, the flexible, fast, and secure template language for PHP
keywords : templating
versions : * v2.3.2
type : library
license : BSD 3-Clause "New" or "Revised" License (BSD-3-Clause) (OSI approved) https://spdx.org/licenses/B...
source : [git] https://github.com/twigphp/... 85e8372c451510165c04bf781295f9d922fa524b
dist : [zip] https://api.github.com/repo... 85e8372c451510165c04bf781295f9d922fa524b
names : twig/twig

autoload
psr-0
Twig_ => lib/

requires
php ^7.0
symfony/polyfill-mbstring ~1.0

requires (dev)
psr/container ^1.0
symfony/debug ~2.7
symfony/phpunit-bridge ~3.3@dev

------------------------------------------------------------------------------------------

When I executed php bin/console h:d:f:l

I've got the following error messages:

[Doctrine\DBAL\Exception\NotNullConstraintViolationException]
An exception occurred while executing 'INSERT INTO fos_user (username, username_canonical, email, email_canonical, enabled, salt, password, last_login, confirmation_token, password_re
quested_at, roles) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params ["sleek_sheep1", "sleek_sheep1", "sleek_sheep1@example.com", "sleek_sheep1@example.com", 1, null, "$2y$13$G2Jk
UMLRipnqD6V08sPCkO9TRd\/\/Bdz3MR9YMogEcwBtelm6cC.fG", null, null, null, "a:0:{}"]:
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'salt' cannot be null

[Doctrine\DBAL\Driver\PDOException]
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'salt' cannot be null

[PDOException]
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'salt' cannot be null

I'm sure enough the parameters.yml settings are correct because I used the sames in many other Symfony 3 courses of yours.

I thank you in advance for your help. Paolo

Reply

Hey Paolo!

Ah man, lame! Sorry about the issues. Let's get things figured out! And actually, this looks like *our* error! For the first, we upgraded some minor dependencies on this project, but it caused an odd conflict between the version of Twig & Symfony. I've just updated that - re-download the course code, and it should be all better. Sorry about that - but thanks for reporting it!

About the second issue, I can't repeat it: the fixtures load just fine for me. The salt column IS null, but the mapping allows for this and that's intended. So, it may have been due to the first issue - you may have possibly updated some libraries in an attempt to fix our mistake :). Try the fresh start code again, and let me know if you have any issues.

Cheers!

Reply
Default user avatar
Default user avatar Paolo Mazzanti | weaverryan | posted 5 years ago

Hello Ryan,
thank you very much for your reply.
I downloaded again the course code as you indicated.
Unfortunately I experienced the same problems.

To solve the Twig/Symfony one I ran 'composer update'.
At the end I could follow the course lessons coding anyway.

Reply

Hey Paolo Mazzanti!

Hmm, I do not get the Twig issue with the newly downloaded start code (because inside the composer.json file, you should now see twig/twig set to ^1.24.1 to avoid using Twig 2. But, as long as you got it working, it's great!

About the database issue, you're right! We have a bug in our migration. The salt column is not required in the code, but the migration makes it required. We'll fix that up - it was due to an upgrade of FOSUserBundle in the tutorial.

Cheers!

Reply
Default user avatar
Default user avatar Paolo Mazzanti | weaverryan | posted 5 years ago

Hello Ryan,
thanks a lot for your reply and your help.
What you wrote me about the twig version let me realize that, when I downloaded the course code again, I still got the old one, not the new one.
Now I could make a test running composer install with the the new code files and it works like a charm, so the Twig/Symfony problem is definitively solved.

I tested the database installation anyway and, as expected, I got the salt column error.
Now I know the reason why.

As I wrote in my previous post, I could follow the next lessons coding. Thanks to the finish folder files I could execute the correct migration on chapter 5.
I really appreciate your support. Cheers!

Reply

Hey Paolo Mazzanti!

Woohoo! And thanks to you for reporting it - this is *not* how we want the tutorial code to work :).

Cheers!

Reply
Default user avatar
Default user avatar Rodolfo Velasco | weaverryan | posted 5 years ago

Hey, have you fixed the migration error? I'm getting the salt error. Please guide on what could solve the problem.

Reply

Hey Rodolfo,

Not on the moment you asked, but now it's fixed. I added a new migration to fix "salt not null" problem and other inconsistency of mapping with DB schema, see https://github.com/knpunive... . Now fixtures should be loaded without errors, so no more "salt not null" error.

Cheers!

1 Reply
Default user avatar
Default user avatar Rodolfo Velasco | Victor | posted 5 years ago

I was able to solve the problem by copying the file you are refering to into my migrations folder. Now I'm checking the SheepShear Club website. Hope to be finishing this course soon. Thanks!!!

Reply

Great! Glad it helped. And good luck with this complex course! Well, e-commerce always complex ;)

Cheers!

1 Reply
Default user avatar
Default user avatar DannyandAndrea Avery | posted 5 years ago

When I run "php composer.phar install" I get the following error "Could not open input file: composer.phar". However, if I run "composer" I have it installed globally. So, I ran "composer install" in the directory. Not sure how to move forward. I have the following in my "parameters.yml":

parameters:
database_host: localhost
database_port: null
database_name: knpu_stripe
database_user: root
database_password: root
mailer_transport: smtp
mailer_host: 127.0.0.1
mailer_user: null
mailer_password: null
secret: ThisTokenIsNotSoSecretChangeIt

Thanks!

Reply
Default user avatar
Default user avatar DannyandAndrea Avery | DannyandAndrea Avery | posted 5 years ago

I'm also getting the following errors in the terminal:

[Doctrine\DBAL\Exception\ConnectionException]
An exception occured in driver: SQLSTATE[HY000] [2002] No such file or directory

[Doctrine\DBAL\Driver\PDOException]
SQLSTATE[HY000] [2002] No such file or directory

[PDOException]
SQLSTATE[HY000] [2002] No such file or directory

Reply

Hey Danny,

Do you have installed MySQL? Are that DB credentials in parameters.yml valid for your MySQL, i.e. your db user is root and its password is root too? Also, try to replace "localhost" with IP "127.0.0.1" in database_host parameter. Let me know if you still have this error.

Cheers!

Reply

Hey Danny,

"Could not open input file: composer.phar" error means that you don't have downloaded composer.phar file in the directory where you run this command. If you already have Composer installed globally - it makes sense. So you can replace all the commands in our screencasts which starts with "php composer.phar ..." with simple "composer ...", so you just need to run "composer install" in this case.

Cheers!

Reply
Default user avatar
Default user avatar Danny Avery | Victor | posted 5 years ago

Hey Victor,

I'm under a different account now. Ok, everything is working fine now. I replaced database_host: "localhost" with "127.0.0.1" and added my MAMP MySQL database_port: "8889". Thanks for the help!

Danny

Reply

Hey Danny,

Yeah, non-standard MySQL port is another common mistake. Glad you got it working!

Cheers!

Reply
Default user avatar
Default user avatar Henri Tompodung | posted 5 years ago

Hi Ryan..
Don't you mind if you explain step by step how to create a shopping cart in Symfony?

Reply

Hey Henri,

Well, it's simple Symfony service, which works with session, i.e. you hold order items in session. For that you probably want to create a model for order items, which will hold information about products which user want to add to the cart. You don't have to store this order items in the DB yet, just hold them in session. You also need a controller with simple CRUD operations to be able to add/edit/delete orders in your shopping card. So when a user do checkout - you will convert stored order items into real products user want to buy and add them to an order entity which in turn should be persisted in DB. Also, you have to assign the current user to this order entity to know who was made this order.

Probably you can take a look at Open Source SyliusOrderBundle which is a part of popular E-Commerce platform.

Cheers!

Reply
Default user avatar
Default user avatar Henri Tompodung | Victor | posted 5 years ago | edited

Thank you victor ... So just like a PHP native?

Reply

Actually, yes, exactly like a PHP native. But with Symfony you probably want to declare this cart as a service to use everywhere in your code base - it allows you always use a single instance of your cart and inject its service into other services. And you have to use Symfony's built-in `session` service to work with sessions inside your shopping cart service, i.e. you have to inject '@session' in it. I mean don't use low-level $_SESSION.

Reply
Default user avatar

Hello
I have error
Some parameters are missing. Please provide them.
database_host (127.0.0.1):
database_port (null):
database_name (stripe):
database_user (root):
database_password (null):
mailer_transport (smtp):
mailer_host (127.0.0.1):
mailer_user (null):
mailer_password (null):
secret (ThisTokenIsNotSoSecretChangeIt):
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache

[Twig_Error_Runtime]
The "core" extension is not enabled.

Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-install-cmd event terminated with an exception

[RuntimeException]
An error occurred when executing the ""cache:clear --no-warmup"" command:

[Twig_Error_Runtime]
The "core" extension is not enabled.

.
can you help me fix this, please?

Reply

Hey Nina

Can you tell me which version of Symfony / Twig you are installing? I believe this is a version problem between Symfony and Twig

Cheers!

Reply
Rajaona F. Avatar
Rajaona F. Avatar Rajaona F. | Nina | posted 5 years ago

Do have resolve your pbm ?

Reply
Default user avatar
Default user avatar Beleiu Iulian | posted 5 years ago

Hi,
I have some issues when I run composer install:

[RuntimeException]
An error occurred when executing the ""cache:clear --no-warmup"" command:

Fatal error: Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "LazyLoadin
gMethodInterceptor" from namespace "ProxyManager\ProxyGenerator\LazyLoadingValueHolder\MethodGenerator".
Did you forget a "use" statement for "ProxyManager\ProxyGenerator\LazyLoadingValueHolder\MethodGenerator\LazyLoadin
gMethodInterceptor"? in C:\Users\beleiui\Documents\Symfony tutorial\Stripe\Stripe Killer Payment Processing Profit
Tutorial\practice\start\vendor\ocramius\proxy-manager\src\ProxyManager\ProxyGenerator\LazyLoadingValueHolderGenerat
or.php on line 122

Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "LazyLoadingMethodInterceptor" fr
om namespace "ProxyManager\ProxyGenerator\LazyLoadingValueHolder\MethodGenerator".
Did you forget a "use" statement for "ProxyManager\ProxyGenerator\LazyLoadingValueHolder\MethodGenerator\LazyLoadin
gMethodInterceptor"? in C:\Users\beleiui\Documents\Symfony tutorial\Stripe\Stripe Killer Payment Processing Profit
Tutorial\practice\start\vendor\ocramius\proxy-manager\src\ProxyManager\ProxyGenerator\LazyLoadingValueHolderGenerat
or.php on line 122

Call Stack:
1.9888 20509544 1. Symfony\Component\Debug\ErrorHandler->handleException() C:\Users\beleiui\Documents\Symfo
ny tutorial\Stripe\Stripe Killer Payment Processing Profit Tutorial\practice\start\vendor\symfony\symfony\src\Symfo
ny\Component\Debug\ErrorHandler.php:0

PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "LazyL
oadingMethodInterceptor" from namespace "ProxyManager\ProxyGenerator\LazyLoadingValueHolder\MethodGenerator".
Did you forget a "use" statement for "ProxyManager\ProxyGenerator\LazyLoadingValueHolder\MethodGenerator\LazyLoadin
gMethodInterceptor"? in C:\Users\beleiui\Documents\Symfony tutorial\Stripe\Stripe Killer Payment Processing Profit
Tutorial\practice\start\vendor\ocramius\proxy-manager\src\ProxyManager\ProxyGenerator\LazyLoadingValueHolderGenerat
or.php:122
Stack trace:
#0 [internal function]: ProxyManager\ProxyGenerator\LazyLoadingValueHolderGenerator->ProxyManager\ProxyGenerator\{c
losure}(Object(ReflectionMethod))
#1 C:\Users\beleiui\Documents\Symfony tutorial\Stripe\Stripe Killer Payment Processing Profit Tutorial\practice\sta
rt\vendor\ocramius\proxy-manager\src\ProxyManager\ProxyGenerator\LazyLoadingValueHolderGenerator.php(95): array_map
(Object(Closure), Array)
#2 C:\Users\beleiui\Documents\Symfony tutori in C:\Users\beleiui\Documents\Symfony tutorial\Stripe\Stripe Killer Pa
yment Processing Profit Tutorial\practice\start\vendor\ocramius\proxy-manager\src\ProxyManager\ProxyGenerator\LazyL
oadingValueHolderGenerator.php on line 122

Does someone have any idea what is going on?
Thank you.

Reply

Hey Beleiu!

Ah man, sorry about this! I just downloaded the start code and it works for me. But, let's debug!

First, I can tell you that this class comes from a library called "ocramius/proxy-manager", and you should see this downloaded when you run composer install. The mystery is... why is this class missing? First, to make sure there weren't any download issues, try removing the vendor directory entirely and running composer install again. Also, what version of PHP are you using? That shouldn't make a difference, but that library can be weird sometimes with PHP versions.

Let me know, and hopefully we can fix it :).

Cheers!

Reply
Default user avatar
Default user avatar Iulian Beleiu | weaverryan | posted 5 years ago

Hey,

The problem was at composer install, I don't know exactly why this issue occur:
"The archive may contain identical file names with different capitalization (which fails on case insensitive filesystems)"
Looks like UnZip fails to unzip packages. Very strange.

Anyway the fix was to move the project in a new folder different location and run composer install again and everything works fine.

Cheers!

Reply
Rajaona F. Avatar
Rajaona F. Avatar Rajaona F. | posted 5 years ago

Twig_Error_Runtime in ExtensionSet.php line 82:
The "core" extension is not enabled.

in the project i dont know ho to enable it

Reply

Hey Rajaona F. ,

What Twig version do you use? You can check it with "$ composer info twig/twig". You can try to upgrade dependencies, most probably it'll fix the problem. Have you tried it?

Cheers!

Reply
Cat in space

"Houston: no signs of life"
Start the conversation!

This tutorial uses an older version of Symfony of the stripe-php SDK. The majority of the concepts are still valid, though there *are* differences. We've done our best to add notes & comments that describe these changes.

What PHP libraries does this tutorial use?

// composer.json
{
    "require": {
        "php": ">=5.5.9, <7.4",
        "symfony/symfony": "3.1.*", // v3.1.10
        "doctrine/orm": "^2.5", // v2.7.2
        "doctrine/doctrine-bundle": "^1.6", // 1.6.3
        "doctrine/doctrine-cache-bundle": "^1.2", // 1.3.0
        "symfony/swiftmailer-bundle": "^2.3", // v2.3.11
        "symfony/monolog-bundle": "^2.8", // 2.11.1
        "symfony/polyfill-apcu": "^1.0", // v1.2.0
        "sensio/distribution-bundle": "^5.0", // v5.0.22
        "sensio/framework-extra-bundle": "^3.0.2", // v3.0.16
        "incenteev/composer-parameter-handler": "^2.0", // v2.1.2
        "friendsofsymfony/user-bundle": "~2.0.1", // v2.0.1
        "stof/doctrine-extensions-bundle": "^1.2", // v1.2.2
        "stripe/stripe-php": "^3.15", // v3.23.0
        "doctrine/doctrine-migrations-bundle": "^1.1", // 1.1.1
        "twig/twig": "^1.24.1", // v1.35.2
        "composer/package-versions-deprecated": "^1.11" // 1.11.99
    },
    "require-dev": {
        "sensio/generator-bundle": "^3.0", // v3.0.7
        "symfony/phpunit-bridge": "^3.0", // v3.1.2
        "hautelook/alice-bundle": "^1.3", // v1.3.1
        "doctrine/data-fixtures": "^1.2" // v1.2.1
    }
}
userVoice