Class: SagePay::Server::Repeat

Inherits:
Command
  • Object
show all
Defined in:
lib/sage_pay/server/repeat.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

#currencyObject

Returns the value of attribute currency.



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

def currency
  @currency
end

#cv2Object

Returns the value of attribute cv2.



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

def cv2
  @cv2
end

#descriptionObject

Returns the value of attribute description.



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

def description
  @description
end

Returns the value of attribute related_transaction.



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

def related_transaction
  @related_transaction
end

Instance Method Details

#live_serviceObject



33
34
35
# File 'lib/sage_pay/server/repeat.rb', line 33

def live_service
  "repeat"
end

#post_paramsObject



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

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

  params["CV2"] = cv2 if cv2.present?

  params
end

#response_from_response_body(response_body) ⇒ Object



29
30
31
# File 'lib/sage_pay/server/repeat.rb', line 29

def response_from_response_body(response_body)
  RepeatResponse.from_response_body(response_body)
end

#simulator_serviceObject



37
38
39
# File 'lib/sage_pay/server/repeat.rb', line 37

def simulator_service
  "VendorRepeatTx"
end