Skip to content

[ANCHOR-793] Update customer callback logic and implementation #1475

@ifropc

Description

@ifropc

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions