Class: Liqpay::SignedPayload

Inherits:
Object
  • Object
show all
Defined in:
lib/liqpay/signed_payload.rb

Overview

Handles signing and verification of LiqPay request/responses

Direct Known Subclasses

Request, Response

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ SignedPayload

Returns a new instance of SignedPayload.



11
12
13
14
15
16
# File 'lib/liqpay/signed_payload.rb', line 11

def initialize(options = {})
  options.replace(Liqpay.default_options.merge(options))

  @public_key = options[:public_key]
  @private_key = options[:private_key]
end

Instance Attribute Details

#private_keyObject

Returns the value of attribute private_key.



9
10
11
# File 'lib/liqpay/signed_payload.rb', line 9

def private_key
  @private_key
end

#public_keyObject

Returns the value of attribute public_key.



9
10
11
# File 'lib/liqpay/signed_payload.rb', line 9

def public_key
  @public_key
end

Instance Method Details

#dataObject

Raises:

  • (NotImplementedError)


22
23
24
# File 'lib/liqpay/signed_payload.rb', line 22

def data
  raise NotImplementedError
end

#signatureObject



18
19
20
# File 'lib/liqpay/signed_payload.rb', line 18

def signature
  @signature ||= sign(data)
end