PHP + create invoice into QuickBooks use API - php

Please help me, I'm integrating QuickBook API into our script and I get the message below when i run file: http://domain.com/build_20130416/dev/dev_ids_invoices.php
Fatal error: Call to undefined method QuickBooks_IPP::application()
I'm using php script.

Please take the time to read the documentation and look at the example files in the docs/example_app_ipp_v3/ directory for the code you downloaded. Also, make sure you follow the quick-start guide. And next time, post your code.
If you look in the same dev/ directory for the code you're using, you'll see a file named:
DO_NOT_USE_THESE_FILES.txt
With the contents:
DO NOT USE THE EXAMPLES IN THIS FOLDER!
THESE ARE ALL DEVELOPMENT/TEST SCRIPTS, AND ARE NOT PRODUCTION READY!
You should not be using the example script you're trying to use just like the file says.
It's a development testing script, and not an example that you should be using.
Instead, you should look at the code in the docs directory, which has tons of working examples. Here's a link for you to the examples on GitHub:
https://github.com/consolibyte/quickbooks-php/tree/master/docs/example_app_ipp_v3
Specifically, here's some related to invoices:
https://github.com/consolibyte/quickbooks-php/blob/master/docs/example_app_ipp_v3/example_invoice_add.php
https://github.com/consolibyte/quickbooks-php/blob/master/docs/example_app_ipp_v3/example_invoice_query.php
https://github.com/consolibyte/quickbooks-php/blob/master/docs/example_app_ipp_v3/example_invoice_w_lines_query.php
https://github.com/consolibyte/quickbooks-php/blob/master/docs/example_app_ipp_v3/example_invoice_with_custom_fields_add.php
https://github.com/consolibyte/quickbooks-php/blob/master/docs/example_app_ipp_v3/example_invoices_for_customer_query.php

Related

Trouble with CKFinder + Laravel 8

