Class: Google4R::Checkout::AuthorizationAmountNotification
- Inherits:
-
Notification
- Object
- Notification
- Google4R::Checkout::AuthorizationAmountNotification
- Defined in:
- lib/google4r/checkout/notifications.rb
Overview
Google Checkout sends an
Instance Attribute Summary collapse
-
#authorization_amount ⇒ Object
The amount that is reauthorized to be charged to the customer's credit card (Money).
-
#authorization_expiration_date ⇒ Object
The time that a credit card authorization for an order expires.
-
#avs_response ⇒ Object
The address verification response (String).
-
#cvn_response ⇒ Object
Credit verification value for the order (String).
Attributes inherited from Notification
#frontend, #google_order_number, #serial_number, #timestamp
Class Method Summary collapse
-
.create_from_element(element, frontend) ⇒ Object
Factory method that creates a new AuthorizationAmountNotification from an REXML::Element instance.
Methods inherited from Notification
Constructor Details
This class inherits a constructor from Google4R::Checkout::Notification
Instance Attribute Details
#authorization_amount ⇒ Object
The amount that is reauthorized to be charged to the customer's credit card (Money)
404 405 406 |
# File 'lib/google4r/checkout/notifications.rb', line 404 def @authorization_amount end |
#authorization_expiration_date ⇒ Object
The time that a credit card authorization for an order expires.
407 408 409 |
# File 'lib/google4r/checkout/notifications.rb', line 407 def @authorization_expiration_date end |
#avs_response ⇒ Object
The address verification response (String)
410 411 412 |
# File 'lib/google4r/checkout/notifications.rb', line 410 def avs_response @avs_response end |
#cvn_response ⇒ Object
Credit verification value for the order (String)
413 414 415 |
# File 'lib/google4r/checkout/notifications.rb', line 413 def cvn_response @cvn_response end |
Class Method Details
.create_from_element(element, frontend) ⇒ Object
Factory method that creates a new AuthorizationAmountNotification from an REXML::Element instance. Use this to create instances of AuthorizationAmountNotification.
Raises NoMethodError and RuntimeError exceptions if the given element misses required elements.
420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 |
# File 'lib/google4r/checkout/notifications.rb', line 420 def self.create_from_element(element, frontend) = AuthorizationAmountNotification.new(frontend) .serial_number = element.attributes['serial-number'] .google_order_number = element.elements['google-order-number'].text currency = element.elements['authorization-amount'].attributes['currency'] amount = (element.elements['authorization-amount'].text.to_f*100).to_i . = Money.new(amount, currency) . = Time.parse(element.elements['authorization-expiration-date'].text) .avs_response = element.elements['avs-response'].text .cvn_response = element.elements['cvn-response'].text . = Time.parse(element.elements['timestamp'].text) return end |