3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
# File 'lib/generators/shopqi_app_webhook/templates/app/controllers/webhook_controller.rb', line 3
def orders_fulfilled
order = JSON(request.body.read)['order']
shop.orders.where(order_id: order_id).first_or_create!({
name: order['name'],
financial_status_name: order['financial_status_name'],
financial_status: order['financial_status'],
fulfillment_status: order['fulfillment_status'],
fulfillment_status_name: order['fulfillment_status_name'],
order_id: order['id'],
total_price: order['total_price'],
created_at: order['created_at']
})
render nothing: true
end
|