Page MenuHomePhorge

Remove dysfunctional Fund and Phortune prototype applications
Open, Needs TriagePublic

Description

Given the discussion below and that this code is dysfunctional, changed task scope to removing Fund and Phortune entirely.


Original task description:

  1. PHP 8.2.15, Phorge at 7a86040f8a46e9f04466186db8a2c9fed792edc3
  2. Go to http://phorge.localhost/phortune/merchant/edit/
  3. In the Name field, enter Merchant1 and click Create New Merchant
  4. Go to http://phorge.localhost/phortune/merchant/1/providers/ and click Add Payment Provider
  5. Select Add Stripe Payments Account and click Continue
  6. Enter bogus values into the two text fields and click Create Provider
[2024-01-26 18:15:25] ERROR 8192: Return type of Stripe_Object::offsetExists($k) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice at [/var/www/html/phorge/phorge/externals/stripe-php/lib/Stripe/Object.php:109]
arcanist(head=master, ref.master=6c7caf3572f4), phorge(head=phortuneMerchantPhp81, ref.master=7a86040f8a46, ref.phortuneMerchantPhp81=61afade7aee9)
  #0 require(string) called at [<phorge>/externals/stripe-php/lib/Stripe.php:33]
  #1 require_once(string) called at [<phorge>/src/applications/phortune/provider/PhortuneStripePaymentProvider.php:387]
  #2 PhortuneStripePaymentProvider::loadStripeAPILibraries() called at [<phorge>/src/applications/phortune/provider/PhortuneStripePaymentProvider.php:118]
  #3 PhortuneStripePaymentProvider::runConfigurationTest() called at [<phorge>/src/applications/phortune/controller/merchant/PhortuneMerchantProviderEditController.php:105]
  #4 PhortuneMerchantProviderEditController::handleMerchantRequest(AphrontRequest) called at [<phorge>/src/applications/phortune/controller/merchant/PhortuneMerchantController.php:32]
  #5 PhortuneMerchantController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:284]
  #6 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:203]
  #7 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]

[2024-01-26 18:15:25] ERROR 8192: Return type of Stripe_Object::offsetGet($k) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice at [/var/www/html/phorge/phorge/externals/stripe-php/lib/Stripe/Object.php:118]
arcanist(head=master, ref.master=6c7caf3572f4), phorge(head=phortuneMerchantPhp81, ref.master=7a86040f8a46, ref.phortuneMerchantPhp81=61afade7aee9)
  #0 require(string) called at [<phorge>/externals/stripe-php/lib/Stripe.php:33]
  #1 require_once(string) called at [<phorge>/src/applications/phortune/provider/PhortuneStripePaymentProvider.php:387]
  #2 PhortuneStripePaymentProvider::loadStripeAPILibraries() called at [<phorge>/src/applications/phortune/provider/PhortuneStripePaymentProvider.php:118]
  #3 PhortuneStripePaymentProvider::runConfigurationTest() called at [<phorge>/src/applications/phortune/controller/merchant/PhortuneMerchantProviderEditController.php:105]
  #4 PhortuneMerchantProviderEditController::handleMerchantRequest(AphrontRequest) called at [<phorge>/src/applications/phortune/controller/merchant/PhortuneMerchantController.php:32]
  #5 PhortuneMerchantController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:284]
  #6 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:203]
  #7 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]

[2024-01-26 18:15:25] ERROR 8192: Return type of Stripe_Object::offsetSet($k, $v) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice at [/var/www/html/phorge/phorge/externals/stripe-php/lib/Stripe/Object.php:104]
arcanist(head=master, ref.master=6c7caf3572f4), phorge(head=phortuneMerchantPhp81, ref.master=7a86040f8a46, ref.phortuneMerchantPhp81=61afade7aee9)
  #0 require(string) called at [<phorge>/externals/stripe-php/lib/Stripe.php:33]
  #1 require_once(string) called at [<phorge>/src/applications/phortune/provider/PhortuneStripePaymentProvider.php:387]
  #2 PhortuneStripePaymentProvider::loadStripeAPILibraries() called at [<phorge>/src/applications/phortune/provider/PhortuneStripePaymentProvider.php:118]
  #3 PhortuneStripePaymentProvider::runConfigurationTest() called at [<phorge>/src/applications/phortune/controller/merchant/PhortuneMerchantProviderEditController.php:105]
  #4 PhortuneMerchantProviderEditController::handleMerchantRequest(AphrontRequest) called at [<phorge>/src/applications/phortune/controller/merchant/PhortuneMerchantController.php:32]
  #5 PhortuneMerchantController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:284]
  #6 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:203]
  #7 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]

[2024-01-26 18:15:25] ERROR 8192: Return type of Stripe_Object::offsetUnset($k) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice at [/var/www/html/phorge/phorge/externals/stripe-php/lib/Stripe/Object.php:114]
arcanist(head=master, ref.master=6c7caf3572f4), phorge(head=phortuneMerchantPhp81, ref.master=7a86040f8a46, ref.phortuneMerchantPhp81=61afade7aee9)
  #0 require(string) called at [<phorge>/externals/stripe-php/lib/Stripe.php:33]
  #1 require_once(string) called at [<phorge>/src/applications/phortune/provider/PhortuneStripePaymentProvider.php:387]
  #2 PhortuneStripePaymentProvider::loadStripeAPILibraries() called at [<phorge>/src/applications/phortune/provider/PhortuneStripePaymentProvider.php:118]
  #3 PhortuneStripePaymentProvider::runConfigurationTest() called at [<phorge>/src/applications/phortune/controller/merchant/PhortuneMerchantProviderEditController.php:105]
  #4 PhortuneMerchantProviderEditController::handleMerchantRequest(AphrontRequest) called at [<phorge>/src/applications/phortune/controller/merchant/PhortuneMerchantController.php:32]
  #5 PhortuneMerchantController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:284]
  #6 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:203]
  #7 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]

