【问题标题】:Chasepaymentech Orbital Gateway - Issues with ecommerce in PHPChasepaymentech Orbital Gateway - PHP 中的电子商务问题
【发布时间】:2015-01-16 01:16:01
【问题描述】:

我一直在使用 Chase Paymentech 作为客户的电子商务网关。最近,他们将托管服务转移到了 GoDaddy,从那时起,电子商务就一直在运作。我曾尝试使用 Chase 和 GoDaddy 解决此问题,但最终都没有太大帮助。我已验证 Chase 已将 GoDaddy 托管服务器的新 IP 附加到我的帐户。

我从 Chase 技术支持得到的答复是,我的请求永远不会到达他们的网关。然而,当我尝试时,我得到了一个 XML 响应。

$url = "https://orbital1.paymentech.net"; // use for production


$fltGrandTotal = "1.00";
$exp   = "0117"; 
$strCardNumber = "4242424242424242";
$_SESSION[UUID] = '9999555444';

$fltGrandTotal = str_replace(',', '', $fltGrandTotal); 
$total = number_format($fltGrandTotal, 2);
$total2 = str_replace('.', '', $total); 


$post_string="
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<Request>
<NewOrder>
<IndustryType>EC</IndustryType>
<MessageType>AC</MessageType>
<BIN>000002</BIN>
<MerchantID>XXXXXXX</MerchantID>
<TerminalID>001</TerminalID>
<CardBrand></CardBrand>
<AccountNum>$strCardNumber</AccountNum>
<Exp>$exp</Exp>
<OrderID>$_SESSION[UUID]</OrderID>
<Amount>100</Amount>
<Comments></Comments>
<ShippingRef></ShippingRef>
</NewOrder>
</Request>
";


$header= "POST /authorize/ HTTP/1.0\r\n";       
$header.= "MIME-Version: 1.0\r\n";
$header.= "Content-type: application/PTI43\r\n";
$header.= "Content-length: "  .strlen($post_string) . "\r\n";
$header.= "Content-transfer-encoding: text\r\n";
$header.= "Request-number: 1\r\n";
$header.= "Document-type: Request\r\n";
$header.= "Interface-Version: Test 1.4\r\n";
$header.= "Connection: close \r\n\r\n";                
$header.= $post_string;


$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
curl_setopt($ch, CURLOPT_HEADER, false);                
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $header);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

$data = curl_exec($ch);        
if (curl_errno($ch)) {
 //print curl_error($ch);
} else {
 curl_close($ch);
}



$sitemap = simplexml_load_string($data);

foreach($sitemap as $url) {
    $approval = $url->ApprovalStatus;
    $txRefNum = $url->TxRefNum;
    $message = $url->StatusMsg;
    $authcode = $url->AuthCode;
}

echo "approval: $approval<br>";
echo "txRefNum: $txRefNum<br>";
echo "message: $message<br>";
echo "authcode: $authcode<br>";

我收到的 XML 是:

<?xml version="1.0" encoding="UTF-8"?><Response><QuickResponse HcsTcsInd="T" Version="2">    <ProcStatus>20400</ProcStatus><StatusMsg StatusMsgLth="15">Invalid Request</StatusMsg></QuickResponse></Response>

他们要求我做一些事情,例如设置与以前相同的托管环境,使用完全相同的 PHP 版本等。我真的不明白为什么这会对事情产生任何影响。

【问题讨论】:

  • 卡在同一点。如果您有解决方案,请告诉我。

标签: php api


【解决方案1】:

他们的技术支持(哈哈!)的回答具有误导性,因为这样的快速响应甚至不会被记录到他们可以“看到”的系统中。

为了减轻“黑客网络钓鱼”的影响,轨道响应故意变得迟钝。为了防止泄露攻击向量,任何安全问题都会产生一个简单的错误响应。发生这种情况时,假设合法使用正在发挥作用,请至少验证以下内容:

  • 发起请求的服务器的 IP 是静态分配的。
  • 发起请求的服务器 IP 与商家 ID 认证期间使用的 IP 相同。
  • 您的商家 ID 已激活并且与认证的相同。
  • 提交的交易与经过认证的交易属于同一行业。
  • 您的 OrderID 是唯一的。提交重复的 OrderID 将失败。
  • 提交的 XML 元素符合 PTI 版本(也就是上面的“Content-Type”)。
  • 您的金额包括隐含的小数(由于金额字段包含“100”,上述示例将被处理为 1.00 美元)。
  • 不要提交您没有内容或不适用于交易的可选字段(在上述情况下,CardBrand 很可能未通过请求,尽管空的 ShippingRef 也是无意义的) .

简而言之,使用与使用的 XML 版本号相关的 PTI 规范文档验证您发送的每个交易类型。当该文档将某个字段指示为“条件”时,确保该条件与您提交的特定交易相关。如果某个字段被记录为“可选”并且您没有任何可提供的内容,则不要包含它。

【讨论】:

    猜你喜欢
    • 2012-09-10
    • 1970-01-01
    • 2021-11-04
    • 1970-01-01
    • 1970-01-01
    • 2011-07-31
    • 2016-03-04
    • 2019-11-15
    • 1970-01-01
    相关资源
    最近更新 更多