Class: SagePay::Server::Authorise

Inherits:
Command
  • Object
show all
Defined in:
lib/sage_pay/server/authorise.rb

Instance Attribute Summary collapse

Attributes inherited from Command

#mode, #vendor, #vendor_tx_code

Instance Method Summary collapse

Methods inherited from Command

decimal_accessor, #initialize, #run!, #url

Constructor Details

This class inherits a constructor from SagePay::Server::Command

Instance Attribute Details

#apply_avs_cv2Object

Returns the value of attribute apply_avs_cv2.



6
7
8
# File 'lib/sage_pay/server/authorise.rb', line 6

def apply_avs_cv2
  @apply_avs_cv2
end

#descriptionObject

Returns the value of attribute description.



6
7
8
# File 'lib/sage_pay/server/authorise.rb', line 6

def description
  @description
end

Returns the value of attribute related_transaction.



6
7
8
# File 'lib/sage_pay/server/authorise.rb', line 6

def related_transaction
  @related_transaction
end

Instance Method Details

#live_serviceObject



35
36
37
# File 'lib/sage_pay/server/authorise.rb', line 35

def live_service
  "authorise"
end

#post_paramsObject



18
19
20
21
22
23
24
25
26
27
# File 'lib/sage_pay/server/authorise.rb', line 18

def post_params
  params = super.merge({
    "Amount"      => ("%.2f" % amount),
    "Description" => description
  }).merge(related_transaction.post_params)

  params['ApplyAVSCV2'] = apply_avs_cv2.to_s if apply_avs_cv2.present?

  params
end

#response_from_response_body(response_body) ⇒ Object



29
30
31
32
33
# File 'lib/sage_pay/server/authorise.rb', line 29

def response_from_response_body(response_body)
  # FIXME: Since RepeatResponse is being shared for repeats and
  # authorisations, it should probably be renamed.
  RepeatResponse.from_response_body(response_body)
end

#simulator_serviceObject



39
40
41
# File 'lib/sage_pay/server/authorise.rb', line 39

def simulator_service
  "VendorAuthoriseTx"
end