DoliCloud/SellYourSaas

it is not possible to add a Payment

erwinpalma opened this issue · 2 comments

Describe the bug

I have configured the app according to the documentation. I can create my instances, but the page is not showing after one user creates one instance and wants to add a payment method.

To Reproduce
Steps to reproduce the behavior:

  1. Open the instance link and create one.
  2. Once the instances have been created, click on the button "add payment method"

Expected behavior

I have tested this feature using a previous version and Dolibarr 17.x, I deleted the installation and I started again due learning proposes but the new release requires dolibarr 18, so I have used it.

Screenshots
image

image

  1. I have enabled the Dolibarr logs, and it shows nothing.
  2. the apache virtual host error: no errors
  3. the apache other hosts error: no errors

Desktop (please complete the following information):

  • OS: iOS, Windows
  • Browser : Safari, ms edge
  • Version [e.g. 22]

Dolibarr: 18.0.0
PHP: 7.4.3-4ubuntu2
Web server: Apache/2.4.41 (Ubuntu)
Apache modules: core mod_so mod_watchdog http_core mod_log_config mod_logio mod_version mod_unixd mod_access_compat mod_actions mod_alias mod_asis mod_auth_basic mod_auth_digest mod_authn_anon mod_authn_core mod_authn_dbd mod_authn_dbm mod_authn_file mod_authz_core mod_authz_dbm mod_authz_groupfile mod_authz_host mod_authz_owner mod_authz_user mod_autoindex mod_cache mod_cgi mod_cgid mod_charset_lite mod_dav mod_dav_fs mod_dav_lock mod_dbd mod_deflate mod_dir mod_dumpio mod_env mod_expires mod_ext_filter mod_file_cache mod_filter mod_headers mod_http2 mod_ident mod_include mod_info util_ldap mod_mime mod_mime_magic mpm_itk prefork mod_negotiation mod_php7 mod_reqtimeout mod_rewrite mod_setenvif mod_socache_shmcb mod_speling mod_ssl mod_status mod_substitute mod_suexec mod_unique_id mod_userdir mod_usertrack mod_vhost_alias

Additional context

After analyze/debug the code, I have noticed that the application crashes into the file /home/admin/wwwroot/dolibarr_sellyoursaas/myaccount/tpl/registerpaymentmode.tpl.php line 81.

as workarround I have commented $result = $sellyoursaasutils->sellyoursaasRemoteAction('refresh', $contract, 'admin', '', '', '0', $comment); and I can now continue with my testings.

This error does not provide any log, message or any trail, it just crash.

if ($totalInvoiced == 0) {
	// Loop on contracts
	$amounttopayasfirstinvoice = 0;
	$amounttopayasfirstinvoicetinstances = array();
	foreach ($listofcontractid as $contract) {
		if ($contract->array_options['options_deployment_status'] == 'done') {
			$sellyoursaasutils = new SellYourSaasUtils($db);

			$comment = 'Refresh contract '.$contract->ref.' on the payment page to be able to show the correct amount to pay';
			// First launch update of resources:
			// This update status of install.lock+authorized key (but does not recreate them) and update qty of contract lines + qty into linked template invoice
			// Here the app Crashes ----> $result = $sellyoursaasutils->sellyoursaasRemoteAction('refresh', $contract, 'admin', '', '', '0', $comment);
			$contract->fetch($contract->id);   // Reload to get new values after refresh

			$amounttopayasfirstinvoice += $contract->total_ttc;
			$amounttopayasfirstinvoicetinstances[$contract->ref_customer] = $contract;
		}
	}
eldy commented

Take a look in the ascii doc, in the section Troubleshooting to test if problem is not the one descrired in section
"Some remote action generates a PHP coredump or return a page "No answer received"