Giter Site home page Giter Site logo

dingo-d / woo-solo-api Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 1.0 2.57 MB

Solo API WooCommerce Integration

Home Page: https://wordpress.org/plugins/woo-solo-api/

License: MIT License

PHP 81.22% JavaScript 17.47% SCSS 1.30%
tax-rate solo-api solo woocommerce invoice solo-service croatian payment

woo-solo-api's Introduction

Woo Solo API

codecov GitHub tag GitHub stars Required PHP Version Tested WP Version license

Woo Solo API

Contributors: dingo-d
Tags: woocommerce, api, solo api, solo, api integration, shop, payment, woo
Requires at least: 6.0
Requires PHP: 7.4
Tested up to: 6.4.2 Stable tag: 3.3.0 WC requires at least: 7.0.0
WC tested up to: 8.4.0
License: MIT
License URI: https://opensource.org/licenses/MIT

This plugin provides integration of the SOLO service with WooCommerce store.

Description

Woo Solo API plugin will integrate with your checkout process, and will send the API request with the order details to the SOLO service which will in turn create a PDF of the invoice or order on your SOLO dashboard.

Additionally, the invoice or order will be stored on your site, and you'll have the option of sending this PDF as a separate mail to the client.

There is an entire options page where you can specify the details of the order, or the invoice such as unit measure, payment options, language of the invoice, currency and others.

The plugin is translated to Croatian, since the SOLO service is primarily used by Croatian users.

For more information about the SOLO API visit this link: https://solo.com.hr/api-dokumentacija

Requirements

  • PHP 7.4 or greater
  • WordPress 6.0 or above
  • WooCommerce 7.0 or above

Development

Requirements

The project follows PSR-12 standards, and uses PSR-4 autoload. To install the development dependencies you'll need to run:

composer install

To bundle the scripts and styles you'll need to run:

npm install
npm run build

During the development you can use watch mode:

npm run dev

There are a lot of composer scripts available for checking the code quality (PHP_CodeSniffer, PHPStan), and the code has tests which are built using wp-pest.

Running tests

In order to run the tests you'll first need to set up the test suite:

vendor/bin/wp-pest setup plugin --plugin-slug=woo-solo-api --skip-delete

Then you can run the tests using

composer test:unit
composer test:integration

Run all code quality checks

Running all php code quality checks you can run

composer check-all

And to run all the JS/SCSS checks you can run

npm run lint

Changelog

Check the Changelog.md

Acknowledgements

The autowiring config is taken from Eightshift libs

Parts of the architecture were influenced by Alain Schlessera's Workshops.

Frequently Asked Questions

Why is the PHP 7.4 required?

PHP 7.4 is in the end of life phase. You should really move on to PHP 8.

If you have older PHP versions, you are not only doing a disservice to the planet, you're also harming your own site speed and security. You can always ask your hosting provider to fix this for you, or if you have control over cPanel on shared hosting, you are likely to be able to update PHP version yourself. Just make sure you tick all the required PHP extensions (https://make.wordpress.org/hosting/handbook/handbook/server-environment/#php-extensions).

I didn't receive an invoice when testing the plugin. What's wrong?

