使用 curl 请求 API 获取 Authorize.net 中的 ARB 付款流程日志


Get Log of ARB Payment Process in Authorize.net using curl Request API?

如何使用 Zend Framework 获取 ARB 事务日志列表?

实际上我已经浏览了 Authorize.net 的交易详细信息API,但没有ARB的范围。 所以任何人都可以建议我哪个是这个问题的更好的替代解决方案。

提前谢谢。

无法返回并获取有关过去订阅的详细信息。您能做的最好的事情就是在他们进行预定付款时记录当前状态。Authorize.Net 提供类似于PayPal的IPN的服务,称为Silent Post,该服务发送有关为帐户运行的所有交易的交易信息。这包括 ARB 订阅。

以下是使用 PHP 处理静默帖子提交并仅处理 ARB 订阅付款的基本脚本:

<?php
// Get the subscription ID if it is available. 
// Otherwise $subscription_id will be set to zero.
$subscription_id = (int) $_POST['x_subscription_id'];
// Check to see if we got a valid subscription ID.
// If so, do something with it.
if ($subscription_id !== 0)
{
    // Get the response code. 1 is success, 2 is decline, 3 is error
    $response_code = (int) $_POST['x_response_code'];
    // Get the reason code. 8 is expired card.
    $reason_code = (int) $_POST['x_response_reason_code'];
    if ($response_code == 1)
    {
        // Approved!
        // Some useful fields might include:
        // $authorization_code = $_POST['x_auth_code'];
        // $avs_verify_result  = $_POST['x_avs_code'];
        // $transaction_id     = $_POST['x_trans_id'];
        // $customer_id        = $_POST['x_cust_id'];
    }
    else if ($response_code == 2)
    {
        // Declined
    }
    else if ($response_code == 3 && $reason_code == 8)
    {
        // An expired card
    }
    else 
    {
        // Other error
    }
}
?>

免责声明:我写了两篇博客文章