wysow / wysow-postfinance

PostFinance PHP library based on Marlon Ogone library
MIT License
2 stars 8 forks source link

Laravel Installation #2

Closed prometherion closed 8 years ago

prometherion commented 8 years ago

I'm using Laravel > 5 and I'm failing requiring the package via composer: anyone has a solution?

wysow commented 8 years ago

@prometherion can you provide the error message you get from composer? Thanks.

prometherion commented 8 years ago

First of all I tried to install via classic composer: ``composer require wysow/postfinance The package is installed and placed in the vendor folder but libraries are not aligned to the GitHub repo: vendor/wysow/postfinance/lib/Ogone insted of vendor/wysow/postfinance/lib/Postfinance All the file in the lib are namespaced Ogone instead of Postfinance: maybe something's wrong with Packagist?

wysow commented 8 years ago

Can you try to manually delete all the files of this lib and re-install it, I did manually update the packagist page of the lib.

wysow commented 8 years ago

@prometherion did you try to re-install the lib? Keep me posted please so I can help further if needed.

prometherion commented 8 years ago

I'm sorry but no result :( I even tried to install it outside a Laravel project but I get always the Ogone library instead of PostFinance: it seems that Composer imports the original GitHub project and not the forked one.

wysow commented 8 years ago

Can you provide the full error message when using composer require wysow/postfinance -vvv so I can try to understand and help you better...

prometherion commented 8 years ago
vagrant@precise64:~/test$ composer require wysow/postfinance -vvv
Reading ./composer.json
Loading config file /home/vagrant/.composer/config.json
Loading config file /home/vagrant/.composer/auth.json
Loading config file ./composer.json
Checking CA file /etc/ssl/certs/ca-certificates.crt
Executing command (/home/vagrant/test): git branch --no-color --no-abbrev -v
Executing command (/home/vagrant/test): git describe --exact-match --tags
Failed to initialize global composer: Composer could not find the config file: /home/vagrant/.composer/composer.json
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
Downloading https://packagist.org/packages.json
Writing /home/vagrant/.composer/cache/repo/https---packagist.org/packages.json into cache
Downloading http://packagist.org/p/provider-2013%2462bc0fdfa9848b67125be95941137fac4252f855ccd0e9fe62ffe9798711d941.json
Writing /home/vagrant/.composer/cache/repo/https---packagist.org/p-provider-2013.json into cache
Downloading http://packagist.org/p/provider-2014%2420297523ab8190a374455f585250c5b61a3e3da5b26fd3f57565a37f98070d23.json
Writing /home/vagrant/.composer/cache/repo/https---packagist.org/p-provider-2014.json into cache
Downloading http://packagist.org/p/provider-2015%2445c163224e462b5f9301454e2182cb7e21fe929f340f50d90abc0db5a5b5474b.json
Writing /home/vagrant/.composer/cache/repo/https---packagist.org/p-provider-2015.json into cache
Downloading http://packagist.org/p/provider-2015-07%240d96ffb43b3c374b5abb005a6db0f2b189e08171427e538e120c7b1d7c8ce960.json
Writing /home/vagrant/.composer/cache/repo/https---packagist.org/p-provider-2015-07.json into cache
Downloading http://packagist.org/p/provider-2015-10%24771591ce6ff7a83cd2a2b87e1f9f578d2ab1d28f78b295a3e5b6278b589baed6.json
Writing /home/vagrant/.composer/cache/repo/https---packagist.org/p-provider-2015-10.json into cache
Downloading http://packagist.org/p/provider-2016-01%2454bcf771361381a2142ac2d0e1b1145f73ca39a83d816b01c5a1c69fc3036991.json
Writing /home/vagrant/.composer/cache/repo/https---packagist.org/p-provider-2016-01.json into cache
Downloading http://packagist.org/p/provider-2016-04%247527831c6d89f9d4abad2975002ad87d0a8aa601c62b5c0bd7db53fc8e96d10d.json
Writing /home/vagrant/.composer/cache/repo/https---packagist.org/p-provider-2016-04.json into cache
Downloading http://packagist.org/p/provider-archived%241b17502997534b65bf7bd1ddbc8d1527da4dc7d5ecbcb28430b55905ceba85bd.json
Writing /home/vagrant/.composer/cache/repo/https---packagist.org/p-provider-archived.json into cache
Downloading http://packagist.org/p/provider-latest%24526375a2a479635c25c68e586fe03411be354c1cc77015c7e276bb701f10ac8d.json
Writing /home/vagrant/.composer/cache/repo/https---packagist.org/p-provider-latest.json into cache
Downloading http://packagist.org/p/wysow/postfinance%24bd908b540893098d3ce7ad8733a28a59e70151b5e02f4c350989009b4f7df85c.json
Writing /home/vagrant/.composer/cache/repo/https---packagist.org/provider-wysow$postfinance.json into cache
Using version ^2.0 for wysow/postfinance
./composer.json has been created
Reading ./composer.json
Loading config file /home/vagrant/.composer/config.json
Loading config file /home/vagrant/.composer/auth.json
Loading config file ./composer.json
Executing command (/home/vagrant/test): git branch --no-color --no-abbrev -v
Executing command (/home/vagrant/test): git describe --exact-match --tags
Failed to initialize global composer: Composer could not find the config file: /home/vagrant/.composer/composer.json
To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
Loading composer repositories with package information
Downloading https://packagist.org/packages.json
Writing /home/vagrant/.composer/cache/repo/https---packagist.org/packages.json into cache
Updating dependencies (including require-dev)
Reading /home/vagrant/.composer/cache/repo/https---packagist.org/p-provider-2013.json from cache
Reading /home/vagrant/.composer/cache/repo/https---packagist.org/p-provider-2014.json from cache
Reading /home/vagrant/.composer/cache/repo/https---packagist.org/p-provider-2015.json from cache
Reading /home/vagrant/.composer/cache/repo/https---packagist.org/p-provider-2015-07.json from cache
Reading /home/vagrant/.composer/cache/repo/https---packagist.org/p-provider-2015-10.json from cache
Reading /home/vagrant/.composer/cache/repo/https---packagist.org/p-provider-2016-01.json from cache
Reading /home/vagrant/.composer/cache/repo/https---packagist.org/p-provider-2016-04.json from cache
Reading /home/vagrant/.composer/cache/repo/https---packagist.org/p-provider-archived.json from cache
Reading /home/vagrant/.composer/cache/repo/https---packagist.org/p-provider-latest.json from cache
Reading /home/vagrant/.composer/cache/repo/https---packagist.org/provider-wysow$postfinance.json from cache
Resolving dependencies through SAT
Dependency resolution completed in 0.001 seconds
Analyzed 70 packages to resolve dependencies
Analyzed 67 rules to resolve dependencies
  - Installing wysow/postfinance (2.0.2)
