Jump to content
  • 0

Question

15 answers to this question

Recommended Posts

  • 0
Posted

We tested version 5.0.2 which includes API Adapter for new Postal Methods API but, unfortunately, it does not work.
We set dev api key and tried to send invoice using Postal Methods and got next error:

{"code":0,"message":"An internal error occurred during your request!","details":null,"validationErrors":null}

We also see next information in Postal Methods Dashboard (http://prntscr.com/z5x4oi?

Object reference not set to an instance of an object.


Please, check it.

 

PS I found minor bug in the components/delivery/postal_methods.php. I fixed it for my instance but it hasn't changed the API response
 

(line 225)

$filename = tempnam(sys_get_temp_dir(), 'tmp_') // This will generate file like "/tmp/tmp_XbKJsv" without ".tmp" extension
...

// This block is completely useless because filename does not contain ".tmp"
$new_filename = str_replace('.tmp', '.pdf', $filename);
rename($filename, $new_filename);


My Fix:

 

$filename = tempnam(sys_get_temp_dir(), 'tmp_') . '.pdf';

// TODO: remove it
// $new_filename = str_replace('.tmp', '.pdf', $filename);
// rename($filename, $new_filename);


 

  • 0
Posted
15 hours ago, Anton Qcl said:

We tested version 5.0.2 which includes API Adapter for new Postal Methods API but, unfortunately, it does not work.
We set dev api key and tried to send invoice using Postal Methods and got next error:


{"code":0,"message":"An internal error occurred during your request!","details":null,"validationErrors":null}

We also see next information in Postal Methods Dashboard (http://prntscr.com/z5x4oi?


Object reference not set to an instance of an object.


Please, check it.

 

PS I found minor bug in the components/delivery/postal_methods.php. I fixed it for my instance but it hasn't changed the API response
 


(line 225)

$filename = tempnam(sys_get_temp_dir(), 'tmp_') // This will generate file like "/tmp/tmp_XbKJsv" without ".tmp" extension
...

// This block is completely useless because filename does not contain ".tmp"
$new_filename = str_replace('.tmp', '.pdf', $filename);
rename($filename, $new_filename);


My Fix:

 


$filename = tempnam(sys_get_temp_dir(), 'tmp_') . '.pdf';

// TODO: remove it
// $new_filename = str_replace('.tmp', '.pdf', $filename);
// rename($filename, $new_filename);


 

Thanks, we're looking into this. What version of PHP are you running? I'm getting a different error in the PostalMethods logs:

Quote

File Type Not Supported! Please send a file with extension .pdf, .doc, .docx or .html

Which might be similar to your second point. We have a task for that one at https://dev.blesta.com/browse/CORE-4166

  • 0
Posted

@Paul

thank you for fix, but, unfortunately, no changes after applying :(

Still get the error "An internal error occurred during your request!"
Our settings: http://prntscr.com/zsgyak
OS: centos7
PHP: php7.4
Blesta: 5.0.2 + patch
Key Type: Dev

Let me know if you need any additional information from me
 

  • 0
Posted
16 hours ago, Anton Qcl said:

@Paul

thank you for fix, but, unfortunately, no changes after applying :(

Still get the error "An internal error occurred during your request!"
Our settings: http://prntscr.com/zsgyak
OS: centos7
PHP: php7.4
Blesta: 5.0.2 + patch
Key Type: Dev

Let me know if you need any additional information from me
 

It works fine for us, the only difference might be the option you've selected "Include a Reply Envelope", we'll test with that. Do you get the error with that option disabled or no?

  • 0
Posted

@Paul, Works good without that option.
@Jono, the error generated by PostalMethods, so there is nothing in blesta logs. However, if you need to, I can temporary modify file postal_methods.php to collect any debug information you can use. Let me know which information you want to get from me

 

 

  • 0
Posted

@Paul, hi!
Updated version to 5.0.3. 
Invoices go to the PostalMethods but they are marked as "Invalid" in Postal Methods admin panel. Error: "Invalid Page Size" (http://prntscr.com/106zp92)
Can you check it, please?

 

Upd: got information from PostalMethods:
 

Quote

We require all documents to be 8.5 x 11.  This was the issue with your documents previously when we had to delete them and refund your money.

Can you, please, create PDF's in LETTER format for them?

  • 0
Posted
On 2/25/2021 at 12:40 PM, Anton Qcl said:

@Paul, hi!
Updated version to 5.0.3. 
Invoices go to the PostalMethods but they are marked as "Invalid" in Postal Methods admin panel. Error: "Invalid Page Size" (http://prntscr.com/106zp92)
Can you check it, please?

 

Upd: got information from PostalMethods:
 

Can you, please, create PDF's in LETTER format for them?

The default Paper Size in Blesta is Letter, but Blesta also supports A4. You can update it under Settings > Company > Billing/Payment > Invoice Customization.

  • 0
Posted

@Paul Thank you very much! I'd suggest little improvement in this case - when user choose to use Postal Method, check that company invoice page size is compatible with Postal Methods :)

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...