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)
Background information
Currently, there are a few flaws with customer callback logic:
First,
Business server must always call
notify_customer_info_updatedon status update, even if the original request comes from the Anchor Platform, as part ofPUTcallback. If business doesn't call RPC, transaction status is not updated appropriately.We make a callback to wallet both in RPC and in
PUT /customerthat 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
PUTrequest and any RPC call (that is also done as part ofPUTrequest handling).Business server
PUTcallback proposal changeWe propose to change
PUTcallback 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 inPUThandler (update transaction status)Second, we should add a new required boolean field to Business Server
PUTcallback response (status_updated). When set totrue, we will fire an customer status change event. If set tofalse, 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)