Class: Cybersourcery::CartSigner

Inherits:
Object
  • Object
show all
Defined in:
lib/cybersourcery/cart_signer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(session, signer, cart_fields) ⇒ CartSigner

Returns a new instance of CartSigner.



5
6
7
8
9
# File 'lib/cybersourcery/cart_signer.rb', line 5

def initialize(session, signer, cart_fields)
  @session = session
  @signer = signer
  @cart_fields = cart_fields.dup
end

Instance Attribute Details

#cart_fieldsObject (readonly)

Returns the value of attribute cart_fields.



3
4
5
# File 'lib/cybersourcery/cart_signer.rb', line 3

def cart_fields
  @cart_fields
end

#sessionObject (readonly)

Returns the value of attribute session.



3
4
5
# File 'lib/cybersourcery/cart_signer.rb', line 3

def session
  @session
end

#signed_cart_fieldsObject (readonly)

Returns the value of attribute signed_cart_fields.



3
4
5
# File 'lib/cybersourcery/cart_signer.rb', line 3

def signed_cart_fields
  @signed_cart_fields
end

#signerObject (readonly)

Returns the value of attribute signer.



3
4
5
# File 'lib/cybersourcery/cart_signer.rb', line 3

def signer
  @signer
end

Instance Method Details

#runObject



11
12
13
14
15
# File 'lib/cybersourcery/cart_signer.rb', line 11

def run
  sign_cart_fields
  reassign_signature_and_signed_fields_to_session
  @signed_cart_fields
end