CyberfusionIO / HostFact-Verwerkersovereenkomst

Let debtors agree to your DPA (verwerkersovereenkomst) in HostFact.
MIT License
5 stars 5 forks source link

Actually placing signature? #6

Open sebastianberm opened 6 years ago

sebastianberm commented 6 years ago

It wouldn't take much for an acutal signature to be required. But is there some place where this can be stored or placed on the PDF before mailing? This would be great if possible.

Getting the signature field ready isn't difficult, but merging that and storing it... I don't know.

WilliamDEdwards commented 6 years ago

I was thinking about it. HostFact already includes required assets for placing a signature, because of the ability to sign to agree to a quote, so it doesn't seem like a very crazy idea to me.

sebastianberm commented 6 years ago

If we would barrow from klantenpaneel/core/views/pricequote.accept.phtml it should be pretty easy to create such a screen. I just don't know how to place the signature at the right location on the right page of our PDF and store it. If that would be possible, we'd just need to be able to sign it without having to login and it would be a 100% solution for everyone...

WilliamDEdwards commented 6 years ago

I'm not sure if it'd be a good idea to allow for signing the DPA without logging in first (from a legal standpoint)... Maybe we should add it to the config as an option?

Also, the signature wouldn't have to be in the PDF itself per se... The signature field could be shown instead of the checkbox.

sebastianberm commented 6 years ago

True, config value would be better. Most of our users usually can't remember the correct credentials, but we can authenticate them via email/phone (as we usually do).

It would be great to be able to store that tough as an actual signed document. But that would be phase 2 (or 3). For now, just getting and storing the signature would be great...

WilliamDEdwards commented 6 years ago

We were testing with a solution that allows for signing 'inside' the file, but every PDF has a different format and layout.. I don't think having a signature field for every document would scale. It would be a nice addition, though.

In case anyone has recommendations for a good library, I'd be happy to review them. But for now, ticking that checkbox and submitting is fine from a legal point of view.

If anyone does a PR for this feature, I'd be happy to test to help speed things up. :)

YWatchman commented 6 years ago

@sebastianberm I was busy building that with the Stiply API I wrote the wrapper for it, but we ran out of time and started building this.

I will take a look at the default functionality of HostFact for signing a quote.

sebastianberm commented 6 years ago

The main problem I see is actually storing the base64 encoded value of the signature. First of all, that's how Hostfact does it with quotes. But the main problem is... It requires a field.

And at the moment, this method is abusing a fault in the HostFact API, the plugin stores 'dd-mm-yyyy ({ip})' in the value field of a checkbox, that should be unset, 0 or 1. This should trigger an error in my humble opinion. There is no space for the signature anywhere.

WilliamDEdwards commented 6 years ago

I'm not sure what the problem would be to add a field.

sebastianberm commented 6 years ago

The problem there is it should be base64 encoded, so you'd get a unreadable string everywhere, that can easily be corrupted by editing the client.

WilliamDEdwards commented 6 years ago

Well, it could be a text file... But that isn't elegant in the slightest.

file_put_contents($this->getDebtor() . '.txt', $base64string);

YWatchman commented 6 years ago

Just save it in a database table or compile it to an image, for that you will have to make use of PHP Libraries.

WilliamDEdwards commented 6 years ago

That means users would have to execute an SQL query to get the right schema. I don't think they're willing to do that.

YWatchman commented 6 years ago

What do you mean?

WilliamDEdwards commented 6 years ago

If you save it in a database table that has nothing to do with HostFact, users would have to create the table with an SQL query.

I think that would be a showstopper for many potential users.

YWatchman commented 6 years ago

It is an extra feature, you don't necessarily have to activate it. A file however that has the contents would be around ~30% bigger in many cases.

YWatchman commented 6 years ago

To make it easier, we could build an 'install' function that creates the table for easy use.

Edit: Our modules in /Pro have a certain structure we cannot share.