Giter Club home page Giter Club logo

Comments (9)

Kyon147 avatar Kyon147 commented on September 13, 2024

Are you testing locally? As mentioned in the wiki https://github.com/Kyon147/laravel-shopify/wiki/Creating-Webhooks#webhook-requirements they are highly inconsistent when testing locally.

I have webhooks working on the latest version on prod, so I suspect this is a set up issue not a package one.

Re-open if you have more information that it could be package specific.

from laravel-shopify.

a-akashsoni avatar a-akashsoni commented on September 13, 2024

@Kyon147 , I am testing on the server. But its response is null. Kindly help me why the webhooks are not give response on the server. Kindly revert on this as soon as possible. so we can resolve the issue and run the webhooks on the server.

Thanks.

from laravel-shopify.

Kyon147 avatar Kyon147 commented on September 13, 2024

@a-akashsoni I'll need more information to help you.

Can you link me to your codebase so I can see your set up.

from laravel-shopify.

a-akashsoni avatar a-akashsoni commented on September 13, 2024

@Kyon147 you can check the webhooks in config.php. Code is below for webhook in config.php.

`'webhooks' => [
/*
[
'topic' => env('SHOPIFY_WEBHOOK_1_TOPIC', 'ORDERS_CREATE'),
'address' => env('SHOPIFY_WEBHOOK_1_ADDRESS', 'https://some-app.com/webhook/orders-create')
], [
'topic' => env('SHOPIFY_WEBHOOK_2_TOPIC', 'APP_PURCHASES_ONE_TIME_UPDATE'),
'address' => env('SHOPIFY_WEBHOOK_2_ADDRESS', 'https://some-app.com/webhook/purchase'),
]
...
*/

        [
            'topic' => env('SHOPIFY_WEBHOOK_1_TOPIC','FULFILLMENTS_CREATE'),
            'address' => env('SHOPIFY_WEBHOOK_1_ADDRESS','https://shipping-carrier.auspicioussoft.com/webhook/fulfillments-create')
        ],
        [
            'topic' => env('SHOPIFY_WEBHOOK_2_TOPIC','FULFILLMENTS_UPDATE'),
            'address' => env('SHOPIFY_WEBHOOK_2_ADDRESS','https://shipping-carrier.auspicioussoft.com/webhook/fulfillments-update')
        ],


],`

You can check the whole code for fulfillment Create Job is below. Kindly check the code for Job also.

`<?php namespace App\Jobs;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Osiset\ShopifyApp\Objects\Values\ShopDomain;
use stdClass;
use App\User;
use Log;

class FulfillmentsCreateJob implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

/**
 * Shop's myshopify domain
 *
 * @var ShopDomain|string
 */
public $shopDomain;

/**
 * The webhook data
 *
 * @var object
 */
public $data;

/**
 * Create a new job instance.
 *
 * @param string   $shopDomain The shop's myshopify domain.
 * @param stdClass $data       The webhook data (JSON decoded).
 *
 * @return void
 */
public function __construct($shopDomain, $data)
{
    $this->shopDomain = $shopDomain;
    $this->data = $data;
}

/**
 * Execute the job.
 *
 * @return void
 */
public function handle()
{
    info($data);
    
    // Convert domain
    $this->shopDomain = ShopDomain::fromNative($this->shopDomain,$this-> data,$data);
   try{
    $shop = User::where('name', $this->shopDomain)->first();
    }
    catch(\Exception $e){
        Log::error($e->getMessage());
    }
    // Do what you wish with the data
    // Access domain name as $this->shopDomain->toNative()
}

}`

Kindly check the code and revert on the same as soon as possible.

Thanks.

from laravel-shopify.

Kyon147 avatar Kyon147 commented on September 13, 2024

image

Does the order create webhook work?

from laravel-shopify.

Kyon147 avatar Kyon147 commented on September 13, 2024

I would try a different webhook to see if it is an issue with the fulfilment ones.

from laravel-shopify.

a-akashsoni avatar a-akashsoni commented on September 13, 2024

@Kyon147 , Is different webhook is working properly.

from laravel-shopify.

a-akashsoni avatar a-akashsoni commented on September 13, 2024

@Kyon147 I have shared Job handle function code with you. when I run info($data) command , it does not show anything.
Kindly check the issue help me to resolve the issue.

Thanks.

from laravel-shopify.

a-akashsoni avatar a-akashsoni commented on September 13, 2024

@Kyon147 Any update on this issue ?

from laravel-shopify.

Related Issues (20)

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.