Translation disclaimer

Documentation is written in English and subsequently translated. This page, therefore, might not have the most up-to-date content. If any questions arise relating to the accuracy of the translated content, please refer to the English version of the page.

Menu

质疑显示

您必须在 iframe 中有一个自我提交的表格,以显示发卡机构质疑屏幕。

要在 iframe 中显示发卡机构质疑屏幕,请使用身份验证响应中的以下参数:

  • challenge.reference
  • challenge.url
  • challenge.jwt

iframe 中的内容来自发卡银行。银行会对您的客户执行身份校验。

可选 MD 字段

传递专门针对结账会话的数据,随后这些数据便会在最初于身份验证请求中提供的 challenge.returnUrl 内出现。例如,结账 sessionId。提供的任何值均必须是以最多 1024 个字符编码的 URL。

质疑表

一旦有了 JWTURL,您就可以创建和提交质疑表。

以下是您如何在 iframe 中设置质疑表的示例。

  1. 使用将 POST 质疑表的页面的 URL,创建 iframe 并设置 src 属性。 此 URL 应该在查询字符串参数中包含 challenge.jwtchallenge.url 和可选 MD,因为在质疑表中将会使用它们。

    Copied!
    <iframe height= "400" width= "390" src="replace-this-with-the-url-of-your-page-that-posts-the-challenge-form"></iframe>

    您为 iframe 指定的大小取决于您是否在身份验证请求中提供了 challenge.windowSize,以及在身份认证响应中返回的 authentication.version

    对于以下的 authentication.version 值:

    • 1.x.x - 大小必须为 390x400
    • 2.x.x - 匹配在身份验证请求中提供的值。如果未提供,则使用默认值 390x400。
  2. 创建并托管 POST 质疑表的页面。

    Copied!
    <html>
    <head>
    </head>
    <body>
    
      <!-- Using your preferred programming language, set the 'action' attribute with the value of the query string parameter containing the 'challenge.url' from the authentication response -->
      <form id="challengeForm" method= "POST" action="https://challengeUrl.example.com">
    
        <!-- Using your preferred programming language, set the 'value' attribute with the value of the query string parameter containing the 'challenge.jwt' from the authentication response -->
        <input type = "hidden" name= "JWT" value= "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI1NDQzOGIzYS1iYjUzLTEyY2QtODY0My0xNTM2YmU3M2ZmMzUiLCJpYXQiOiIzODU2NzI5NDgyIiwiaXNzIjoiNWJkOWUwZTQ0NDRkY2UxNTM0MjhjOTQwIiwiT3JnVW5pdElkIjoiNWJkOWI1NWU0NDQ0NzYxYWMwYWYxYzgwIiwiUmV0dXJuVXJsIjoiaHR0cDovL21lcmNoYW50LmV4YW1wbGUuY29tL3RocmVlZHNjaGFsbGVuZ2Vjb21wbGV0ZSIsIlBheWxvYWQiOnsiQUNTVXJsIjoiaHR0cHM6Ly9hY3MuZXhhbXBsZS5jb20vM2RzMi9jaGFsbGVuZ2U_aWQ9MTIzNDU2Nzg5IiwiUGF5bG9hZCI6IlZHaHBjeUJwY3lCaElHSmhjMlVnTmpRZ1pXNWpiMlJsWkNCbGVHRnRjR3hsSUc5bUlHRWdNMFJUSUNKd1lYbHNiMkZrSWc9PSIsIlRyYW5zYWN0aW9uSWQiOiJzUk1QV0NRb1FyRWlWeGVoVG51MCJ9LCJPYmplY3RpZnlQYXlsb2FkIjp0cnVlfQ.3Dqjr5MuEC9AG7uvsJCft94-d70NmgR94zIeru8fAYE" />
    
        <!-- Optional field (max 1024 characters) for you to pass url parameters in the challenge form that will be included/echoed in the response url (`challenge.returnUrl`) after the challenge is complete -->
        <input type="hidden" name="MD" value="merchantSessionId=1234567890" />
    
      </form>
    
      <script>
        window.onload = function() {
          // Auto submit form on page load
          document.getElementById('challengeForm').submit();
        }
      </script>
    
    </body>
    </html>

注释:如果您在质疑表的 POST 上收到了 400 响应,则要确保:

  • JWT 未过期(10 分钟)
  • 元素/表格数据名称为大写(e.g.,JWT),如示例所示

质疑 returnUrl