I did everything according to points 1-5 as indicated in the Readme.MD
https://github.com/ckfinder/ckfinder-laravel-package#configuring-authentication
On site authors say: At this point you should see the connector JSON response after navigating to the <APP BASE URL>/ckfinder/connector?command=Init address. Authentication for CKFinder is not configured yet, so you will see an error response saying that CKFinder is not enabled
I opened link
http://127.0.0.1:8000/ckfinder/connector?command=Init
And have JSON error:
{"error":{"number":110,"message":"Unknown error."}}
Can someone help me? How to find reason of trouble? i google many sites and there is no desicion
Are you using PHP 8+?
For me the issue was a deprecated line in the package itself.
I fixed this error by changing vendor\ckfinder\ckfinder-laravel-package\_connector\ArgumentResolver.php line 65
from
if ($reflectionClass = $param->getClass()) {
to
if ($reflectionClass = new \ReflectionClass($param->getType()->getName())) {
because getClass() is deprecated in PHP 8.0.3, It works fine for me now.
Note: Do keep in mind that it's not good to change things inside the vendor folder!

Using Stripe and Mailgun in Custom Webhook hosted on WordPress site

Hello Stackoverflowers!
I have been in a really big bind trying to solve this configuration/implementation of a webhook that utilizes both the Stripe PHP library and the Mailgun API. My intention is to send an email (with Mailgun) whenever one of my Stripe customers performs a certain action which has been recorded as an event in my Stripe endpoint. I have been trying to follow the guidelines of this documentation https://stripe.com/docs/recipes/sending-emails-for-failed-payments but unfortunately I think I am missing something in my understanding of how to make this work. I have a SiteGround hosted WordPress site which I am trying to host my webhook.php file and Stripe PHP library on. I uploaded the entire Stripe PHP library (in a folder named "stripe-php-master") to my "/wp-includes/" directory. In the webhook.php file I changed the boilerplate code in the documentation (https://stripe.com/docs/recipes/sending-emails-for-failed-payments) from
// If you're using Composer, use Composer's autoload
require_once('vendor/autoload.php');
to
$file = dirname(__FILE__) . '/init.php';
require_once($file);
because I am not sure how to utilize "Composer" in this scenario within the confines/context of of a SiteGround hosted WordPress site, so I figured this may be a suitable approach (according to https://packagist.org/packages/stripe/stripe-php) please correct me if I am wrong! When I try to visit the URL of my webhook.php file at https://mysitename.com/wp-includes/stripe-php-master/webhook.php I receive this error "Fatal error: Uncaught Error: Class 'Mailgun\Mailgun' not found in /home/mysitef3/public_html/wp-includes/stripe-php-master/webhook.php:16 Stack trace: #0 {main} thrown in /home/mysitef3/public_html/wp-includes/stripe-php-master/webhook.php on line 16". Could any of you please help me figure out what I am doing wrong here please and thank you!!!

Jasper Report -- Resource not found

I am developing a jasper report in PHP
I have tried embedded jasper library 0.9d -- PhpJasperLibrary-master
After fixing part of the code in the library,
It works normally but it cannot display table format which is very important for me to develop Jasper report so I give up in this method and build up an jasper server.
I have installed the PHP Client(v2.0) by composer and using the sample code in the following link
http://community.jaspersoft.com/wiki/php-client-sample-code
http://community.jaspersoft.com/project/php-client/releases
I am not sure why there is a lot of bugs in the sample code like getjob(s) function and passing variable to class client.
Anyway, I fixed it and the server info can be called.
In the last stage, I cannot run the report and the error message shown that the resource of my report not found.
Jaspersoft\Exception\RESTRequestException
Resource /20150604 not found.
I could like you to help me and I hope I can release a prefect version after all parts done.Thanks
And the below is my report information.
I have put my report under the folder /reports
and it can run in the jasper server
I have checked the URL that calling the report is like below
localhost:9090/jasperserver/rest_v2/reports/20150604.html
I have concern about the URL but I cant find any reference to it.
So please support me to fix the problem.
Thanks
additional: here is the code I call the report
$report = $c->reportService()->runReport('/20150604', 'html');
Hmm the rest endpoint to "run" a report is js/rest_v2/?path to report?.html
Unless your report is in the root of your organization, then you need a path.
Check out this (line 20):
https://github.com/jasonhuber/Jaspersoft_InputControlsFromCSV/blob/master/index.html#L20
and check in the web services guide page 71...

Fatal error: Class 'Stripe' not found in C:\wamp\www\

I'm getting an error that class is not found, but I clearly have the right path for where it is located:
<?php
require_once('stripe-php-2.1.0/stripe/lib/Stripe.php');
Stripe::setApiKey('my_key');
var_dump($_POST['stripe-token']);
?>
Every article I've come across all claim that the problem is (not including the right path) in the require_one, include, or require. (I've tried all 3). But still no luck. My database calls follow the same format and my WAMP server has no problem creating my database class.
This is copied directly from my file explore (copy paste)
website\stripe-php-2.1.0\stripe\lib\Stripe.php
My php file that I am using to try and access Stripe sits in the same place as 'website'.
PHP version 5.5.12
tutorial references: http://www.larryullman.com/2013/01/09/writing-the-php-code-to-process-payments-with-stripe/
Other reference: http://www.youtube.com/watch?v=Lka_JBM9bbY
It's because it uses a namespace. Try:
\Stripe\Stripe::setApiKey('my_key');
It is better to initialize all classes.
require_once ("stripe_folder/init.php");
then use namespaces:
\Stripe\Stripe::setApiKey('key_key_key_key_key_key');

Codeigniter: Consume RESTful service

Is there an easy to setup Codeigniter REST library which I can use to consume a RESTful service? I tried setting up this library. But could not set up Spark. Tried following steps:
Adding a directory named sparks in the root of your codeigniter directory
Adding a custom Loader Class to application/core/MY_Loader.php.
It gave me another error Cannot find spark path at sparks/curl/1.2.1/. Now I am stuck. Wondering why it is so hard to setup RESTful API in codeigniter.
Update: When I try to run
$this->load->spark('restclient/2.1.0');
// Load the library
$this->load->library('rest');
// Run some setup
$this->rest->initialize(array('server' => 'http://api.twitter.com/'));
// Pull in an array of tweets
$tweets = $this->rest->get('1/statuses/user_timeline.json?include_entities=true&include_rts=true&screen_name=jenksuy&count=2');
$tweetobjects = json_decode($tweets);
foreach ($tweetobjects['results'] as $tweet) {
log_message('info', $tweet['text']);
}
I am getting Error: Call to undefined method CI_Loader::spark()
sparks is not necessary SEE EDIT. use this tutorial to start, the author also wrote the libraries
http://net.tutsplus.com/tutorials/php/working-with-restful-services-in-codeigniter-2/
download these two to work with the tutorial:
https://github.com/philsturgeon/codeigniter-restserver
https://github.com/philsturgeon/codeigniter-restclient
also at the end of the tutorial - theres many comments and questions, and the tutorial author has answered many of them
EDIT - whoops forgot you have to change one line. and you will need to DL the CI curl library. OK so in the rest client, in the file Rest.php starting at line 53
/* Not using Sparks? You bloody well should be.
| If you are going to be a stick in the mud then do it the old fashioned way
$this->_ci->load->library('curl');
*/
// Load the cURL spark which this is dependant on
$this->_ci->load->spark('curl/1.2.1');
so change it to load curl library the traditional way and commment out the spark reference
$this->_ci->load->library('curl');
// Load the cURL spark which this is dependant on
// $this->_ci->load->spark('curl/1.2.1');
You can install curl 1.2.1 by running the following command on your application root (not your application folder):
php tools/spark install -v1.2.1 curl
Source

Categories