disco_app 0.10.0 → 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40cd49bbcbb382cf534d7b92d20b3235d75dfd1d8c0543fcc9829ec3895af6ac
|
4
|
+
data.tar.gz: 7b5457cb9d1d4d6ea0880ba979535d326e255d5b992fec7390f83a3c0dbdbbe3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f18163091ba171e4ef44f0563b7815d70c46ecdd93341aaa1d6a0525ea3face8fb7da2213c481721432d4005c98786e5dc7f25f328e0317c2df4ca0a4eae090
|
7
|
+
data.tar.gz: b9f7ebc827d2b16293c2a9ef260ce5c879c19b43f67b429e5e909f09382cb9c85297a04208af62db6b6691de2c8d7bfe900700396cedd8d217894cb059fdcb99
|
@@ -3,6 +3,8 @@ module DiscoApp::Concerns::CarrierRequestController
|
|
3
3
|
|
4
4
|
included do
|
5
5
|
before_action :verify_carrier_request
|
6
|
+
before_action :find_shop
|
7
|
+
before_action :validate_rate_params
|
6
8
|
end
|
7
9
|
|
8
10
|
private
|
@@ -18,4 +20,16 @@ module DiscoApp::Concerns::CarrierRequestController
|
|
18
20
|
DiscoApp::CarrierRequestService.is_valid_hmac?(request.body.read.to_s, ShopifyApp.configuration.secret, request.headers['HTTP_X_SHOPIFY_HMAC_SHA256'])
|
19
21
|
end
|
20
22
|
|
23
|
+
def find_shop
|
24
|
+
unless (@shop = DiscoApp::Shop.find_by_shopify_domain(request.headers['HTTP_X_SHOPIFY_SHOP_DOMAIN']))
|
25
|
+
head :unauthorized
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def validate_rate_params
|
30
|
+
unless params[:rate].present? and params[:rate][:origin].present? and params[:rate][:destination].present? and params[:rate][:items].present?
|
31
|
+
head :bad_request
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
21
35
|
end
|
data/lib/disco_app/version.rb
CHANGED