一旦发卡机构质疑完成,就会有对 challenge.returnUrlPOST(您在身份验证请求中提供)。这应该转到后端,您可以在这里检索任何表格数据、发起验证请求,并根据验证响应的结果在 iframe 中显示页面。

returnUrl POST 中的表格数据:

  • TransactionId - 与身份验证响应中的 challenge.reference 相同并用于验证请求中的值。
  • MD - 如果作为质疑表的一部分被纳入。

验证

一旦填写了质疑,您就必须发出一个验证请求来验证质疑表的结果。

POST 您的验证请求至在您的身份验证响应中收到的 3ds:verify 操作链接(如果您的结果是 challenged)。

验证示例请求

POST https://try.access.worldpay.com/verifications/customers/3ds/verification

验证请求正文:

Copied!
{
    "transactionReference": "Memory265-13/08/1876",
    "merchant": {
        "entity": "default"
    },
    "challenge": {
        "reference": "123456789"
    }
}

验证响应

最佳实践:Access Worldpay 在服务响应的头文件中返回WP-CorrelationId。我们强烈建议您将此记录下来。我们使用WP-CorrelationId检查单个服务请求。

以下是您会收到的验证响应的示例。若要了解这些结果的含义以及如何为测试的目的而重现这些结果,请参见3DS 测试

Copied!
{
    "outcome": "authenticated",
    "transactionReference": "Memory265-13/08/1876",
    "authentication": {
        "version": "2.1.0",
        "authenticationValue": "MAAAAAAAAAAAAAAAAAAAAAAAAAA=",
        "eci": "05",
        "transactionId": "c5b808e7-1de1-4069"
    }
}
{
    "outcome": "authenticationFailed",
    "transactionReference": "Memory265-13/08/1876",
    "authentication": {
      "version": "1.0.2",
      "eci": "00",
      "transactionId": "N+en2I5+ZK/kQqk69wXdI8XIPg8="
    },
    "_links": {
        "3ds:authenticate": {
            "href": "https://try.access.worldpay.com/verifications/customers/3ds/authentication"
        },
        "curies": [{
            "href": "https://try.access.worldpay.com/rels/verifications/customers/3ds/{rel}",
            "templated": true,
            "name": "3ds"
        }]
    }
}
{
    "outcome": "signatureFailed",
    "transactionReference": "Memory265-13/08/1876",
    "authentication": {
      "version": "1.0.2",
      "eci": "02"
    },
    "_links": {
        "3ds:authenticate": {
            "href": "https://try.access.worldpay.com/verifications/customers/3ds/authentication"
        },
        "curies": [{
            "href": "https://try.access.worldpay.com/rels/verifications/customers/3ds/{rel}",
            "templated": true,
            "name": "3ds"
        }]
    }
}
{
    "outcome": "unavailable",
    "transactionReference": "Memory265-13/08/1876",
    "_links": {
        "3ds:authenticate": {
            "href": "https://try.access.worldpay.com/verifications/customers/3ds/authentication"
        },
        "3ds:verify": {
            "href": "https://try.access.worldpay.com/verifications/customers/3ds/verification"
        },
        "curies": [{
            "href": "https://try.access.worldpay.com/rels/verifications/customers/3ds/{rel}",
            "templated": true,
            "name": "3ds"
        }]
    }
}

使用值:versionauthenticationValueecitransactionId,它们都源自授权支付时的请求。这些值证明了验证已成功,并且欺诈赔偿责任已经转移到发卡机构。

参数描述
authentication.version用于处理该交易的 3DS 版本。

注释:对于授权中的 Mastercard 身份校验交易是必需的。

authentication.authenticationValue提供 3DS 验证结果证据的密码值。
  • Visa - 持卡人身份验证的验证值 (CAVV)
  • Mastercard - 通用持卡人身份验证字段 (UCAF)

授权支付时使用。
authentication.eci电子商务指标 (ECI)。
表示 3DS 身份验证的结果。
  • 02 或 05 - 完全身份验证的交易
  • 01 或 06 - 尝试身份验证的交易
  • 00 或 07 - 非 3-D 安全交易
  • Mastercard - 02、01、00
  • Visa - 05、06、07
  • Amex - 05、06、07
  • JCB - 05、06、07
  • Diners - 05、06、07

您会在授权支付时用到它。
authentication.transactionId交易识别码。
如果提供,则您应将它用作支付授权的一部分。
如果 authentication.version 具有以下主要版本:
  • 1- 作为 xid返回的值
  • 2 - 作为 dsTransactionId 返回的值

后续步骤


接受支付
3DS 测试