module Universign class Transaction include Universign::Safeguard include Service::Transaction include Service::Document attr_reader :transaction_id, :url, :data def initialize(transaction_id = nil, url = nil) @transaction_id = transaction_id @url = url @data = {} self.get end def from_data(data) @data = data end # @return [String] # # The status of the transaction. The existing statuses are: # # | Status | Description | # |-------------|--------------------------------------------------------------------------------------------------| # | `ready` | Signers can connect and sign | # | `expired` | The transaction has been requested more than 7 days ago. It will no more be available to signers | # | `canceled` | A signer has canceled the transaction. Signers will no more be able to connect to the service | # | `failed` | An error occured during a signature. The signers won’t be able to connect to the service | # | `completed` | All signers have successfuly sign, the requester can retrieve the documents | def status data['status'] end # @return [Array] def url @url ||= data['signerInfos'].map { |si| si['url'] } end # A list of bean containing information about the signers # and their progression in the signature process # # @return [Array