laravel-shopify icon indicating copy to clipboard operation
laravel-shopify copied to clipboard

about WebhookController.php line 27

Open peking2008 opened this issue 3 years ago • 7 comments

For bug reporting only! If you're posting a feature request or discussion, please ignore.

Expected Behavior

$jobData = json_decode($request->getContent(),true);

Current Behavior

current: $jobData = json_decode($request->getContent());

Context

如果不直接转化成数组,后期在job里调用非常麻烦。为什么不直接让他转化成数组呢?

peking2008 avatar Aug 06 '21 03:08 peking2008

I am not sure what you're asking or what your issue is, can you explain?

gnikyt avatar Aug 06 '21 13:08 gnikyt

I am not sure what you're asking or what your issue is, can you explain?

eg.xxxJob.php:

`public function __construct($shopDomain, $data) { $this->shopDomain = $shopDomain; //this $data is stdclass not a array $this->data = $data; }

public function handle() { //if like this use is error.you must invert to array by stdclass $this->data['orders']['edgs']['id'];

$user = User::where('name', $this->shopDomain)->firstOrFail(); // do stuff here } `

peking2008 avatar Aug 06 '21 14:08 peking2008

I am sorry. I am English is very poor

peking2008 avatar Aug 06 '21 14:08 peking2008

Write your issue in your native language, and Google Translate it to English, might help.

On Fri., Aug. 6, 2021, 11:50 peking2008, @.***> wrote:

I am sorry. I am English is very poor

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/osiset/laravel-shopify/issues/930#issuecomment-894295047, or unsubscribe https://github.com/notifications/unsubscribe-auth/AASO4ORLJJGYB2KQVLOETADT3PVR7ANCNFSM5BVDN4UA .

gnikyt avatar Aug 06 '21 14:08 gnikyt

I think he wants $data to be an array instead of an stdClass by default.

I think he wants $data to be an array instead of an stdClass by default.

Yes,you are right!

peking2008 avatar Aug 12 '21 04:08 peking2008

to be honest I kinda agree with him, I always need to encode and decode so I can log the received information properly. But thats up to the author

As this is not an issue and it is quite old, going to close it.

Kyon147 avatar Sep 13 '22 15:09 Kyon147