class Braintree::WebhookNotification
Attributes
account_updater_daily_report[R]
connected_merchant_paypal_status_changed[R]
connected_merchant_status_transitioned[R]
disbursement[R]
dispute[R]
granted_payment_instrument_update[R]
kind[R]
local_payment_completed[R]
local_payment_expired[R]
local_payment_funded[R]
local_payment_reversed[R]
oauth_access_revocation[R]
partner_merchant[R]
payment_method_customer_data_updated_metadata[R]
revoked_payment_method_metadata[R]
source_merchant_id[R]
subscription[R]
timestamp[R]
transaction[R]
transaction_review[R]
Public Class Methods
_new(*args)
click to toggle source
# File lib/braintree/webhook_notification.rb, line 141 def _new(*args) self.new(*args) end
parse(*args)
click to toggle source
# File lib/braintree/webhook_notification.rb, line 90 def self.parse(*args) Configuration.gateway.webhook_notification.parse(*args) end
verify(*args)
click to toggle source
# File lib/braintree/webhook_notification.rb, line 94 def self.verify(*args) Configuration.gateway.webhook_notification.verify(*args) end
Protected Class Methods
new(gateway, attributes)
click to toggle source
# File lib/braintree/webhook_notification.rb, line 98 def initialize(gateway, attributes) @gateway = gateway set_instance_variables_from_hash(attributes) @error_result = ErrorResult.new(gateway, @subject[:api_error_response]) if @subject.has_key?(:api_error_response) @merchant_account = MerchantAccount._new(gateway, @subject[:merchant_account]) if @subject.has_key?(:merchant_account) @partner_merchant = OpenStruct.new(@subject[:partner_merchant]) if @subject.has_key?(:partner_merchant) @oauth_access_revocation = OpenStruct.new(@subject[:oauth_application_revocation]) if @subject.has_key?(:oauth_application_revocation) @subscription = Subscription._new(gateway, @subject[:subscription]) if @subject.has_key?(:subscription) @transaction = Transaction._new(gateway, @subject[:transaction]) if @subject.has_key?(:transaction) @transaction_review = OpenStruct.new(@subject[:transaction_review]) if @subject.has_key?(:transaction_review) @disbursement = Disbursement._new(gateway, @subject[:disbursement]) if @subject.has_key?(:disbursement) @dispute = Dispute._new(@subject[:dispute]) if @subject.has_key?(:dispute) @account_updater_daily_report = AccountUpdaterDailyReport._new(@subject[:account_updater_daily_report]) if @subject.has_key?(:account_updater_daily_report) @connected_merchant_status_transitioned = ConnectedMerchantStatusTransitioned._new(@subject[:connected_merchant_status_transitioned]) if @subject.has_key?(:connected_merchant_status_transitioned) @connected_merchant_paypal_status_changed = ConnectedMerchantPayPalStatusChanged._new(@subject[:connected_merchant_paypal_status_changed]) if @subject.has_key?(:connected_merchant_paypal_status_changed) @granted_payment_instrument_update = GrantedPaymentInstrumentUpdate._new(@subject[:granted_payment_instrument_update]) if @subject.has_key?(:granted_payment_instrument_update) @revoked_payment_method_metadata = RevokedPaymentMethodMetadata._new(gateway, @subject) if [Kind::GrantedPaymentInstrumentRevoked, Kind::PaymentMethodRevokedByCustomer, Kind::GrantedPaymentMethodRevoked].include?(@kind) @local_payment_completed = LocalPaymentCompleted._new(@subject[:local_payment]) if @subject.has_key?(:local_payment) && Kind::LocalPaymentCompleted == @kind @local_payment_expired = LocalPaymentExpired._new(@subject[:local_payment_expired]) if @subject.has_key?(:local_payment_expired) && Kind::LocalPaymentExpired == @kind @local_payment_funded = LocalPaymentFunded._new(@subject[:local_payment_funded]) if @subject.has_key?(:local_payment_funded) && Kind::LocalPaymentFunded == @kind @local_payment_reversed = LocalPaymentReversed._new(@subject[:local_payment_reversed]) if @subject.has_key?(:local_payment_reversed) && Kind::LocalPaymentReversed == @kind @payment_method_customer_data_updated_metadata = PaymentMethodCustomerDataUpdatedMetadata._new(gateway, @subject[:payment_method_customer_data_updated_metadata]) if @subject.has_key?(:payment_method_customer_data_updated_metadata) && Kind::PaymentMethodCustomerDataUpdated == @kind end
Public Instance Methods
check?()
click to toggle source
# File lib/braintree/webhook_notification.rb, line 135 def check? !!@subject[:check] end
errors()
click to toggle source
# File lib/braintree/webhook_notification.rb, line 127 def errors @error_result.errors if @error_result end
merchant_account()
click to toggle source
# File lib/braintree/webhook_notification.rb, line 123 def merchant_account @error_result.nil? ? @merchant_account : @error_result.merchant_account end
message()
click to toggle source
# File lib/braintree/webhook_notification.rb, line 131 def message @error_result.message if @error_result end