robvankeilegom / firefly-III-paypal-importer

PayPal Data Importer for Firefly III
48 stars 3 forks source link

Undefined Method stdClass::getBody() on CLI Sync call #8

Closed PhalanxHead closed 2 years ago

PhalanxHead commented 2 years ago

Hi,

Apologies if this is something of a silly question, I'm a php newbie for sure.

Anyway when I run this container as described in the readme, and then run the php artisan sync command, I get the following error

Start pulling data from PayPal

In PayPal.php line 60:

  Call to undefined method stdClass::getBody()

I've run with the following docker command:

docker run \
    --volume=$PWD/data:/data \
    --publish=8080:80 \
    --env=FIREFLY_TOKEN=[my FF PAT] \
    --env=FIREFLY_URI=firefly.phalanxhead.dev \
    --env=FIREFLY_PAYPAL_ACCOUNT_ID=41 \
    --env=PAYPAL_CLIENT_ID=[my Paypal ClientID] \
    --env=PAYPAL_CLIENT_SECRET=[my Paypal ClientSecret] \
    --restart=always \
    --detach=true \
    --name=firefly-iii-paypal-importer \
    robvankeilegom/firefly-iii-paypal-importer:latest

If I run the same docker command, but with the FIREFLY_URI prepended with https://, I get the following error:

Warning: require_once(/var/www/html/bootstrap/../vendor/autoload.php): Failed to open stream: No such file or directory in /var/www/html/bootstrap/app.php on line 3

Fatal error: Uncaught Error: Failed opening required '/var/www/html/bootstrap/../vendor/autoload.php' (include_path='.:/usr/local/lib/php') in /var/www/html/bootstrap/app.php:3
Stack trace:
#0 /var/www/html/artisan(18): require()
#1 {main}
  thrown in /var/www/html/bootstrap/app.php on line 3

Any suggestions?

Thanks in advance :D

Pumba98 commented 2 years ago

Hi, had the same problem. Make sure you have "Transaction Search" permission checked for your application in the paypal developer portal. Hope that helps 😄

PhalanxHead commented 2 years ago

Looks like it's fixed it, thanks :D

The docs for this really could use a more in-depth listing. Doesn't even mention you need a business account set up :/

robvankeilegom commented 2 years ago

Hey guys, sorry for taking so long. I'm adding a line to the README explaining you need the 'Transaction Search' toggle on. If there we're any other hurdles you came across, lmk! You don't need a business account though. I for sure don't have one.

PhalanxHead commented 2 years ago

No stress, thanks Rob.

As far as business accounts go, it seemed that paypal would only let me access my live transaction data using a business account. Personal is limited only to sandbox accounts, at least in Australia, as far as I could tell.

The only issue I'm having now is that the transactions don't seem to actually be showing up in Firefly, even though the CLI says it completed successfully. I'm.... not sure what I'm doing wrong, it may be just my firefly setup is borked :')

robvankeilegom commented 2 years ago

Hey guys, sorry for taking so long. I'm adding a line to the README explaining you need the 'Transaction Search' toggle on. If there we're any other hurdles you came across, lmk! You don't need a business account though. I for sure don't have one.

@PhalanxHead and for anyone stumbling onto this issue. I'll have to correct myself, you do need a business account. See #10 .