Jump to content

Tyson

Blesta Developers
  • Posts

    3,638
  • Joined

  • Last visited

  • Days Won

    241

Posts posted by Tyson

  1. You are probably getting errors, or the API request could not be made. You would only get an integer response if the action was successful.

    $response = $api->post("coupons", "add", $coupon_data);
    
    if ($response->errors() !== false) {
        // There were errors attempting that action
        print_r($response->errors());
    } elseif (($result = $response->response())) {
        // The response was successful and returned data
        print_r($result);
    } else {
        // Something else happened
        echo "Response code: " . $response->responseCode();
        var_dump($response->raw());
    }

     

  2. I can't speak for any third-party plugins, but the CMS plugin from Blesta does not use the CKEditor anymore since it changes the HTML source from what was written, not accepting valid HTML5 nested blocks. So it is more flexible to allow users to set their own HTML as written by not using the WYSIWYG.

  3. The card data would be stored as a payment account if the customer chose to store it, but they don't have to. If they did, the card could be used for autodebiting in the future. In any case, the card data has to pass through the server, so you would still need to be PCI compliant. You can use a token-based gateway like Stripe Payments to store cards off-site and also not pass them through the server.

  4. Blesta itself handles recurring billing (i.e. autodebiting cards when payments are due for open invoices) based on your settings. The vault refers to storing cards offsite (with Braintree rather than in Blesta), which the Braintree gateway currently does not support. Storing cards offsite with Braintree would be "Token Storage" as described in the documentation.

    So to summarize, the Braintree gateway supports recurring payments because that is handled by Blesta. Customer card data is stored in Blesta rather than with Braintree in their vault.

  5. A CSRF token is generated when the form is created using the Form component. If you're doing everything in JS, you need to fetch the CSRF token, either from another form on the page, or via an AJAX request that returns the CSRF token, and then add it to your form in the proper format.

  6. Are you saying that calling the read() method returns null, or $this->Session is null? Because it looks like $this->Session is null because it's not loaded anywhere. Your Plugin class is not a controller, so it does not inherit the Session object from AppController.

    Loader::loadComponents($this, ['Session']);
    $this->Session->read('blesta_client_id');

    Depending on what you're trying to do, you may want to also consider the fact that staff can log in as a client, so it may not really be the client that's logged in.

  7. The error states that the memory size of 33554432 bytes was exceeded, and that's only 32 MB. You may want to double-check your php.ini file for both web and CLI since the system does not appear to have the 1024 MB limit you said it should have. While 32 MB may work for some, the Blesta requirements recommend at least 128 MB.

    The invoice delivery cron task is failing in your example, which means it is probably using more than 32 MB of memory to generate the invoice PDFs and send them via email.

    You can try running the following to see the memory limit at run-time in CLI:

    php -r "echo ini_get('memory_limit') . PHP_EOL;"

     

  8. Something like that is usually caused by the server actually being down temporarily, or perhaps a client-side computer/browser issue. Try using a different web browser and see if you continue to get the same error. You should also try from a separate computer.

    You can also check your Blesta error logs to see if anything more specific caused an error at the time you got the error in your browser. If there is an error, it would be useful to know what it is in order to debug the problem.

  9. Blesta is trying to send an email but fails to do so because some tag in the email template is not being used correctly.

    Double-check your "Service Creation" email template and how you are using the tags. If email is sent successfully for other services, then the problematic tag is probably in the package's Welcome Email section instead (which is imported into the "Service Creation" email template as the tag "{package.email_html}"/"{package.email_text}"), so edit that service's package and take a look at the Welcome Email template for both text and HTML.

    Some tags cannot be displayed as written because they are not strings, and instead need to be iterated over. You should take a look at the package module's documentation for what tags are available and how to use them. For example, when using the cPanel module, there is a tag "{module.name_servers}". That tag cannot be displayed as a string since its data is an array of multiple nameservers. If you attempt to display it as written, you will receive the error that you encountered. In this example, you would use a "for" statement in the email template to loop over the nameservers as mentioned in the cPanel documentation:

    {% for name_server in module.name_servers %}
    Name server: {name_server}{% endfor %}

     

  10. GoCardless is integrated as a non-merchant gateway, so no payment details are stored in Blesta, therefore Blesta cannot perform recurring billing for the client using that gateway. However, when a customer purchases something and uses GoCardless, they have the option of choosing a payment subscription if you have the gateway configured to allow for it. Should they choose the subscription method, GoCardless will charge them on a recurring basis on that particular service's recurring interval only.

  11. We can consider updating character lengths for some database columns, but I'm not sure I understand the example of fields like "dotfrcontactentitybirthplacecountrycode", which can currently be saved in an abbreviated form and mapped by the module to whatever appropriate field name they require for any API requests.

  12. Nothing obvious pops out to me with your portal HTML source. You can try resetting the portal HTML source back to what it was originally to see if that fixes it, or you can take a look at the php error logs to see if there is an error preventing the page from loading properly, then resolve that error.

  13. Neither of those warnings/notices are an issue, nor are they related to the issue you're having.

    Since you can deliver the invoice manually from the client profile page, the problem is likely with the cron. Have you double-checked that the automation task to deliver invoices is enabled and running (Settings > Automation > "Deliver Invoices" task)?

    When you run the cron manually from within Blesta, do you see any text indicating that the Deliver Invoices task was run? There should be some text indicating success or error with delivery. You can view the cron logs for the Deliver Invoices task to see these details (Tools > Logs > Cron tab).

×
×
  • Create New...