Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yii 2 port #5

Open
alexandernst opened this issue May 23, 2014 · 29 comments
Open

Yii 2 port #5

alexandernst opened this issue May 23, 2014 · 29 comments

Comments

@alexandernst
Copy link
Contributor

I'm wondering if this plugin will be ported to Yii 2 (or if it's already compatible with Yii 2)?

@makasim
Copy link
Member

makasim commented May 23, 2014

@alexandernst

Unfortunately, it has not been ported yet. It definitely will be but the problem is I dont use Yii 1\2 in day by day work. Its hard to keep it up to day and in sync with payum library (as I do with PayumBundle for Symfony).

Would be good if some take care of the extension and maintain it. Someone who know Yii very well. I'd more than happy to help such guy to understand Payum.

@alexandernst
Copy link
Contributor Author

@makasim I'm asking because I'm considering using Yii 1 or Yii 2 in a project I'm starting and I know I'll depend heavily on PayPal.

What is the state of this extension regarding Yii 1? Are there known bugs or missing features?
If yes, then maybe it would be better if someone (maybe me 😄 ) fixed those in first place, before trying to port it to Yii 2.

@makasim
Copy link
Member

makasim commented May 23, 2014

@alexandernst I've tested payum 0.7 (I believe) with yii sandbox and paypal express checkout. Since then some bugs were fixed in paypal lib itself not really critical.

So It really possible (yii1) to use it with paypal even recurring or referenced payments.

@makasim
Copy link
Member

makasim commented May 23, 2014

Yii extension does not provide support for notifications yet.

@alexandernst
Copy link
Contributor Author

@makasim By "notifications" you mean a proper IPN handler that will save messages?

@makasim
Copy link
Member

makasim commented May 23, 2014

yes, the lib provide some tools to mange them, but it is not fully supported, youd have to write some code to make IPN work.

@alexandernst
Copy link
Contributor Author

@makasim Ok, I'll be using Yii 1 then and try to make IPN work decently. The hard part will be the cron task (some IPN replies may fail so they must be sent back again at some point in the future).

BTW, I'll also try to push the other 2 issues once I'm done with the project itself and the notifications handler.

@makasim
Copy link
Member

makasim commented May 23, 2014

Sounds good, contact me ([email protected]) if you need any help.

@alexandernst
Copy link
Contributor Author

Ok, I'm done with the rest of the project I was talking about, it's time to implement the PayPal part. I saw the basic "how to install" and then did it. Some quick questions:

  1. I see that at least the PayPal Express and PayPal IPN extensions require payum 0.6.*, but the latest payum is 0.9.2 (some critical bugfixes were done in that gap). Is that left on purpose?
  2. The vendor folder contains the entire Yii framework, which I already have in another folder. Can I delete it and use just payum (aside with kriswallsmith and twig extensions)?

@alexandernst
Copy link
Contributor Author

Also, I nocited that even in the master branch, the Yii extension points to Core 0.8.x.

Should I start by updating all those to the latest available stable release?
If "yes", are there any breaking API changes?

@alexandernst
Copy link
Contributor Author

Yet another question: Why is composer installing payum/paypal-express-checkoutnvp version 0.6.4 when my composer.json is configured to @stable. Where is that version matching set?

@makasim
Copy link
Member

makasim commented Jul 14, 2014

I see that at least the PayPal Express and PayPal IPN extensions require payum 0.6.*, but the latest payum is 0.9.2 (some critical bugfixes were done in that gap). Is that left on purpose?

there we some fixes, not that serious. The fixes more about architecture of library (with BC breaks) and new features and payments. BC breaks listed here https://github.com/Payum/Payum/blob/master/UPGRADE.md

I am not sure why it installs 0.6, I believe it has to install 0.7 version at least because there is such release of extension for Yii. https://github.com/Payum/PayumYiiExtension/releases

The vendor folder contains the entire Yii framework, which I already have in another folder. Can I delete it and use just payum (aside with kriswallsmith and twig extensions)?

