Coder Social home page Coder Social logo

intuitdeveloper / sampleapp-crud-php Goto Github PK

View Code? Open in Web Editor NEW
64.0 54.0 54.0 480 KB

PHP sample app to show how to define basic CRUD operations for entities available in the QuickBooks API using OAuth 2.0 with Composer

PHP 100.00%
quickbooks sampleapp-crud-php php-sample php

sampleapp-crud-php's Introduction

Rate your SampleYesNo

SampleApp-CRUD-PHP

Please use this CRUD examples combined with the doc: https://intuit.github.io/QuickBooks-V3-PHP-SDK/

You will find examples with using OAuth1/OAuth2 tokens, SendEmail, get Reports, DownloadPDF, etc in the doc.

SampleApp-CRUD-PHP

Welcome to the Intuit Developer's PHP Sample App for CRUD operations.

This sample app provides working examples of how to integrate your app with the Intuit Small Business ecosystem. Specifically, this sample app demonstrates how to:

  • Use the Create, Read, Query, Update, Delete, and Void entities
  • Perform operations using the QuickBooks PHP SDK

Note that while these examples work, features not called out above are not intended to be taken and used in production business applications. In other words, this is not a seed project to be taken cart blanche and deployed to your production environment.

For example, certain concerns are not addressed at all in our samples (e.g., security, privacy, scalability). In our sample apps, we strive to strike a balance between clarity, maintainability, and performance where we can. However, clarity is ultimately the most important quality in a sample app.

Therefore there are certain instances where we might forgo a more complicated implementation (e.g., caching a frequently used value, robust error handling, more generic domain model structure) in favor of code that is easier to read. In that light, we welcome any feedback that makes our samples apps easier to learn from.

Table of Contents

Requirements

In order to successfully run this sample app you need a few things:

  1. Install the PHP SDK. Refer to the instructions here.
  2. A developer.intuit.com account.
  3. An app on developer.intuit.com and the associated app token, consumer key, and consumer secret.
  4. One sandbox company, connect the company with your app and generate the OAuth tokens.

First Use Instructions

  1. Clone the GitHub repo to your computer.
  2. Update your OAuth 2 tokens

Running the code

This app provides individual sample code for CRUD operations for various QBO entities. Each PHP file can be run individually.

Steps described below is to run the PHP file for creating a customer.

  1. Open the terminal window or command prompt and cd into the CRUD directory /SampleApp-CRUD-PHP/CRUD/Customer.
  2. Run the command php CustomerCreate.php.
  3. On the console you'll see the log being generated with the new customer ID.
  4. Request/Response XMLs are generated in the folder you specified.

Follow similar steps for other classes.

Note: The sample code has been implemented for a company with a US locale. Certain fields may not be applicable for other locales or minor versions. Care should be taken to handle such scenarios separately.

sampleapp-crud-php's People

Contributors

diana-derose avatar grawlins avatar hlu2 avatar rkasaraneni20 avatar timogilvy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sampleapp-crud-php's Issues

Send Email subject

I'm looking for a simple way to send an email for an existing invoice.
I see that the SDK supports `$dataService->SendEmail($invoice, "[email protected]");

Is there a way to set a subject and body content?

Any chance to replicate this for Python Flask

I'm having a hard time replicating the examples using Python Flask.

My main objectives are:

  1. Create a Sales Receipt
  2. Create Invoice
  3. Receive payment (applied to specific invoice)

Not very much documentation and samples for developing with Python...

Thanks a lot!

Invoice Crud Create won't work with CA sandbox

The same Invoice Crud Create that works with a US sandbox will not work with a CA sandbox.

What am I doing wrong?
I've even added currencyref as indicated for multicurrency documentation:

            $qbinvoice = Invoice::create([
                "Line" => [
                [
                     "Amount" => 100.00,
                     "DetailType" => "SalesItemLineDetail",
                     "SalesItemLineDetail" => [
                       "ItemRef" => [
                         "value" => 1,
                         "name" => "Services"
                       ]
                     ]
                ]
                ],
                "CustomerRef"=> [
                      "value"=> 1
                ],
                "CurrencyRef"=> [
                      "value"=> "CAD"
                ],
                "BillEmail" => [
                      "Address" => "[email protected]"
                ],
                "BillEmailCc" => [
                      "Address" => "[email protected]"
                ],
                "BillEmailBcc" => [
                      "Address" => "[email protected]"
                ]
            ]);

Use of undefined constant OAUTH_SIG_METHOD_HMACSHA1

I got this issue when I try to fetch contact list.
check

Use of undefined constant OAUTH_SIG_METHOD_HMACSHA1 - assumed 'OAUTH_SIG_METHOD_HMACSHA1' in E:\xampp\htdocs\demo\quick_book\v3-php-sdk-2.4.1\Security\OAuthRequestValidator.php on line 80

Request is not made successful

Request is not made successful. Response Code:[400] with body: [Invalid NumberInvalid Number : ].
I am trying to update

$item = $dataService->FindbyId('item', 26);
        $theResourceObj = Item::update($item , [
            "QtyOnHand" => 101
        ]);

Any solution!?

PSR-4 and composer

The SDK is now a composer library. Why is this demo not implementing PSR-4 autoloading?

authentication fail

/Customer/CustomerCreate.php - Uncaught QuickBooksOnline\API\Exception\ServiceException: Http Status Code [400]: Request is not made successful. Response Code:[400] with body: [Unsupported OperationOperation Could not find resource for relative : /v3/company/customer of full path: https://c50.sandbox.qbo.intuit.com/qbo50/v3/company/customer?minorversion=8 is not supported.].

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.