Downloading https://api.github.com/repos/wysow/wysow-postfinance/zipball/20c6d33a1bde758f2c23e4232fbf881ca515411e
    Downloading: 100%         
Writing /home/vagrant/.composer/cache/files/wysow/postfinance/3b6f670198d15e928b87d9b00c9f2c616007f0ef.zip into cache from /home/vagrant/test/vendor/wysow/postfinance/fc20c965d29ee64063008f0223d844b7
    Extracting archive

    REASON: Required by the root package: Install command rule (install wysow/postfinance 2.0.0|install wysow/postfinance 2.0.1|install wysow/postfinance 2.0.2)

Reading /home/vagrant/test/vendor/composer/installed.json
Writing lock file
Generating autoload files
prometherion commented 8 years ago

Obviously i cleaned up the composer cache before requiring the package

wysow commented 8 years ago

As far as I can see, everything went well in this installation log, so problem is fixed right?

prometherion commented 8 years ago

Nope! :(

vagrant@precise64:~/test/vendor/wysow/postfinance/lib/Ogone$ ls -a -l
total 80
drwxrwxr-x 8 vagrant vagrant 4096 Apr 21 07:47 .
drwxrwxr-x 3 vagrant vagrant 4096 Apr 21 07:47 ..
-rw-rw-r-- 1 vagrant vagrant 5652 Apr 21 07:47 AbstractPaymentRequest.php
-rw-rw-r-- 1 vagrant vagrant 1209 Apr 21 07:47 AbstractPaymentResponse.php
-rw-rw-r-- 1 vagrant vagrant 7755 Apr 21 07:47 AbstractRequest.php
-rw-rw-r-- 1 vagrant vagrant 3000 Apr 21 07:47 AbstractResponse.php
drwxrwxr-x 2 vagrant vagrant 4096 Apr 21 07:47 DirectLink
drwxrwxr-x 2 vagrant vagrant 4096 Apr 21 07:47 Ecommerce
drwxrwxr-x 3 vagrant vagrant 4096 Apr 21 07:47 FormGenerator
-rw-rw-r-- 1 vagrant vagrant  727 Apr 21 07:47 HashAlgorithm.php
drwxrwxr-x 2 vagrant vagrant 4096 Apr 21 07:47 ParameterFilter
-rw-rw-r-- 1 vagrant vagrant  685 Apr 21 07:47 Passphrase.php
-rw-rw-r-- 1 vagrant vagrant  130 Apr 21 07:47 PaymentRequest.php
-rw-rw-r-- 1 vagrant vagrant 1009 Apr 21 07:47 PaymentResponse.php
-rw-rw-r-- 1 vagrant vagrant  461 Apr 21 07:47 Request.php
-rw-rw-r-- 1 vagrant vagrant  409 Apr 21 07:47 Response.php
drwxrwxr-x 2 vagrant vagrant 4096 Apr 21 07:47 ShaComposer
drwxrwxr-x 2 vagrant vagrant 4096 Apr 21 07:47 Subscription

As you can see the lib is always Ogone: as proof the TEST constant defined in DirectLink/DirectLinkPaymentRequest.php is https://secure.ogone.com/ncol/test/orderdirect.asp instead of https://e-payment.postfinance.ch/ncol/test/orderdirect.asp (the new test end-point: on GitHub it refers to old one, https://secure.PostFinance.com/ncol/test/orderdirect.asp)

wysow commented 8 years ago

Oh my bad! I understand now... Just made a new release to validate the switch to PostFinance namespace, can you retry?

prometherion commented 8 years ago

Hell yeah, it works! :) Next days I will send you a PR to update the PostFinance API end-point.

wysow commented 8 years ago

Good to hear that! Your PR is welcome.