Anton Qcl Posted December 2, 2020 Report Posted December 2, 2020 Postal Methods introduced the new versions of API: https://documenter.getpostman.com/view/10877655/TVKD3dbahttp://prntscr.com/vumgnb Do you have plan to support that version? PS Postal Method's support confirmed that they are not gonna support SOAP version of API after January 1st (http://prntscr.com/vun4af) Quote
0 Anton Qcl Posted December 8, 2020 Author Report Posted December 8, 2020 New version of the API will be supported by Blesta: https://dev.blesta.com/browse/CORE-4044 Quote
0 Anton Qcl Posted February 12, 2021 Author Report Posted February 12, 2021 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); Quote
0 Paul Posted February 12, 2021 Report Posted February 12, 2021 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 Quote
0 Paul Posted February 12, 2021 Report Posted February 12, 2021 Just an update, we have updated the task with our fix. See https://dev.blesta.com/browse/CORE-4166 After this change, PostalMethods is working perfectly fine for us on 5.0.2. If you continue to have any issues after applying our fix, we'll need more information. Quote
0 Anton Qcl Posted February 17, 2021 Author Report Posted February 17, 2021 @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 Quote
0 Paul Posted February 17, 2021 Report Posted February 17, 2021 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? Quote
0 Jono Posted February 17, 2021 Report Posted February 17, 2021 Anything in the Blesta error log files? Quote
0 Anton Qcl Posted February 17, 2021 Author Report Posted February 17, 2021 @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 Quote
0 Jono Posted February 17, 2021 Report Posted February 17, 2021 https://dev.blesta.com/browse/CORE-4168 will resolve this Quote
0 Anton Qcl Posted February 18, 2021 Author Report Posted February 18, 2021 @Jono, @Paul, great. Thank you for your work, guys! Quote
0 Anton Qcl Posted February 25, 2021 Author Report Posted February 25, 2021 @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? Quote
0 Paul Posted February 26, 2021 Report Posted February 26, 2021 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. Quote
0 Anton Qcl Posted February 26, 2021 Author Report Posted February 26, 2021 @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 Quote
0 Paul Posted February 26, 2021 Report Posted February 26, 2021 21 minutes ago, Anton Qcl said: @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 Yep, good idea. task https://dev.blesta.com/browse/CORE-4185 Quote
Question
Anton Qcl
Postal Methods introduced the new versions of API: https://documenter.getpostman.com/view/10877655/TVKD3dba
http://prntscr.com/vumgnb
Do you have plan to support that version?
PS Postal Method's support confirmed that they are not gonna support SOAP version of API after January 1st (http://prntscr.com/vun4af)
15 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.