В случае, если карта покупателя участвует в программе 3dsecure, то в ответе на запрос к методам purchase или auth будут присутствовать параметры для перехода на страницу банка, выпустивщего карту покупателя.

Последовательность операций

  1. запрос purchase

  2. переадресация покупателя на acsUrl из ответа со следующими параметрами

    1. PaReq - получено из запроса

    2. TermUrl - URL страницы клиента, на которую будет возвращен покупатель после прохождения проверки

    3. MD - сгенерированные клиентом параметр, который будет передан обратно при возврате на TermUrl. Обычно используется идентификации покупателя

  3. запрос complete3ds с параметром paRes, полученным при возврате на TermUrl. URL формируется с подстановкой operationId, полученного в ответе на запрос purchase

Примеры запросов и ответов

Purchase

POST /card/1-1/operations/purchase HTTP/1.1
W1-Signature: KcNagg3fOuIu1o4TOLlj01NaEtb/36ImtLo4e7sGx6/RAGIoed9b7QQ/r8pWjj03i+VK6qlg3d0jwzZxpApY0CwNGhVvNIKRZlVyhjDTuGa+s8wMaWRXe/49sU7OoLkDlgawEwscEeva5WDzsI8CxV4tzysuFT2TiIMiauPwf5vhOMqrrmOeEW15AdpjboQafxmGD4/1I0qqf1FL3QLPQeA4XJiguaLhMTwW+x4GyYGOo9FC6J9yviEL13m0LR731FMRjyE3cO8n/FlVSeH3A1n8D9VGjo0S80RDaRoYEr3PACKBzf0O8qhLJr2IG7VeEbNHXXhQqvgQ0LW+ZPA3iA==
Content-Type: application/json
Host: payment.flexo.systems
Content-Length: 750

{
  "notification" : {
    "url" : "http://127.0.0.1:8080/test/callback/default/",
    "version" : 1
  },
  "externalId" : "ext#14",
  "amount" : {
    "amount" : 10.55,
    "currency" : "USD"
  },
  "payer" : {
    "paymentMethod" : {
      "entity" : {
        "pan" : "4916798373459761",
        "expMonth" : 5,
        "expYear" : 2030,
        "cvv" : "444"
      },
      "type" : "CARD"
    },
    "info" : {
      "ip" : "127.0.0.1",
      "email" : "no-reply@example.com",
      "phone" : "9001234567"
    }
  },
  "merchantParameters" : {
    "param1" : "anything you want for callback",
    "param2" : null,
    "param3" : null
  },
  "registerRecurring" : true,
  "tds" : {
    "notificationUrl" : "http://tds.notification.url:6789"
  }
}
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 295

{
  "operationId" : "1-1-a-12",
  "status" : "WAITING_FOR_CONFIRMATION",
  "type" : "PURCHASE",
  "externalId" : "ext#14",
  "params" : {
    "acsUrl" : "http://testacs:9191/test/acs/3ds1",
    "PaReq" : "good"
  },
  "actions" : {
    "required" : [ {
      "type" : "complete3ds"
    } ]
  }
}

Complete3ds

POST /card/1-1/operations/1-1-a-52/complete3ds HTTP/1.1
W1-Signature: dvCWrX4NbpIgCt+L9RMperA8ho1UAaoZLvAAgxRP977oDzW15k29VUZKmISPQ73Dyh2x4Z2yTJaTwEqRa/LpZ5xh0SIhRvBqzEssWqI3vC4BZHuRKVDaiDztc/oX2K6jTjr+UPDfWQLOPcyakuv6g549k/0FrFPdFzkeaxFuWNFRptrmtkAav3iwlkf+T8WXPdEbOVWWvmTCVc2JxwomwkHG8+r8CHyoRXlD+oF1nH4ethFXG6GxzYyhQIIw6ySuW9KOv3trtClsSJlmYsr/iOYaK3EESkEp3WcQyaadgWGjj+pUZrqoThIbavr9IEE9x0s/zbFx457Y+n3hLNj4/A==
Content-Type: application/json
Host: payment.flexo.systems
Content-Length: 26

{
  "paRes" : "verified"
}
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json
Content-Length: 168

{
  "operationId" : "1-1-a-52",
  "status" : "SUCCEEDED",
  "type" : "PURCHASE",
  "externalId" : "ext#63",
  "params" : { },
  "actions" : {
    "required" : [ ]
  }
}

Уведомление клиента со стороны Flexo (Callback)

POST /test/emptycallback HTTP/1.1
W1-Signature: G/YOqQZkMHeM4pR/1ilrnBsUDCzxz9502v4R9yr9QnpTr5PL1jKf5kv//ZT25e9MOs1XpgQBKnhlfvsnYdLDIb25kfSb7phZjeYh5OBlG5hrEiPw77KjAAdeNTEZ07GzpCvMm02H3SfMLpE/KkrCwNSUQbsmkQvNqX6CCB7MqXY0a2NyiHAkbMxftMJ4ftwRfCvt21nvHEVYMbvYkNlAKWTASqQO0cblyJFkNkdbeJwjN23bdWJRCW20JNDMHQbgOYdlbuAcNnJKBVVNJXTnnY/bO83arOXkFVhprqeqZVQzOHrCSVCuyXQmOrUGwo4GWDfIfaykgxZoZ5A+zNr1lw==
Content-Type: application/json
Host: payment.flexo.systems
Content-Length: 880

{
  "id" : "1-1-a-12",
  "type" : "PURCHASE",
  "externalId" : "ext#14",
  "successful" : true,
  "amount" : {
    "amount" : 10.55,
    "currency" : "USD"
  },
  "baseAmount" : {
    "amount" : 10.55,
    "currency" : "USD"
  },
  "registeredMethods" : [ {
    "entity" : {
      "id" : "1-2"
    },
    "type" : "RECURRING_TOKEN"
  }, {
    "entity" : {
      "id" : "payoutToken-491679-something-9761"
    },
    "type" : "PAYOUT_TOKEN"
  } ],
  "merchantParameters" : {
    "param1" : "anything you want for callback",
    "param2" : null,
    "param3" : null
  },
  "status" : "SUCCEEDED",
  "transactions" : [ {
    "type" : "PURCHASE",
    "status" : "SUCCEEDED"
  }, {
    "type" : "COMPLETE3DS",
    "status" : "SUCCEEDED"
  } ],
  "payer" : {
    "paymentMethod" : {
      "entity" : {
        "pan" : "491679XXXXXX9761"
      },
      "type" : "MASKED_CARD"
    }
  }
}
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers