[英]QuickBooks PHP API - Can't get through the oAuth process again
首先,我正在使用https://github.com/consolibyte/quickbooks-php
我不小心從“應用程序”頁面斷開了該應用程序的連接,以嘗試重新連接(獲取新的身份驗證憑據),但看來這是一個錯誤。
因此,現在我嘗試再次進行授權過程,但是如《快速入門指南》所述,單擊“ docs / example_app_ipp_v3 /”頁面上的“連接到QuickBooks”按鈕時遇到錯誤。
我在這里想念什么嗎? 我仍然可以通過API資源管理器查詢,但是當我在代碼中使用$ InvoiceService-> query時,似乎無法獲取任何數據(只是返回false)。
//get invoice info
require_once '../includes/quickbooks-php/config.php';
// Set up the IPP instance
$IPP = new QuickBooks_IPP($dsn);
// Get our OAuth credentials from the database
$creds = $IntuitAnywhere->load($the_username, $the_tenant);
//error_reporting(0);
//ini_set('display_errors', 1);
// Tell the framework to load some data from the OAuth store
$IPP->authMode(
QuickBooks_IPP::AUTHMODE_OAUTH,
$the_username,
$creds);
// This is our current realm
$realm = $creds['qb_realm'];
// Load the OAuth information from the database
if ($Context = $IPP->context())
{
// Set the IPP version to v3
$IPP->version(QuickBooks_IPP_IDS::VERSION_3);
$CustomerService = new QuickBooks_IPP_Service_Customer();
$InvoiceService = new QuickBooks_IPP_Service_Invoice();
$ItemService = new QuickBooks_IPP_Service_Item();
$PaymentService = new QuickBooks_IPP_Service_Payment();
$invoice_query = $InvoiceService->query($Context, $realm, "SELECT *, Line.* FROM Invoice WHERE Id = '" .QuickBooks_IPP_IDS::usableIDType($main_invoice['qb_invoice_id']). "'");
$this_invoice = array();
var_dump($invoice_query);
if (count($invoice_query)){
foreach ($invoice_query as $Invoice){
//do stuff with invoice here
}
}
}
我從var_dump($ invoice_query)獲取bool(false),即使它通過if($ Context = $ IPP-> context())
然后,當我訪問“ docs / example_app_ipp_v3 /”頁面時,除了配置已更新為我當前的身份驗證憑證外,“連接到Quickbooks”按鈕(下面的HTML)將我帶到404頁面。
<ipp:connecttointuit><a href="javascript:void(0)" class="intuitPlatformConnectButton">Connect with QuickBooks</a></ipp:connecttointuit>
您是否肯定config.php
文件中的應用程序令牌和其他憑據正確? 如果它們是沙箱/開發令牌,請發布配置文件。
您是否肯定配置文件中的URL是正確的? 如果它們是沙箱/ dev,請發布它們。
$sandbox
是否設置為TRUE或FALSE? 這是否與您使用的令牌相對應?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.