2012-04-16 29 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