class Universign::Transaction

Attributes

data[R]
transaction_id[R]
url[R]

Public Class Methods

new(transaction_id = nil, url = nil) click to toggle source
# File lib/universign/transaction.rb, line 9
def initialize(transaction_id = nil, url = nil)
  @transaction_id = transaction_id
  @url            = url
  @data           = {}

  self.get
end

Public Instance Methods

created_at() click to toggle source

The creation date or last relaunch date of this transaction

@return [Date]

# File lib/universign/transaction.rb, line 67
def created_at
  data['creationDate'].to_date
end
current_signer() click to toggle source

The index of current signer if the status of transaction is ready or who ended the transactions for other status

@return [Integer]

# File lib/universign/transaction.rb, line 60
def current_signer
  data['currentSigner']
end
description() click to toggle source

The description of the Transaction

@return [String]

# File lib/universign/transaction.rb, line 74
def description
  data['description']
end
each_field() click to toggle source

Whether the transaction was requested with requesting handwritten signature for each signature field or not.

@return [Boolean]

# File lib/universign/transaction.rb, line 82
def each_field
  data['eachField']
end
from_data(data) click to toggle source
# File lib/universign/transaction.rb, line 17
def from_data(data)
  @data = data
end
initiator() click to toggle source

A bean containing information about the requester of a transaction @return

# File lib/universign/transaction.rb, line 52
def initiator
  data['initiatorInfo']
end
signed?() click to toggle source

Whether the transaction is signed… or not !

@return [Boolean]

# File lib/universign/transaction.rb, line 89
def signed?
  status == 'completed'
end
signers() click to toggle source

A list of bean containing information about the signers and their progression in the signature process

@return [Array<Universign::Signer]

# File lib/universign/transaction.rb, line 45
def signers
  raise 'NotImplementedYet'
end
status() click to toggle source

@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 |

# File lib/universign/transaction.rb, line 32
def status
  data['status']
end

Private Instance Methods

client() click to toggle source
# File lib/universign/transaction.rb, line 97
def client
  Universign::Client.new.client
end