Payment control


The Mastercard network always requires Swan to either approve or deny transactions. With the Payment control feature, you are brought into the process. Payment Control allows you to approve or deny every single card transaction.

When activated, Swan will send you the transaction details received by Mastercard and take your answer into account. We'll do our own tests (does the card and account exist? are there enough funds?), if everything is OK on our side, we'll take your answer into account. Only then do we answer Mastercard.

Time is very sensitive in this operation. A timeout from Swan will result in a declined operation for the cardholder. Therefore, you'll want to test this feature thoroughly. We provide all the materials you need to test in our sandbox, including the ability to set a default answer in case of timeout.

Transaction flow

Add a payment control endpoint

The updateCardPartnerControlmutation is used to set up and update the payment control. Here are the available settings:

  • endpoint: your endpoint (mandatory)

  • protocol: for now, it must be HttpJson

  • defaultResponse: in case of timeout, can be true or false

  • timeoutMs: to allow you more flexibility, up to 10s in the sandbox environment and 1s in the live environment.

  • secret: we'll add your secret to a "x-swan-secret" header

Transaction data sent

We add flags to specify that Swan is making the POST request :

  • An "x-swan" http header

  • An "x-swan-secret" http header with the provided secret

The payload is as follows. All fields are optional as they are subject to changes:

  • timeout: epoch millis at which we'll fallback on default response

  • transactionId

  • paymentId

  • accountId

  • cardId

  • dateTime: epoch millis at which the payment occurred

  • originalAmountValue

  • originalAmountCurrency

  • amountValue

  • amountCurrency

  • merchantId

  • merchantCategoryCode

  • merchantName

  • merchantCity

  • merchantCountry

  • category

  • authorizationType

Your answer

As an answer, we expect a boolean in the accepted field. We'll take your default response into account if we don't have an answer from you after the timeout or endpoint contact error.

We suggest a default response true from a client perspective.

It could happen that both of our answers (yours and Swan's) aren't accepted by Mastercard due to QoS and delegation process