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. Beware that we do our control at the same time as we send you the request, so even if you accept a payment, we can refuse it.
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.
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 1,5s in the live environment.
secret: we'll add your secret to a "x-swan-secret" header
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:
timeoutAt: epoch millis at which we'll fallback to default response
dateTime: epoch millis at which the payment occurred
expirationDateTime: epoch millis at which the authorization will be released if it is not consumed by any debit, or partially consumed by some debit
readMode: Chip, ContactlessChip, ContactlessStripe, Manual, ManualChip, ManualStripe, Other, PreSavedData, Stripe
transactionCategory: InStore, eCommerce, eCommerceWith3DS, Withdrawal, Other
authorizationType: Classic, PreAuthorization, DataRequest
allowsPartialAuthorization: use if the amount can be modified by Swan, or if you can modify it
As an answer, we expect a boolean in the
acceptedfield. If the authorization allows a partial hold of the funds, you can also lower the initial amount by providing the amount you want to send back to the merchant. 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
truefrom 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