Class: WebhookJob

Inherits:
Struct
  • Object
show all
Defined in:
lib/generators/shopqi_app_webhook/templates/app/jobs/webhook_job.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#shop_idObject

Returns the value of attribute shop_id

Returns:

  • (Object)

    the current value of shop_id



2
3
4
# File 'lib/generators/shopqi_app_webhook/templates/app/jobs/webhook_job.rb', line 2

def shop_id
  @shop_id
end

Instance Method Details

#performObject



4
5
6
7
# File 'lib/generators/shopqi_app_webhook/templates/app/jobs/webhook_job.rb', line 4

def perform
  Shop.find(shop_id).use_shopkit
  Shopkit.create_webhook event: 'orders/fulfilled', callback_url: "http://#{SecretSetting.domain.host}/webhook"
end