Give it a minute, scroll your site. The API communication happens using WP cron, which depends on the site activity to work. You can always check the 'Solo API order details' tab in the settings to see if there was some error from the API. If that fails, turn on the debug mode (https://wordpress.org/support/article/debugging-in-wordpress/) and try to test again. If there was a fatal error it should be shown in the logs.

In the version 3 of the plugin, for every failed request you'll be able to see the error and try to rerun the call towards the API.

This plugin doesn't work with XYZ plugin

Could be. I didn't test it out with every plugin in the wild. That takes time. And money. In the near future I might be able to do some paid work, but that will depend on many things.

Please don't try to guilt-trip me to work on your site specific issues. I will try to help to the best of my abilities. But the plugin is free, so don't expect me to work miracles. Also, don't expect me to drop everything just to work on your issue. If I don't answer in a day or two, be patient. I have a private life as well (shocker, I know) :D

If you want me to add a new feature to the plugin you can contact me and pay me to work on the feature you need. My rate is 50€/hr.

Note that some features are not possible to make within this plugin. For instance, some apps and plugins will utilize WooCommerce REST API endpoints to trigger orders. Their API is poorly written, and when you do these kind of actions, the hooks that will look if something changed won't get triggered, which means this plugin cannot know of the order status. It is what it is. I could make some kind of listener/cron jobs to manually check these things, but this is a paid feature.

Can I modify how the email looks, or customer notice?

You can modify the request towards the Solo service using hooks described in the project's wiki page.

License

Copyright ©2024 Denis Žoljom. This plugin is free software, and may be redistributed under the terms specified in the LICENSE file.

woo-solo-api's People

Contributors

dependabot[bot] avatar dingo-d avatar ivoks avatar szepeviktor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

ivoks

woo-solo-api's Issues

To do for the next releases

To do:

  • Explore the implementation of interfaces in the plugin (with the autoloader).
  • Add wp-browser test suite
  • Modify the expiry date of the offers/invoices (rok_placanja)
  • Pull the translation of customer note based on the language selected
  • Issue: if 2 transactions are marked as complete, only one will send the call to solo API for completion.
  • Issue: When changing the order from on hold to completed in the order screen the API call is made again (support link)
  • Link the invoice from the Solo service with the WooCommerce invoice (support link)
  • Make company field mandatory if R1 type of invoice is selected (support link)
  • Check if the offer/bill is created twice (support link)
  • Check the possible rounding errors (support link)
  • API call made twice (using Corvuspay integration) (support link)
  • Check the Braintree integration
  • Add acceptance criteria

Opened PR: #19

Remove `ponude` folder from uploads

Currently, the offers are stored in the uploads folder. This should be made such that they are maybe just temporarily saved and then sent, after sending they should be deleted.

Could be a gdpr issue, although I need to add the notice that gdpr is not something I need to look after.

Future releases issues

The following are features to be added in the update

To do:

  • Add scroll to the Solo API order details table in the admin
  • Add better error handling in case a database operation fails
  • Add a measure field to every item and read that value from there, fallback to options if none is set (support link)
  • Add the option to execute the call on checkout or manually for every payment gateway (support link)
  • Fix the trigger on GH actions
  • Add qr code generation in the notice (support link)
  • Add a filter to the tax calculation so that third-party plugins can hook into it if they need to modify it based on a certain criterion like country based price calculation (support link)
  • Update fiters so that they include woocommerce order in it (for manipulation) (support link)
  • Add a way to detect if WooCommerce is active and disable the plugin gracefully if it's not active (support link)
  • If an invoice name contains slashes in the name, the PDF doesn't get generated and attached to the email
  • Add a filter for the request data so that it can be modified before sending to API #76
  • Add 10up GH action for code deploy to wp.org (https://github.com/10up/action-wordpress-plugin-deploy)
  • Add new status change check when the request will be made to the API (support link)

dynamic invoice type

Pozdrav,

koristim Vas plugin na jednoj instalaciji pa me zanima postoji li neki filter/nacin da dinamicki posaljem tip racuna.

Naime na checkout stranici imam custom dropdown za odabir tipa subjekta (privatna osoba | tvrtka | javna ustanova) i ovisno o tome se prikazuju input fieldovi za OIB/naziv/ime/prezime itd. Ovisno o tom odabiru ja bi volio imati mogucnost poslati tip R racuna za privatnu i R1 za ostale tipove.

Koliko sam ja ovako uspio vidjeti trenutno se gleda iskljucivo option u postavkama SOLO plugina, ali mozda sam nesto previdio.

Hvala unaprijed!

Language set bug

For some reason, the language that is set during sending of the json to SOLO API is affecting the whole site, so once that's done the language should be reverted

mail sending fails

[26-Nov-2021 11:33:37 UTC] PHP Warning: Undefined array key 0 in /home/dudicacom/stage1.dudica.com/wp-content/plugins/woo-solo-api/src/BackgroundJobs/SendCustomerEmail.php on line 50
[26-Nov-2021 11:33:37 UTC] PHP Warning: Undefined array key 1 in /home/dudicacom/stage1.dudica.com/wp-content/plugins/woo-solo-api/src/BackgroundJobs/SendCustomerEmail.php on line 51
[26-Nov-2021 11:33:37 UTC] PHP Warning: Undefined array key 2 in /home/dudicacom/stage1.dudica.com/wp-content/plugins/woo-solo-api/src/BackgroundJobs/SendCustomerEmail.php on line 52
[26-Nov-2021 11:33:37 UTC] PHP Warning: Undefined array key 3 in /home/dudicacom/stage1.dudica.com/wp-content/plugins/woo-solo-api/src/BackgroundJobs/SendCustomerEmail.php on line 53
[26-Nov-2021 11:33:37 UTC] PHP Warning: Undefined array key 4 in /home/dudicacom/stage1.dudica.com/wp-content/plugins/woo-solo-api/src/BackgroundJobs/SendCustomerEmail.php on line 54

Payment option should not be global

Currently one can select a payment option (Cash, Card, Check...) and this is applied globally. So, if someone has different payment gateways in woocommerce, they all need to be the same.

A use case would be a web page that allows payment via Credit card, but also via bank transaction. Now, even a bank transaction option results in an invoice that is marked as credit card payment.

IMHO, one should be able to select 'fiscal option', 'type of the document' and 'payment option' for every gateway. As an example:

  • PayPal - fiscalized, invoice, credit card
  • WSpay - fiscalized, invoice, credit card
  • bank transfer - not fiscalized, offer, bank transaction

Release checklist

  • Update CHANGELOG.md with relevant changes
  • Update Readme.txt and Readme.md files
    • Update all the tags, especially Stable tag
    • Update hooks if added
    • Update FAQ if needed
  • Update main plugin file - all the tags
  • Make sure everything works in the production environment and development environment
  • Make sure plugin translation is working
    • Make sure all strings are translatable, and properly translated
  • Fix all lint issues
  • After all of the above has been fixed tag the new version in the GH
  • Commit the new version to the wordpress.org SVN repo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.