2012-04-16 58 views

回答

1

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

下面是handling Silent Post submissions with 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 
    } 
} 
?> 

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

+0

您好约翰感谢回答我,但那里获得交易的另一种方式详情。因为如果我们的服务器停机或维护时间比我们在无声后调用期间不会得到任何正在执行的条目。 感谢您的及时响应。 – 2012-04-23 11:19:40