Class: EwayRapid::InternalModels::Transaction
- Inherits:
-
Object
- Object
- EwayRapid::InternalModels::Transaction
- Defined in:
- lib/eway_rapid/models/internal_models.rb
Instance Attribute Summary collapse
-
#authorisation_code ⇒ Object
Returns the value of attribute authorisation_code.
-
#beagle_score ⇒ Object
Returns the value of attribute beagle_score.
-
#beagle_verification ⇒ Object
Returns the value of attribute beagle_verification.
-
#customer ⇒ Object
Returns the value of attribute customer.
-
#customer_note ⇒ Object
Returns the value of attribute customer_note.
-
#errors ⇒ Object
Returns the value of attribute errors.
-
#invoice_number ⇒ Object
Returns the value of attribute invoice_number.
-
#invoice_reference ⇒ Object
Returns the value of attribute invoice_reference.
-
#options ⇒ Object
Returns the value of attribute options.
-
#response_code ⇒ Object
Returns the value of attribute response_code.
-
#response_message ⇒ Object
Returns the value of attribute response_message.
-
#shipping_address ⇒ Object
Returns the value of attribute shipping_address.
-
#token_customer_id ⇒ Object
Returns the value of attribute token_customer_id.
-
#total_amount ⇒ Object
Returns the value of attribute total_amount.
-
#transaction_id ⇒ Object
Returns the value of attribute transaction_id.
-
#transaction_status ⇒ Object
Returns the value of attribute transaction_status.
-
#verification ⇒ Object
Returns the value of attribute verification.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#authorisation_code ⇒ Object
Returns the value of attribute authorisation_code.
322 323 324 |
# File 'lib/eway_rapid/models/internal_models.rb', line 322 def end |
#beagle_score ⇒ Object
Returns the value of attribute beagle_score.
331 332 333 |
# File 'lib/eway_rapid/models/internal_models.rb', line 331 def beagle_score @beagle_score end |
#beagle_verification ⇒ Object
Returns the value of attribute beagle_verification.
336 337 338 |
# File 'lib/eway_rapid/models/internal_models.rb', line 336 def beagle_verification @beagle_verification end |
#customer ⇒ Object
Returns the value of attribute customer.
334 335 336 |
# File 'lib/eway_rapid/models/internal_models.rb', line 334 def customer @customer end |
#customer_note ⇒ Object
Returns the value of attribute customer_note.
321 322 323 |
# File 'lib/eway_rapid/models/internal_models.rb', line 321 def customer_note @customer_note end |
#errors ⇒ Object
Returns the value of attribute errors.
337 338 339 |
# File 'lib/eway_rapid/models/internal_models.rb', line 337 def errors @errors end |
#invoice_number ⇒ Object
Returns the value of attribute invoice_number.
325 326 327 |
# File 'lib/eway_rapid/models/internal_models.rb', line 325 def invoice_number @invoice_number end |
#invoice_reference ⇒ Object
Returns the value of attribute invoice_reference.
326 327 328 |
# File 'lib/eway_rapid/models/internal_models.rb', line 326 def invoice_reference @invoice_reference end |
#options ⇒ Object
Returns the value of attribute options.
332 333 334 |
# File 'lib/eway_rapid/models/internal_models.rb', line 332 def end |
#response_code ⇒ Object
Returns the value of attribute response_code.
323 324 325 |
# File 'lib/eway_rapid/models/internal_models.rb', line 323 def response_code @response_code end |
#response_message ⇒ Object
Returns the value of attribute response_message.
324 325 326 |
# File 'lib/eway_rapid/models/internal_models.rb', line 324 def end |
#shipping_address ⇒ Object
Returns the value of attribute shipping_address.
335 336 337 |
# File 'lib/eway_rapid/models/internal_models.rb', line 335 def shipping_address @shipping_address end |
#token_customer_id ⇒ Object
Returns the value of attribute token_customer_id.
330 331 332 |
# File 'lib/eway_rapid/models/internal_models.rb', line 330 def token_customer_id @token_customer_id end |
#total_amount ⇒ Object
Returns the value of attribute total_amount.
327 328 329 |
# File 'lib/eway_rapid/models/internal_models.rb', line 327 def total_amount @total_amount end |
#transaction_id ⇒ Object
Returns the value of attribute transaction_id.
328 329 330 |
# File 'lib/eway_rapid/models/internal_models.rb', line 328 def transaction_id @transaction_id end |
#transaction_status ⇒ Object
Returns the value of attribute transaction_status.
329 330 331 |
# File 'lib/eway_rapid/models/internal_models.rb', line 329 def transaction_status @transaction_status end |
#verification ⇒ Object
Returns the value of attribute verification.
333 334 335 |
# File 'lib/eway_rapid/models/internal_models.rb', line 333 def verification @verification end |
Class Method Details
.from_array(array) ⇒ Object
388 389 390 391 392 393 394 395 |
# File 'lib/eway_rapid/models/internal_models.rb', line 388 def self.from_array(array) transactions = [] array.each {|transaction_hash| obj = from_hash(transaction_hash) transactions.push(obj) } transactions end |
.from_hash(hash) ⇒ Object
366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 |
# File 'lib/eway_rapid/models/internal_models.rb', line 366 def self.from_hash(hash) transaction = Transaction.new transaction.customer_note = hash[Constants::CUSTOMER_NOTE] transaction. = hash[Constants::AUTHORISATION_CODE] transaction.response_code = hash[Constants::RESPONSE_CODE] transaction. = hash[Constants::RESPONSE_MESSAGE] transaction.invoice_number = hash[Constants::INVOICE_NUMBER] transaction.invoice_reference = hash[Constants::INVOICE_REFERENCE] transaction.total_amount = hash[Constants::TOTAL_AMOUNT] transaction.transaction_id = hash[Constants::TRANSACTION_ID] transaction.transaction_status = hash[Constants::TRANSACTION_STATUS] transaction.token_customer_id = hash[Constants::TOKEN_CUSTOMER_ID] transaction.beagle_score = hash[Constants::BEAGLE_SCORE] transaction. = Option.from_array(hash[Constants::OPTIONS]) transaction.verification = Verification.from_hash(hash[Constants::VERIFICATION]) transaction.customer = Customer.from_hash(hash[Constants::CUSTOMER]) transaction.shipping_address = ShippingAddress.from_hash(hash[Constants::SHIPPING_ADDRESS]) transaction.beagle_verification = BeagleVerification.from_hash(hash[Constants::BEAGLE_VERIFICATION]) transaction.errors = hash[Constants::ERRORS] transaction end |
.from_json(json) ⇒ Object
361 362 363 364 |
# File 'lib/eway_rapid/models/internal_models.rb', line 361 def self.from_json(json) hash = JSON.parse(json) from_hash(hash) end |
Instance Method Details
#to_json(opts = {}) ⇒ Object
339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 |
# File 'lib/eway_rapid/models/internal_models.rb', line 339 def to_json(opts={}) hash = {} hash[Constants::CUSTOMER_NOTE] = customer_note if customer_note hash[Constants::AUTHORISATION_CODE] = if hash[Constants::RESPONSE_CODE] = response_code if response_code hash[Constants::RESPONSE_MESSAGE] = if hash[Constants::INVOICE_NUMBER] = invoice_number if invoice_number hash[Constants::INVOICE_REFERENCE] = invoice_reference if invoice_reference hash[Constants::TOTAL_AMOUNT] = total_amount if total_amount hash[Constants::TRANSACTION_ID] = transaction_id if transaction_id hash[Constants::TRANSACTION_STATUS] = transaction_status if transaction_status hash[Constants::TOKEN_CUSTOMER_ID] = token_customer_id if token_customer_id hash[Constants::BEAGLE_SCORE] = beagle_score if beagle_score hash[Constants::OPTIONS] = if hash[Constants::VERIFICATION] = verification if verification hash[Constants::CUSTOMER] = customer if customer hash[Constants::SHIPPING_ADDRESS] = shipping_address if shipping_address hash[Constants::BEAGLE_VERIFICATION] = beagle_verification if beagle_verification hash[Constants::ERRORS] = errors if errors hash.to_json end |