You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is really minor but it makes sense. When processing a notification, you need to call @notification.id to pull up the reference number (order number you provided).
I think it readers better if it were @notification.order_id or @notification.reference_id to stay consistent with PagSeguro's API. Check this out:
class PagSeguroNotification
def initialize(notification_code)
@notification = PagSeguro::Notification.new(PAGSEGURO_EMAIL, PAGSEGURO_TOKEN, notification_code)
end
def get
# I'm grabbing the order by calling @notification.id, which can be confusing
# Calling @payment.id doesn't read better either
order = Order.find(@payment.id)
# ...
end
end
The text was updated successfully, but these errors were encountered:
I guess we could create an alias to id as reference (and not reference_id, since reference is the actual attr name that pagseguro returns). I dont like order_id, because users may not name it Order. It could be Invoice, Payment or something else completely.
But i dont intend to remove id, i really think that it makes sense for a notification's id to return the reference, since it is supposed to be a unique payment identifier on the system. It also is very well documented, both on specs and README.
This is really minor but it makes sense. When processing a notification, you need to call
@notification.id
to pull up the reference number (order number you provided).I think it readers better if it were
@notification.order_id
or@notification.reference_id
to stay consistent with PagSeguro's API. Check this out:The text was updated successfully, but these errors were encountered: