Class: Google4R::Checkout::RiskInformationNotification
- Inherits:
-
Notification
- Object
- Notification
- Google4R::Checkout::RiskInformationNotification
- Defined in:
- lib/google4r/checkout/notifications.rb
Overview
Google Checkout sends out
Instance Attribute Summary collapse
-
#avs_response ⇒ Object
The address verification response (String).
-
#buyer_account_age ⇒ Object
The age of the buyer's google checkout account in days.
-
#buyer_billing_address ⇒ Object
The buyer's billing address (Address).
-
#cvn_response ⇒ Object
Credit verification value for the order (String).
-
#eligible_for_protection ⇒ Object
Is the order eligible for Google Checkout's payment guarantee policy (boolean).
-
#ip_address ⇒ Object
The buyer's IP address (String).
-
#partial_card_number ⇒ Object
The last 4 digits of the credit card used to pay for the order (integer).
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 RiskInformationNotification from an REXML::Element instance.
Methods inherited from Notification
Constructor Details
This class inherits a constructor from Google4R::Checkout::Notification
Instance Attribute Details
#avs_response ⇒ Object
The address verification response (String)
453 454 455 |
# File 'lib/google4r/checkout/notifications.rb', line 453 def avs_response @avs_response end |
#buyer_account_age ⇒ Object
The age of the buyer's google checkout account in days
465 466 467 |
# File 'lib/google4r/checkout/notifications.rb', line 465 def buyer_account_age @buyer_account_age end |
#buyer_billing_address ⇒ Object
The buyer's billing address (Address).
450 451 452 |
# File 'lib/google4r/checkout/notifications.rb', line 450 def buyer_billing_address @buyer_billing_address end |
#cvn_response ⇒ Object
Credit verification value for the order (String)
456 457 458 |
# File 'lib/google4r/checkout/notifications.rb', line 456 def cvn_response @cvn_response end |
#eligible_for_protection ⇒ Object
Is the order eligible for Google Checkout's payment guarantee policy (boolean).
447 448 449 |
# File 'lib/google4r/checkout/notifications.rb', line 447 def eligible_for_protection @eligible_for_protection end |
#ip_address ⇒ Object
The buyer's IP address (String)
462 463 464 |
# File 'lib/google4r/checkout/notifications.rb', line 462 def ip_address @ip_address end |
#partial_card_number ⇒ Object
The last 4 digits of the credit card used to pay for the order (integer)
459 460 461 |
# File 'lib/google4r/checkout/notifications.rb', line 459 def partial_card_number @partial_card_number end |
Class Method Details
.create_from_element(element, frontend) ⇒ Object
Factory method that creates a new RiskInformationNotification from an REXML::Element instance. Use this to create instances of RiskInformationNotification
Raises NoMethodError and RuntimeError exceptions if the given element misses required elements.
472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 |
# File 'lib/google4r/checkout/notifications.rb', line 472 def self.create_from_element(element, frontend) risk = RiskInformationNotification.new(frontend) risk.serial_number = element.attributes['serial-number'] risk. = Time.parse(element.elements['timestamp'].text) risk.partial_card_number = element.elements['risk-information/partial-cc-number'].text risk.ip_address = element.elements['risk-information/ip-address'].text risk.google_order_number = element.elements['google-order-number'].text risk.eligible_for_protection = element.elements['risk-information/eligible-for-protection'].text == 'true' risk.cvn_response = element.elements['risk-information/cvn-response'].text risk.buyer_billing_address = Address.create_from_element(element.elements['risk-information/billing-address']) risk.buyer_account_age = element.elements['risk-information/buyer-account-age'].text.to_i risk.avs_response = element.elements['risk-information/avs-response'].text return risk end |