Class: GimmeGimme::FakeCimServer::Transaction
- Inherits:
-
Object
- Object
- GimmeGimme::FakeCimServer::Transaction
- Includes:
- RequestParser
- Defined in:
- lib/generators/gimme_gimme/test_support/templates/testing/fake_cim_server.rb
Direct Known Subclasses
Defined Under Namespace
Classes: NotImplementedError
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#customer_payment_profile ⇒ Object
readonly
Returns the value of attribute customer_payment_profile.
-
#customer_profile ⇒ Object
readonly
Returns the value of attribute customer_profile.
-
#customer_profile_id ⇒ Object
readonly
Returns the value of attribute customer_profile_id.
-
#transactions ⇒ Object
readonly
Returns the value of attribute transactions.
Class Method Summary collapse
Instance Method Summary collapse
- #card_number ⇒ Object
- #extra_response_opts ⇒ Object
-
#initialize(customer_profiles, customer_payment_profiles, document, transactions) ⇒ Transaction
constructor
A new instance of Transaction.
- #success? ⇒ Boolean
Methods included from RequestParser
Constructor Details
#initialize(customer_profiles, customer_payment_profiles, document, transactions) ⇒ Transaction
Returns a new instance of Transaction.
247 248 249 250 251 252 253 254 |
# File 'lib/generators/gimme_gimme/test_support/templates/testing/fake_cim_server.rb', line 247 def initialize(customer_profiles, customer_payment_profiles, document, transactions) @document = document @amount = at("amount").to_f @customer_profile_id = at("customerProfileId") @customer_profile_payment_id = at("customerPaymentProfileId") @customer_profile = customer_profiles[@customer_profile_id.to_i] @customer_payment_profile = customer_payment_profiles[@customer_profile_payment_id.to_i] end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
237 238 239 |
# File 'lib/generators/gimme_gimme/test_support/templates/testing/fake_cim_server.rb', line 237 def amount @amount end |
#customer_payment_profile ⇒ Object (readonly)
Returns the value of attribute customer_payment_profile.
237 238 239 |
# File 'lib/generators/gimme_gimme/test_support/templates/testing/fake_cim_server.rb', line 237 def customer_payment_profile @customer_payment_profile end |
#customer_profile ⇒ Object (readonly)
Returns the value of attribute customer_profile.
237 238 239 |
# File 'lib/generators/gimme_gimme/test_support/templates/testing/fake_cim_server.rb', line 237 def customer_profile @customer_profile end |
#customer_profile_id ⇒ Object (readonly)
Returns the value of attribute customer_profile_id.
237 238 239 |
# File 'lib/generators/gimme_gimme/test_support/templates/testing/fake_cim_server.rb', line 237 def customer_profile_id @customer_profile_id end |
#transactions ⇒ Object (readonly)
Returns the value of attribute transactions.
237 238 239 |
# File 'lib/generators/gimme_gimme/test_support/templates/testing/fake_cim_server.rb', line 237 def transactions @transactions end |
Class Method Details
.create(customer_profiles, customer_payment_profiles, document, transactions) ⇒ Object
239 240 241 242 243 244 245 |
# File 'lib/generators/gimme_gimme/test_support/templates/testing/fake_cim_server.rb', line 239 def self.create(customer_profiles, customer_payment_profiles, document, transactions) if document.at("profileTransAuthOnly").present? AuthOnlyTransaction.new(customer_profiles, customer_payment_profiles, document, transactions) elsif document.at("profileTransCaptureOnly").present? CaptureOnlyTransaction.new(customer_profiles, customer_payment_profiles, document, transactions) end end |
Instance Method Details
#card_number ⇒ Object
256 257 258 |
# File 'lib/generators/gimme_gimme/test_support/templates/testing/fake_cim_server.rb', line 256 def card_number customer_payment_profile.card_number end |
#extra_response_opts ⇒ Object
265 266 267 |
# File 'lib/generators/gimme_gimme/test_support/templates/testing/fake_cim_server.rb', line 265 def extra_response_opts raise NotImplementedError end |
#success? ⇒ Boolean
260 261 262 263 |
# File 'lib/generators/gimme_gimme/test_support/templates/testing/fake_cim_server.rb', line 260 def success? !customer_profile.nil? && customer_profile.customer_payment_profile_id == @customer_profile_payment_id.to_i end |