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

Install fusio/adapter-stripe error. It looks like version not compatible. How can I solve it? #504

Open
cococonuts opened this issue May 5, 2023 · 16 comments
Labels

Comments

@cococonuts
Copy link

sudo composer require fusio/adapter-stripe:*
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Continue as root/super user [yes]? yes
./composer.json has been updated
Running composer update fusio/adapter-stripe
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

Problem 1
- laminas/laminas-code 4.7.0 requires php >=7.4, <8.2 -> your php version (8.2.5) does not satisfy that requirement.
- doctrine/migrations 2.3.5 requires friendsofphp/proxy-manager-lts ^1.0 -> satisfiable by friendsofphp/proxy-manager-lts[v1.0.13].
- fusio/impl v6.3.8 requires doctrine/migrations ^2.3 -> satisfiable by doctrine/migrations[2.3.5].
- friendsofphp/proxy-manager-lts v1.0.13 requires laminas/laminas-code ~3.4.1|^4.0 -> satisfiable by laminas/laminas-code[4.7.0].
- fusio/impl is locked to version v6.3.8 and an update of this package was not requested.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

@chriskapp
Copy link
Member

Hi @cococonuts could you explicit try to use the version v5.2.0 i.e. with composer require fusio/adapter-stripe ^5.0 we use this version also in our docker image, at our docker image we still use PHP 8.0. In general we are currently also working on a new release where we update many dependencies and we will then also update the docker PHP version.

@cococonuts
Copy link
Author

cococonuts commented May 5, 2023

hi @chriskapp
I got the same issue with "sudo composer require fusio/adapter-stripe ^5.0". Is it because I installed php 8.2?

I tried this tricky method, install adapter-strip with gnore-platform-reqs option. It works and I can config stripe with API key in fusio admin.
"composer require fusio/adapter-stripe ^5.0 --ignore-platform-reqs"

However, when I purchase subscription in developer app, it goes to error 500. What else should I install for stripe payment?
POST | https://myhost.com/index.php/consumer/payment/stripe/checkout return 500

image

@cococonuts
Copy link
Author

Do you have dev document for how to debug the router/issue in fusio?

@chriskapp
Copy link
Member

Hi @cococonuts, could you check the PHP error logs, there should be an error regarding this issue, I would also assume that this is probably a problem regarding PHP 8.2

@cococonuts
Copy link
Author

cococonuts commented May 7, 2023

I just start to use PHP, so not very familiar with PHP debugging. I have no idea where is PHP log. Is the error.log in the /var/log/nginx/?

I also tried to modify /etc/php/8.2/fpm/php.ini and /etc/php/8.2/cli/php.ini to make the error_log=/var/log/nginx/error.log
But the it is still empty in error.log.

@cococonuts
Copy link
Author

cococonuts commented May 8, 2023

@chriskapp , I got the error log. Do you have any thoughts? Thank you :)
I find the latest source code of fusio-engine in github, getDomain exists but there is no getDomain in my version.
How can I update the fusio-engine?

