质疑显示
您必须在 iframe 中有一个自我提交的表格,以显示发卡机构质疑屏幕。
要在 iframe 中显示发卡机构质疑屏幕,请使用身份验证响应中的以下参数:
challenge.reference
challenge.url
challenge.jwt
iframe 中的内容来自发卡银行。银行会对您的客户执行身份校验。
可选 MD 字段
传递专门针对结账会话的数据,随后这些数据便会在最初于challenge.returnUrl
内出现。例如,结账 sessionId。提供的任何值均必须是以最多 1024 个字符编码的 URL。
质疑表
一旦有了 JWT
和 URL
,您就可以创建和提交质疑表。
以下是您如何在 iframe 中设置质疑表的示例。
使用将 POST 质疑表的页面的 URL,创建 iframe 并设置
src
属性。 此 URL 应该在查询字符串参数中包含challenge.jwt
、challenge.url
和可选MD
,因为在质疑表中将会使用它们。Copied!<iframe height= "400" width= "390" src="replace-this-with-the-url-of-your-page-that-posts-the-challenge-form"></iframe>
<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
- 大小必须为 390x4002.x.x
- 匹配在身份验证请求 中提供的值。如果未提供,则使用默认值 390x400。
创建并托管 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>
<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.returnUrl
的 POST
(您在
returnUrl POST 中的表格数据:
验证
一旦填写了质疑,您就必须发出一个验证请求来验证质疑表的结果。
POST 您的验证请求至在您的身份验证响应中收到的 3ds:verify
操作链接(如果您的结果是 challenged
)。
验证示例请求
POST https://try.access.worldpay.com/verifications/customers/3ds/verification
验证请求正文:
{
"transactionReference": "Memory265-13/08/1876",
"merchant": {
"entity": "default"
},
"challenge": {
"reference": "123456789"
}
}
验证响应
最佳实践:Access Worldpay 在服务响应的头文件中返回WP-CorrelationId
。我们强烈建议您将此记录下来。我们使用WP-CorrelationId
检查单个服务请求。
以下是您会收到的验证响应的示例。若要了解这些结果的含义以及如何为测试的目的而重现这些结果,请参见
{
"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"
}]
}
}
使用值:version
、authenticationValue
、eci
、transactionId
,它们都源自
参数 | 描述 |
---|---|
authentication.version | 用于处理该交易的 3DS 版本。 注释:对于授权中的 Mastercard 身份校验交易是必需的。 |
authentication.authenticationValue | 提供 3DS 验证结果证据的密码值。
在 |
authentication.eci | 电子商务指标 (ECI)。 表示 3DS 身份验证的结果。
您会在 |
authentication.transactionId | 交易识别码。 如果提供,则您应将它用作 如果 authentication.version 具有以下主要版本:
|
后续步骤