Laravel unable to get HTTP_X_SHOPIFY_HMAC_SHA256 header from shopify - laravel

I've been following the documentation for the webhook verification to get our app verified and keep getting error saying Undefined index: HTTP_X_SHOPIFY_HMAC_SHA256
Tried getting it using laravel builtin function $request->header('HTTP_X_SHOPIFY_HMAC_SHA256') and also $_SERVER['HTTP_X_SHOPIFY_HMAC_SHA256'] but both are still returning the same error.
Can anyone point me to a solution to this, been stuck with this problem for a week now.
Thanks

Related

Error getting valid response from API. Check log file for error details

I cant seem to find the error log of authorize.net api.
I have Laravel application which uses "authorizenet/authorizenet" package and the code where I try to create a customer profile, I get following error:
"Error getting valid response from API. Check log file for error details"
Can anyone tell me whereto find these logs? and what it's name?
I tried in /var/logs folder but i cant seem to find it.
if someone else has this issue, here is the solution.
The authorize.net has changed their endpoints from https://api.authorize.net to https://api2.authorize.net which is one of the possible reasons that you might get this error.
So if you are hardcoding these endpoints in your code then update it to the new one or if you are using library constant for it, same as me:
\net\authorize\api\constants\ANetEnvironment::SANDBOX
\net\authorize\api\constants\ANetEnvironment::PRODUCTION
Then simply update your library by running:
composer update authorizenet/authorizenet
This is how I resolved it and it seems to be the best way so far because it will update their library to take everything up to date if they have changes something else and you started experiencing this issue.
I hope it helps

How to get accounts/pages associated with a user using FbGraph2 gem?

I am using fb_graph2(1.1.1) in my rails project. My goal is to get all pages/accounts associated with a particular account. I am using this document as a reference. And below is my code line which I wrote to get accounts. For some reason I am getting an error "An unknown error has occurred."
It would be great if someone can guide where and what am I doing wrong. Thanks!
FbGraph2::User.me(<ACCESS_TOKEN>).accounts

Paypal integration throws an error - Undefined index: log.FileName

I am integrating a paypal in my website. I referred this link -
link
But this gives me an error -
Undefined index: log.FileName
…\vendor\paypal\rest-api-sdk-php\lib\PayPal\Log\PayPalLogger.php66
I don't know why it is not working still it's a same code of above link.
First thing first. As you can see, the sdk is not able to create a log file at the given location. Can you please provide write permissions to make that happen ? That should let your see the right error message

How to trace a "unexpected '?'" syntax error in a Laravel/PHP app?

I deployed my Laravel application to my web hosting site. Everything transferred successfully, but every time I login I get some message about parse syntax unexpected ? but its not telling me where its coming from this happens also on my other pages.
I'm using PHP 7.0 on my hosting site and Laravel 5.4. it will mean so much if you can help me understand what is going on. I can't provide you with a code because I don't know where the error is coming from. It doesn't tell me what line or anything. Please do not tell me the solution is in this similar question where it says "parse error" duplicate because I tried that and nothing happened
Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE)
The question marks are a feature of php 7.1. As you have said in the comments, the version on the server is only 7.0.
see http://php.net/manual/en/migration71.new-features.php for more information about this feature.

Can't clear cache Symfony in production

Despite of all my attempts to understand the problem, I still can't figure out what is happening.
I developped a website with Symfony 2.7 which perfectly works in dev mode. When I tested it in production mode, an error 500 is returned.
The exception is :
Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalErrorException:
"Error: Call to a member function getCacheFactory() on a non-object" at
/home/admdev-php/public_html/sfSUAPS/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php line 3039
{"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalErrorException(code: 0):
Error: Call to a member function getCacheFactory() on a non-object at
/home/admdev-php/public_html/sfSUAPS/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php:3039)"} []
So I've tried to clear the cache and I had the same message :
[Symfony\Component\Debug\Exception\FatalErrorException]
Compile Error: require(): Failed opening required
'/home/stagiaire/workspace/suaps/app/cache/prod/doctrine/orm/Proxies/__CG__AppBundleEntityPlace.php'
(include_path='.:/usr/share/php:/usr/share/pear')`
I've tried to clear doctrine's cache but this doesn't solve the problem.
There are severals roles : One for students, one for teachers and one for admins. I only get this error when my role is student. So I looked closer to methods which are concerned and I commented everything related to studies and it worked. So I think the error is linked with my Entity Repository since "findBy" and "findAll" are failing.
I've took a look into Symfony's code but the error seems to be on my side. I really don't know what is going on, thank you if you can help me.
Problem solved
Turns out someone used an entity directly from cache...
Turns out someone used an entity directly from cache...
use Proxies\__CG__\AppBundle\Entity\Place;

Resources