psx.ERROR: Call to undefined method Fusio\Engine\Payment\CheckoutContext::getDomain() {"file":"/var/www/fusio/html/vendor/fusio/adapter-stripe/src/Provider/Stripe.php","line":84,"trace":"
#0 /var/www/fusio/html/vendor/fusio/impl/src/Service/Payment.php(87): Fusio\Adapter\Stripe\Provider\Stripe->checkout()\n
#1 /var/www/fusio/html/vendor/fusio/impl/src/Consumer/Action/Payment/Checkout.php(54): Fusio\Impl\Service\Payment->checkout()\n
#2 /var/www/fusio/html/vendor/fusio/engine/src/Processor.php(77): Fusio\Impl\Consumer\Action\Payment\Checkout->handle()\n
#3 /var/www/fusio/html/vendor/fusio/impl/src/Service/Action/Invoker.php(77): Fusio\Engine\Processor->execute()\n
#4 /var/www/fusio/html/vendor/fusio/impl/src/Controller/SchemaApiController.php(154): Fusio\Impl\Service\Action\Invoker->invoke()\n
#5 /var/www/fusio/html/vendor/fusio/impl/src/Controller/SchemaApiController.php(109): Fusio\Impl\Controller\SchemaApiController->executeAction()\n
#6 /var/www/fusio/html/vendor/psx/framework/src/Controller/ControllerAbstract.php(135): Fusio\Impl\Controller\SchemaApiController->doPost()\n
#7 /var/www/fusio/html/vendor/psx/http/src/Filter/FilterChain.php(79): PSX\Framework\Controller\ControllerAbstract->handle()\n
#8 /var/www/fusio/html/vendor/fusio/impl/src/Controller/Filter/Logger.php(61): PSX\Http\Filter\FilterChain->handle()\n
#9 /var/www/fusio/html/vendor/psx/http/src/Filter/FilterChain.php(79): Fusio\Impl\Controller\Filter\Logger->handle()\n
#10 /var/www/fusio/html/vendor/fusio/impl/src/Controller/Filter/RequestLimit.php(61): PSX\Http\Filter\FilterChain->handle()\n
#11 /var/www/fusio/html/vendor/psx/http/src/Filter/FilterChain.php(79): Fusio\Impl\Controller\Filter\RequestLimit->handle()\n
#12 /var/www/fusio/html/vendor/fusio/impl/src/Controller/Filter/Authentication.php(59): PSX\Http\Filter\FilterChain->handle()\n
#13 /var/www/fusio/html/vendor/psx/http/src/Filter/FilterChain.php(79): Fusio\Impl\Controller\Filter\Authentication->handle()\n
#14 /var/www/fusio/html/vendor/fusio/impl/src/Controller/Filter/AssertMethod.php(85): PSX\Http\Filter\FilterChain->handle()\n
#15 /var/www/fusio/html/vendor/psx/http/src/Filter/FilterChain.php(79): Fusio\Impl\Controller\Filter\AssertMethod->handle()\n
#16 /var/www/fusio/html/vendor/psx/http/src/Filter/UserAgentEnforcer.php(43): PSX\Http\Filter\FilterChain->handle()\n
#17 /var/www/fusio/html/vendor/psx/http/src/Filter/FilterChain.php(79): PSX\Http\Filter\UserAgentEnforcer->handle()\n
#18 /var/www/fusio/html/vendor/psx/http/src/Filter/CORS.php(86): PSX\Http\Filter\FilterChain->handle()\n
#19 /var/www/fusio/html/vendor/psx/http/src/Filter/FilterChain.php(79): PSX\Http\Filter\CORS->handle()\n
#20 /var/www/fusio/html/vendor/psx/framework/src/Loader/Loader.php(91): PSX\Http\Filter\FilterChain->handle()\n
#21 /var/www/fusio/html/vendor/psx/framework/src/Loader/Loader.php(73): PSX\Framework\Loader\Loader->execute()\n
#22 /var/www/fusio/html/vendor/psx/framework/src/Dispatch/Dispatch.php(95): PSX\Framework\Loader\Loader->load()\n
#23 /var/www/fusio/html/vendor/psx/engine/src/WebServer/Engine.php(52): PSX\Framework\Dispatch\Dispatch->route()\n
#24 /var/www/fusio/html/vendor/psx/framework/src/Environment/Environment.php(54): PSX\Engine\WebServer\Engine->serve()\n
#25 /var/www/fusio/html/public/index.php(28): PSX\Framework\Environment\Environment->serve()\n
#26 {main}","code":0,"severity":null} []

@chriskapp
Copy link
Member

@cococonuts ok this looks indeed like you have an older version installed, could you run in your folder the composer info command to see which versions are currently installed? You should have version v5.4.3 installed of the fusio/engine package.

@cococonuts
Copy link
Author

@chriskapp
I upgrade the fusio-engine to v5.4.3. It works!

But I have new questions:
why I don't have Contract and invoices in "Monetization"
image

I successfully purchase a subscription and one-time plan. I can't find transaction recording in fusio portal.
What else should I config?

@chriskapp
Copy link
Member

@cococonuts so great that this works, in a later version we have removed our internal billing system and the Contract/Invoice panel, since all this can be handled by the payment provider i.e. stripe which has much more options to customize your billing setup. You need to create a stripe connection and then register a payment webhook at the stripe portal which calls your Fusio instance at /system/payment/stripe/webhook, then you also need to set the webhook secret at the system / settings payment_stripe_secret. Then you should see all incoming transactions.

@cococonuts
Copy link
Author

cococonuts commented May 10, 2023

@chriskapp Got your point.
I have set up webhook on stripe website and payment_stripe_secret on fusio admin portal.
But I have not got transactions data.

I guess perhaps I didn't set up endpoint on strip webhook correctly
My fusio app link is: https://myhost.com/apps/fusio
The actual https router is https://myhost.com/index.php/

So which endpoint in stripe webhook should be set:
https://myhost.com/apps/fusio/system/payment/stripe/webhook
or
https://myhost.com/index.php/system/payment/stripe/webhook

I didn't find webhook related document. Do you have a updated developer document?

@chriskapp
Copy link
Member

yes, so you would need to use the url which points directly to your Fusio instance, in your case:
https://myhost.com/index.php/system/payment/stripe/webhook

@cococonuts
Copy link
Author

cococonuts commented May 10, 2023

@chriskapp
vendor/fusio/adapter-stripe/src/Provider/Stripe.php : portal(...)
$externalId = $user->getExternalId();

externalId is empty. Where can I set the externalId for user?
image

How to set up the billing portal? So that use can view the billing portal.
Do I need to setup payment_stripe_portal_configuration? Where can I find The stripe portal configuration id?

@cococonuts
Copy link
Author

@chriskapp I solved the billing portal problem.
I didn't find an entry-point for user cancel the subscription. How can an user cancel the subscription?

@cococonuts
Copy link
Author

@chriskapp
Another question:
If user buy more than one subscriptions, will the points/credit added up?

@chriskapp
Copy link
Member

Hey @cococonuts yes so regarding the external id, this value is also set via the stripe webhook, then a user gets the fitting external id. If the user has an external id he is able to visit the visit billing portal where he can also cancel a subscription. Regarding the points, yes so every time a user buys points those points are added to the existing points.

@cococonuts
Copy link
Author

cococonuts commented May 11, 2023

@chriskapp
I could purchase subscription and visit billing portal with one account
But I didn't find "Cancel subscription" function on the developer App.
Do I need to implement it by myself? Could you share some details?

Here is my stripe billing portal, there is no "Cancel subscription" entry point.
image

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

No branches or pull requests

2 participants