从MIGS支付中捕获错误信息

3

我在我的网站上创建的MIGS支付设施遇到了问题。当用户在与migs服务器交互时(付款未成功运行)遇到错误时,我如何知道是否遇到了这样的错误?

以下是我使用的参数(将我的链接替换为示例链接):

"vpc_Amount" => ($amount*100),
                 "vpc_Command" => 'pay',
                 "vpc_Locale" => 'en',// order id
                 "vpc_MerchTxnRef" => $session_id,
                 "vpc_Merchant" => $merchantId,
                 "vpc_OrderInfo" => "Test order",
                 "vpc_ReturnURL" => "http://mywebsite.com/returnUrL",
             "vpc_Version" => '1'

如果支付成功和支付失败都会跳转到同一个returnURL,那么我如何知道它是否失败了?我能否设置另一个链接,在交易失败时跳转到该链接?


幸运的是,我从一个在线朋友那里得到了一本Migs支付手册,并找到了答案。一旦我能够,我会发布它。 - marchemike
1个回答

1
根据VPC手册所述:“交易响应通过Internet浏览器重定向返回到您的网站,如vpc_ReturnURL字段中指定的。DR(数据接收方)将始终具有一个安全哈希用于在线商店检查数据完整性。”
基本上,它会抛出一个名为vpc_TxnResponseCode的$GET变量,其中包含:
The merchant application receipting function needs to be able to calculate the secure hash signature in the Transaction Response to determine if the signature received is valid for the receipt data. It has to handle:
• Incorrect secure hash signatures
• Successful transactions
• If vpc_TxnResponseCode code is equal to '0' then the transaction was completed successfully and you can display a receipt to the cardholder.
• Declined transactions
• If vpc_TxnResponseCode is equal to '1', '2', '3', '4', or '5' the transaction has been declined and this needs to be conveyed back to the cardholder.
• Error Conditions –
• If vpc_TxnResponseCode equals '7' or '8' an error has occurred
• Other values may also indicate an error has occurred
• Further details for error conditions can be gathered by examining the vpc_Message field so a decision can be made as to the next step.
All four of these conditions are responses that can be returned from the Virtual Payment Client.

希望这对其他使用MIGS开发应用程序的人有所帮助。在我告诉一个朋友我正在寻找关于MIGS响应的答案后,他幸运地能够给我这个资源。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接