Inchoo / magento2-Inchoo_Stripe

Stripe payment gateway Magento2 extension
56 stars 36 forks source link

Official Stripe library - proper way to implement #1

Closed ivanweiler closed 9 years ago

ivanweiler commented 9 years ago

We need to see what is proper way to implement official lib in Magento2, respect DI and testability.

udovicic commented 9 years ago

Stripes library should be placed under /lib/internal/Stripe. Since that folder is in include path, it can be loaded through autoloader. Payment class should receive Stripe class through its _ _construct().

ivanweiler commented 9 years ago

I remembered why I didn't follow autoload the first time, problem with /data/ ? https://github.com/Inchoo/magento2-Inchoo_Stripe/blob/master/_resources/stripe-php-latest/stripe-php-1.17.1/lib/Stripe/ApiRequestor.php#L421

udovicic commented 9 years ago

.crt file is referenced relatively to file that is requesting it. As long as directory structure remains the same, there should not be any problems.

ivanweiler commented 9 years ago

@udovicic Should we place Stripe lib (https://github.com/stripe/stripe-php) to /vendor/ now with Composer? Is that more preferred now in Magento2?

https://github.com/stripe/stripe-php/blob/master/composer.json

Maybe to install extension with: composer require inchoo/stripe: [version] + packagist publish

udovicic commented 9 years ago

@ivanweiler In spirit of Magento 2, yes everything should go through composer.

Take a look at composer branch. It is forked from develop.