riboseinc / digicert

Ruby bindings for the Digicert Services API
https://www.digicert.com/services/v2/documentation
MIT License
8 stars 10 forks source link

Add finder for the duplicate certificate #66

Closed abunashir closed 7 years ago

abunashir commented 7 years ago

As of now, the Digicert API does not have an easier way to find a duplicate certificate, the certificate duplication returns existing order_id with a request node which only has an id.

So to find out a duplicate certificate, we need to retrieve the request details first and then use the date_created for that certificate to find out from all of the certificate duplications

This requires lots of work, so this following interface will do all of its underlying tasks, and all we need to do is pass the requests id that we will have form the certificate duplication.

order = Digicert::Order.find(order_id)
duplicate_order = order.duplicate

request_id = duplicate_order.requests.first.id
Digicert::DuplicateCertificateFinder.find_by(request_id: request_id)