Class: GimmeGimme::FakeCimServer::CaptureOnlyTransaction
- Inherits:
-
Transaction
- Object
- Transaction
- GimmeGimme::FakeCimServer::CaptureOnlyTransaction
- Defined in:
- lib/generators/gimme_gimme/test_support/templates/testing/fake_cim_server.rb
Instance Attribute Summary collapse
-
#transaction_id ⇒ Object
Returns the value of attribute transaction_id.
Attributes inherited from Transaction
#amount, #customer_payment_profile, #customer_profile, #customer_profile_id, #transactions
Instance Method Summary collapse
- #authorization_code ⇒ Object
- #extra_response_opts ⇒ Object
-
#initialize(customer_profiles, customer_payment_profiles, document, transactions) ⇒ CaptureOnlyTransaction
constructor
A new instance of CaptureOnlyTransaction.
- #success? ⇒ Boolean
Methods inherited from Transaction
Methods included from RequestParser
Constructor Details
#initialize(customer_profiles, customer_payment_profiles, document, transactions) ⇒ CaptureOnlyTransaction
Returns a new instance of CaptureOnlyTransaction.
289 290 291 292 293 294 295 296 297 298 299 |
# File 'lib/generators/gimme_gimme/test_support/templates/testing/fake_cim_server.rb', line 289 def initialize(customer_profiles, customer_payment_profiles, document, transactions) super @transaction_id = Sequencer.next_id @document = document @authorize_transaction = transactions.detect do |transaction| transaction.customer_payment_profile == customer_payment_profile && transaction.amount == amount && transaction..to_s == .to_s end end |
Instance Attribute Details
#transaction_id ⇒ Object
Returns the value of attribute transaction_id.
287 288 289 |
# File 'lib/generators/gimme_gimme/test_support/templates/testing/fake_cim_server.rb', line 287 def transaction_id @transaction_id end |
Instance Method Details
#authorization_code ⇒ Object
313 314 315 |
# File 'lib/generators/gimme_gimme/test_support/templates/testing/fake_cim_server.rb', line 313 def at("approvalCode") end |
#extra_response_opts ⇒ Object
301 302 303 304 305 306 307 |
# File 'lib/generators/gimme_gimme/test_support/templates/testing/fake_cim_server.rb', line 301 def extra_response_opts success = success? ? 1 : 0 { :directResponse => "#{success},,,,,,#{@transaction_id},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,," } #{:direct_response => { :transaction_id => @transaction_id} } end |
#success? ⇒ Boolean
309 310 311 |
# File 'lib/generators/gimme_gimme/test_support/templates/testing/fake_cim_server.rb', line 309 def success? super && !@authorize_transaction.nil? end |