2

我的任务是在我们现有的网站上实施 3D Secure 信用卡验证。我只是想知道是否有人有任何设置 3D Secure 的示例代码?

我一直在阅读文档,但什么也没找到。

4

2 回答 2

2

我试图让与我一起工作的其中一个人在这里发布一些东西,因为他实际上是为我们的一个客户写的,但我会带你完成我理解的过程。

基本上,一旦您执行了您执行的任何预验证请求(例如使用 DataCash 二进制文件),您就可以使用 DataCash 代理向 DataCash 提交付款请求以发送付款请求。

如果您在 DataCash 帐户上设置了 3D Secure,并且您已通过字段发送说此交易可能发生在 3DS 上,您可能会收到返回的状态代码 150:

<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <CardTxn>
    <card_scheme>...</card_scheme>
    <country>...</country>
    <issuer>...</issuer>
    <ThreeDSecure>
      <acs_url>...</acs_url>
      <pareq_message>...</pareq_message>
    </ThreeDSecure>
  </CardTxn>
  <datacash_reference>...</datacash_reference>
  <merchantreference>...</merchantreference>
  <mode>TEST</mode>
  <reason>3DS Payer Verification Required</reason>
  <status>150</status>
  <time>...</time>
</Response>

连同 CardTxn 元素中的 ThreeDSecure 块。

然后,您需要获取 acs_url 和 pareq_message,并使用它们向发卡行提交请求以进行授权。

这通常采用自提交 JavaScript 表单的形式,可以发布到 IFrame 中:

<!-- Action comes from acs_url returned by DataCash -->
<form method="post" 
      target="3dAuthFrame"
      action="https://testserver.datacash.com/acs">
  <!-- Value comes from pareq_message returned by DataCash -->
  <input value="[...]"
         name="PaReq"
         type="hidden" />
  <!-- Value is a merchant specified identifier that is dislayed to the user -->
  <input value="[...]"
         name="MD" 
         type="hidden" />
  <!-- Value is a public URL that the 3D Secure server will post back to -->
  <input type="hidden" 
         name="TermUrl" 
         value="[...]"/>
  <p>
    If you do not see your card issuer's instructions, below, please click 
    <input value="Continue" name="TDAction" type="submit" />
  </p>
  <iframe style="width:100%;height:400px" 
          src="javascript:''"
          name="3dAuthFrame"></iframe>
  <script type="text/javascript">
    document.forms[0].elements.TDAction.click();
    document.forms[0].elements.TDAction.disabled=true;</script>
</form>

然后 TermUrl 的页面将收到来自 3D 安全服务器的调用,表单字段为“PaRes”和“MD”(即来自发卡行的响应,以及您之前提供的参考)。

然后,您将这些授权详细信息作为历史交易提交回 DataCash 以完成付款。

有关这方面的详细信息,请参见第 D.4 节。3-D 安全,在开发人员指南和此页面上使用 DataCash MPI (可能需要登录)。

如果您需要更多详细信息,请告诉我,我会尝试在此处获取更多详细信息。

于 2009-08-26T15:36:21.260 回答
2

我现在写了一篇关于这个的文章...... http://www.alexjamesbrown.com/blog/development/implementing-datacash-3d-secure-with-asp-net/

希望这可以帮助那些从谷歌偶然发现这个的人....

于 2010-02-23T18:45:21.333 回答