Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
- class Quickbooks extends CI_Controller {
- public function oauth(){
- $this->load->helper('quickbooks');
- $this->load->library('sq_library');
- $this->config->load('quickbooks');
- $qb_other = $this->config->item('qb_other');
- $qb_application = $this->config->item('qb_application');
- $dsn = $qb_other['dsn'];
- $encryption_key = $qb_other['encryption_key'];
- $oauth_consumer_key = $qb_application['development']['oauth_key'];
- $oauth_consumer_secret = $qb_application['development']['oauth_secret'];
- $the_username = $qb_other['the_username'];
- $the_tenant = $qb_other['the_tenant'];
- $this->sq_library->config();
- if(count($_GET) == 0){
- $this->sq_library->authenticate();
- }else{
- //var_dump($_GET);
- $oauth_token = $_GET['oauth_token'];
- $oauth_verifier = $_GET['oauth_verifier']
- $realmId = $_GET['realmId'];
- $dataSource = $_GET['dataSource']
- $IPP = new QuickBooks_IPP($dsn);
- $IntuitAnywhere = new QuickBooks_IPP_IntuitAnywhere($dsn, $encryption_key, $oauth_consumer_key, $oauth_consumer_secret);
- $creds = $IntuitAnywhere->load($the_username, $the_tenant);
- /*
- $Service = new QuickBooks_IPP_Service_SalesReceipt();
- $SalesReceipt = new QuickBooks_IPP_Object_SalesReceipt();
- $Header = new QuickBooks_IPP_Object_Header();
- $Header->setDocNumber('TESTabcd');
- $Header->setTxnDate(date('Y-m-d'));
- $Header->setCustomerName('ConsoliBYTE, LLC');
- $SalesReceipt->addHeader($Header);
- $Line = new QuickBooks_IPP_Object_Line();
- $Line->setAmount(525);
- $Line->setItemName('Test Item 1');
- $Line->setQty(5);
- $SalesReceipt->addLine($Line);
- $ID = $Service->add($Context, $realmID, $SalesReceipt);
- */
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement