Skip to content

[Card service] Handle payment cancelled & funded events #3654

@mkurapov

Description

@mkurapov

Context

Now that we are sending outgoing payment cancelled & funded events (RAF-1156), we can update how we handle those events in card service.

Depending on the event, we will return a different result for the waiting /payment request (from POS Service).

Todo

  • Make sure we return 200 as the status code when we receive the webhook in card service. (Otherwise, the webhook service will fail)

  • If we get an outgoing payment cancelled event (with invalid_signature), to the original request from POS service, we should return

    {
        "requestId":"",
        "result": {
            "code": "invalid_signature",
            "description":"Invalid card signature"
        }
    }
    
  • If we get an outgoing payment funded event, we should return:

    {
        "requestId":"",
        "result": {
            "code": "approved",
        }
    }
    
  • If there was some other error in the request, we should throw a 400 Bad Request with the following:

    {
        "error": {
            "code": "invalid_request",
            "description":"" // some useful debugging information
        }
    }
    

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions