我在为我的网站创建的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。如果交易失败,我可以设置另一个链接吗?
答案 0 :(得分:0)
如VPC手册中所述 - "使用vpc_ReturnURL字段中指定的Internet浏览器重定向将事务响应返回到您的网站。 DR将始终为在线商店提供安全散列以检查数据完整性。"
基本上它会抛出名为vpc_TxnResponseCode的$GET
变量where-in:
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回复的答案之后,一位朋友能够给我这个资源。