You can put it whenever you want and use your version (your autoload has to take over the composer one) but composer installs it to vendor too because of this requirments https://github.com/Payum/PayumYiiExtension/blob/master/composer.json. I dont know how yii developers do the job ,so maybe putting such requirements is not that good. We can drop it, but in this case we have to descrtibe the way it has to integrated to Yii.

@makasim
Copy link
Member

makasim commented Jul 14, 2014

Also, I nocited that even in the master branch, the Yii extension points to Core 0.8.x.
Should I start by updating all those to the latest available stable release?
If "yes", are there any breaking API changes?

I've not worked on the extension lately so it maybe out of sync with the rest of the lib. It definitly be good to update it to the latest version. Here's the list of BC breaks: https://github.com/Payum/Payum/blob/master/UPGRADE.md

@makasim
Copy link
Member

makasim commented Jul 14, 2014

I can help you with payum related stuff if you will be able to test its integration to yii framework.

@alexandernst
Copy link
Contributor Author

Ok, I'll start by updating to latest stable. I usually code with Sublime Text 2, but maybe an IDE would be better for this particular case? What do you use?

Do you have any code-checking tool setup so that I can be sure that I'm not breaking anything?

@makasim
Copy link
Member

makasim commented Jul 14, 2014

I am using phpstorm, there also a sandbox where I test it: https://github.com/makasim/PayumYiiSandbox

@makasim
Copy link
Member

makasim commented Jul 14, 2014

You may try to use it too

@alexandernst
Copy link
Contributor Author

Ok, I think I setup the Yii Sandbox successfully. The expected result is (after logging in with my sandbox paypal account) a simple text-only json-style result page describing the operation, right?

About PHPStorm, there is a Linux version (yay!) but it's a 30 days trial, so let's hope I can finish fixing everything in that time :)

Do you have a project file uploaded somewhere or should I create it?

@makasim
Copy link
Member

makasim commented Jul 14, 2014

a simple text-only json-style result page describing the operation, right?

right!

Do you have a project file uploaded somewhere or should I create it?

there is not any need for that,

@alexandernst
Copy link
Contributor Author

After #6 composer install installs the right paypal ipn/express versions :)

Next thing, remove Yii's dependency (or rather, make it some sort of 'soft' dependency so composer can skip it and let the user configure the right path to the Yii framework). I had a quick look at the vendor/composer folder but I couldn't find where Yii gets loaded. Any tips?

@makasim
Copy link
Member

makasim commented Jul 14, 2014

@alexandernst here: https://github.com/Payum/PayumYiiExtension/blob/master/composer.json#L41

We can move it to suggest section.

@alexandernst
Copy link
Contributor Author

Yes, that will make composer stop installing Yii, but what about the class-loading?
Where is the part of the code in Payum-Yii that says "hey, Yii Framework is located /at/this/path so use it"?

@makasim
Copy link
Member

makasim commented Jul 14, 2014

In this case you have to manually configure a composer.json autoload section in your project.

@makasim
Copy link
Member

makasim commented Jul 14, 2014

I dont see other ways... we require it or we setup it manually.

@alexandernst
Copy link
Contributor Author

Hmmm. Let's think about it as a plain Yii extension that people would install and expect to just-work (tm).
Being an extension, it should go inside the protected/extensions folder in a Yii project. Which means that the user should already have inserted payum in the components section of the project.

That means that we actually don't need to load anything as Yii is the one that will load the extension. So, yup, we should just move yii to the suggests seciton in the composer.json :)
Will write a patch in a moment

@iadj
Copy link

iadj commented Feb 25, 2016

Any news on this? Would love to use a Yii2 module for Payum.

@makasim
Copy link
Member

makasim commented Feb 25, 2016

I've never worked with Yii and dont plan to work with it. So if you need it working with Yii2. Please do it yourself. I help you with Payum part.

@alexandernst
Copy link
Contributor Author

I was assigned shortly an year ago to this project, but then my boss changed his mind I never could finish the job. I still want to do it, I just don't get to find any spare time :(

@iadj
Copy link

iadj commented Feb 28, 2016

Opened a git for making a Payum Yii2 module: https://github.com/iadj/yii2-payum

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants