Class: PagSeguro::Notification

Inherits:
Object
  • Object
show all
Includes:
Extensions::MassAssignment
Defined in:
lib/pagseguro/notification.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Extensions::MassAssignment

#initialize

Instance Attribute Details

#codeObject

The notification code sent by PagSeguro.



6
7
8
# File 'lib/pagseguro/notification.rb', line 6

def code
  @code
end

#typeObject

The notification type sent by PagSeguro.



9
10
11
# File 'lib/pagseguro/notification.rb', line 9

def type
  @type
end

Instance Method Details

#transactionObject

Fetch the transaction by its notificationCode.



17
18
19
# File 'lib/pagseguro/notification.rb', line 17

def transaction
  Transaction.find_by_notification_code(code)
end

#transaction?Boolean

Detect if the notification is from a transaction.

Returns:

  • (Boolean)


12
13
14
# File 'lib/pagseguro/notification.rb', line 12

def transaction?
  type == "transaction"
end