-
Notifications
You must be signed in to change notification settings - Fork 43
Description
Background information
Currently, there are a few flaws with customer callback logic:
First,
Business server must always call notify_customer_info_updated on status update, even if the original request comes from the Anchor Platform, as part of PUT callback. If business doesn't call RPC, transaction status is not updated appropriately.
We make a callback to wallet both in RPC and in PUT /customer that leads to duplicate update on the wallet size.
Second, according to the SEP-12 spec, we should only send callbacks when status has been changed. Currently, we send callback on any PUT request and any RPC call (that is also done as part of PUT request handling).
Business server PUT callback proposal change
We propose to change PUT callback for the business server. It should now return full Customer body response. This will allow us to not require business to call RPC on sync updates anymore. Instead, we can perform the same logic in PUT handler (update transaction status)
Second, we should add a new required boolean field to Business Server PUT callback response (status_updated). When set to true, we will fire an customer status change event. If set to false, nothing happens.
In return, as RPC is used to sync updates, we should always fire customer status change events (the way it's done now)