[2024-01-26 18:15:25] ERROR 8192: Creation of dynamic property Stripe_ApiRequestor::$_apiKey is deprecated at [/var/www/html/phorge/phorge/externals/stripe-php/lib/Stripe/ApiRequestor.php:22]
arcanist(head=master, ref.master=6c7caf3572f4), phorge(head=phortuneMerchantPhp81, ref.master=7a86040f8a46, ref.phortuneMerchantPhp81=61afade7aee9)
  #0 Stripe_ApiRequestor::__construct(string) called at [<phorge>/externals/stripe-php/lib/Stripe/ApiResource.php:17]
  #1 Stripe_ApiResource::refresh() called at [<phorge>/externals/stripe-php/lib/Stripe/SingletonApiResource.php:8]
  #2 Stripe_SingletonApiResource::_scopedSingletonRetrieve(string, string) called at [<phorge>/externals/stripe-php/lib/Stripe/Account.php:13]
  #3 Stripe_Account::retrieve(string) called at [<phorge>/src/applications/phortune/provider/PhortuneStripePaymentProvider.php:121]
  #4 PhortuneStripePaymentProvider::runConfigurationTest() called at [<phorge>/src/applications/phortune/controller/merchant/PhortuneMerchantProviderEditController.php:105]
  #5 PhortuneMerchantProviderEditController::handleMerchantRequest(AphrontRequest) called at [<phorge>/src/applications/phortune/controller/merchant/PhortuneMerchantController.php:32]
  #6 PhortuneMerchantController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:284]
  #7 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:203]
  #8 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]

/externals/stripe-php code is version 1.16.0 which is from ten years ago: 2014-06-17.

See https://stripe.com/docs/upgrades for API changes in the meantime.

Maybe it's time to realistically axe all this (payment provider or Phortune itself?), strongly assuming there are zero users of the "Phortune" prototype application out there? For the records, the other Phortune payment provider option is PayPal, giving [cURL/7] (https://api-3t.paypal.com/nvp) <CURLE_COULDNT_CONNECT>

Event Timeline

I believe it was originally made for Phacility to accept donations and then process payments for paid support, neither of which we want at Phorge, and I doubt is used elsewhere. Removing seems fine to me.

+1 for "delete". Also Fund (which is basically a demo for Phortune).

Makes sense.
Fund: Going to http://phorge.localhost/fund/create/ and creating a New Initiative anyway yields

EXCEPTION: (RuntimeException) Undefined array key "totalAsCurrency" at [<arcanist>/src/error/PhutilErrorHandler.php:273]
arcanist(head=master, ref.master=6c7caf3572f4), phorge(head=master, ref.master=c0191a039293)
  #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer) called at [<phorge>/src/infrastructure/storage/lisk/PhabricatorLiskDAO.php:345]
aklapper renamed this task from Phortune: Stripe Payments Account API changes to Remove dysfunctional Fund and Phortune prototype applications.Jan 27 2024, 13:28
aklapper updated the task description. (Show Details)

Should we deprecate these first, before complete removal? (if easy)

I never totally understood what the jobs of Fund and Phortune really were, and they weren't explained very well in the documentation, as if they were very Phacility-only tools that happened to be in Phabricator.

That said, it would be neat to have this as a way to track and handle e.g., donations, and sales of software and the like (as a hypothetical user), as well as to directly correspond both static and dynamic operating costs (e.g., compute/storage resources allocated by Harbormaster CI through Drydock, VPSes in Almanac, so on) to amounts tracked by Phortune.

Should we deprecate these first, before complete removal? (if easy)

Deprecation is as easy as adding a function to the Application classes.

@valerio.bozzolan: Which problem would that solve? :)

My concern with removing the applications outright is that they may be in use. Something like ChatLog was deprecated for years before it was removed. I think it might be smart to leave it deprecated for a couple of months.

I'm also slightly concerned about freeing up the monograms. Since we remove the remarkup rules, would that break comments for existing installs that reference the monograms? E.G. I1 and {I1}

Another thing: deletion of transactions. If by some misfortune they're around, they mess up during certain things, like T15125.

My concern with removing the applications outright is that they may be in use. Something like ChatLog was deprecated for years before it was removed. I think it might be smart to leave it deprecated for a couple of months.

Chatlog was more generally useful - it's completely possible that literally no one outside of Phacility was using this. But we can't tell for sure (except that the Stripe integration is broken? I'm not sure from the description if it's only broken on php 8. We also have PayPal integration)

I'm also slightly concerned about freeing up the monograms. Since we remove the remarkup rules, would that break comments for existing installs that reference the monograms? E.G. I1 and {I1}

Worst case (when loaded from cache), the monogram will look like a link but the target will 404.

Another thing: deletion of transactions. If by some misfortune they're around, they mess up during certain things, like T15125.

That's a good point... maybe we can delete some of the code, but keep Edge types, transaction types, etc. that might be used outside of it.

I'm not sure from the description if it's only broken on php 8. We also have PayPal integration)

Indeed, PHP 7.4 shows no errors in the console but the expected "Unable to connect to payment provider: InvalidAPI Key provided: xxxxx" in the browser.

I guess that means deprecating first.